3 Replies Latest reply on Jan 27, 2012 8:20 AM by kgoedert

    tests run in maven but fail in eclipse

    kgoedert

      Hi,

       

      I have a new eclipse indigo installation with jboss tools and maven plugins (the ones that currently appear on eclipse marketplace). I create a project using jboss forge (b5) and imported the project into eclipse. I am also using jboss 6.1.0.final. I was able to work with the project, deploy it, it is working. My next step was to setup arquillian to work with this project. I followed the instructions on the documentation page, and I am able to run the tests with the profile using maven on the command line, but I cant get the profile to work inside eclipse. The dependencies seem to not be found anymore, and jboss shows a linkage error when trying to redeploy de project, after the project -> clean install step.

       

      How can I get the integration with eclipse to work correctly?

       

      Thanks

       

      Kelly

        • 1. Re: tests run in maven but fail in eclipse
          kgoedert

          Just to leave it registered, I was missing a repository configuration and the jbossas-client dependency was wrong, the pom that worked for me is this:

           

          <?xml version="1.0" encoding="UTF-8"?>

          <project

                    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"

                    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

                    <modelVersion>4.0.0</modelVersion>

                    <groupId>com.forge.example</groupId>

                    <artifactId>forgetest2</artifactId>

                    <version>1.0.0-SNAPSHOT</version>

                    <packaging>war</packaging>

           

                    <properties>

                              <arquillian.version>1.0.0.CR1</arquillian.version>

                              <jboss-javaee6-spec.version>1.0.0.Final</jboss-javaee6-spec.version>

                    </properties>

           

           

                    <profiles>

                              <profile>

                                        <id>jbossas-remote-6</id>

                                        <dependencies>

                                                  <dependency>

                                                            <groupId>org.jboss.arquillian.container</groupId>

                                                            <artifactId>arquillian-jbossas-remote-6</artifactId>

                                                            <version>${arquillian.version}</version>

                                                  </dependency>

                                                  <dependency>

                                                            <groupId>org.jboss.jbossas</groupId>

                                                            <artifactId>jboss-as-client</artifactId>

                                                            <version>6.1.0.Final</version>

                                                            <type>pom</type>

                                                  </dependency>

                                        </dependencies>

                              </profile>

                              <!-- profile>

                    

                      <id>arq-jbossas-remote</id>

                      <dependencies>

                          <dependency>

                              <groupId>org.jboss.arquillian.container</groupId>

                              <artifactId>arquillian-jbossas-remote-6</artifactId>

                              <version>${arquillian.version}</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.jboss.spec</groupId>

                              <artifactId>jboss-javaee-6.0</artifactId>

                              <version>${jboss-javaee6-spec.version}</version>

                              <type>pom</type>

                              <scope>provided</scope>

                          </dependency>

                    

                          <dependency>

                              <groupId>org.jboss.jbossas</groupId>

                              <artifactId>jboss-as-profileservice-client</artifactId>

                              <version>6.0.0.Final</version>

                              <type>pom</type>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.jboss.deployers</groupId>

                              <artifactId>jboss-deployers-client-spi</artifactId>

                              <version>2.2.0.GA</version>

                              <scope>test</scope>

                          </dependency>

                      </dependencies>

                      <build>

                          <testResources>

                              <testResource>

                                  <directory>src/test/resources</directory>

                              </testResource>

                              <testResource>

                                  <directory>src/test/resources-jbossas</directory>

                              </testResource>

                          </testResources>

                      </build>

                  </profile-->

                    </profiles>

           

                    <dependencyManagement>

                              <dependencies>

                                        <dependency>

                                                  <groupId>org.jboss.spec</groupId>

                                                  <artifactId>jboss-javaee-6.0</artifactId>

                                                  <version>2.0.0.Final</version>

                                                  <type>pom</type>

                                                  <scope>import</scope>

                                        </dependency>

                                        <dependency>

                                                  <groupId>org.hibernate</groupId>

                                                  <artifactId>hibernate-entitymanager</artifactId>

                                                  <version>4.0.1.Final</version>

                                                  <scope>provided</scope>

                                        </dependency>

                              </dependencies>

                    </dependencyManagement>

                    <dependencies>

                              <dependency>

                                        <groupId>org.hibernate.javax.persistence</groupId>

                                        <artifactId>hibernate-jpa-2.0-api</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.jboss.spec.javax.ejb</groupId>

                                        <artifactId>jboss-ejb-api_3.1_spec</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.jboss.spec.javax.transaction</groupId>

                                        <artifactId>jboss-transaction-api_1.1_spec</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>javax.enterprise</groupId>

                                        <artifactId>cdi-api</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.jboss.spec.javax.annotation</groupId>

                                        <artifactId>jboss-annotations-api_1.1_spec</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.jboss.spec.javax.servlet</groupId>

                                        <artifactId>jboss-servlet-api_3.0_spec</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.jboss.spec.javax.faces</groupId>

                                        <artifactId>jboss-jsf-api_2.0_spec</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.hibernate</groupId>

                                        <artifactId>hibernate-entitymanager</artifactId>

                                        <scope>provided</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.primefaces</groupId>

                                        <artifactId>primefaces</artifactId>

                                        <version>3.0</version>

                              </dependency>

                              <dependency>

                                        <groupId>org.glassfish</groupId>

                                        <artifactId>javax.faces</artifactId>

                                        <version>2.1.6</version>

                              </dependency>

                              <dependency>

                                        <groupId>junit</groupId>

                                        <artifactId>junit</artifactId>

                                        <version>4.8.2</version>

                                        <scope>test</scope>

                              </dependency>

                              <dependency>

                                        <groupId>org.jboss.arquillian.junit</groupId>

                                        <artifactId>arquillian-junit-container</artifactId>

                                        <version>${arquillian.version}</version>

                                        <scope>test</scope>

                              </dependency>

                    </dependencies>

           

                    <repositories>

                              <repository>

                                        <id>JBOSS_NEXUS</id>

                                        <url>http://repository.jboss.org/nexus/content/groups/public</url>

                              </repository>

                              <repository>

                      <id>maven-nuxeo</id>

                      <name>Maven Nuxeo Repository</name>

                      <url>https://maven.nuxeo.org/nexus/content/groups/public/</url>

                      <layout>default</layout>

                      <releases>

                          <enabled>true</enabled>

                          <updatePolicy>never</updatePolicy>

                      </releases>

                      <snapshots>

                          <enabled>true</enabled>

                          <updatePolicy>never</updatePolicy>

                      </snapshots>

                  </repository>

                              <repository>

                                        <id>Prime Technology Maven Repository</id>

                                        <url>http://repository.primefaces.org</url>

                              </repository>

                    </repositories>

                    <build>

                              <finalName>forgetest2</finalName>

                              <plugins>

                                        <plugin>

                                                  <artifactId>maven-compiler-plugin</artifactId>

                                                  <version>2.3.2</version>

                                                  <configuration>

                                                            <source>1.6</source>

                                                            <target>1.6</target>

                                                  </configuration>

                                        </plugin>

                                        <plugin>

                                                  <artifactId>maven-war-plugin</artifactId>

                                                  <extensions>false</extensions>

                                                  <configuration>

                                                            <failOnMissingWebXml>false</failOnMissingWebXml>

                                                  </configuration>

                                        </plugin>

                              </plugins>

                    </build>

          </project>

          • 2. Re: tests run in maven but fail in eclipse
            bmajsak

            Does it also work with Arquillian Core CR7?

            • 3. Re: tests run in maven but fail in eclipse
              kgoedert

              I haven't tested it yet. I will do it soon, and I can post back.