Hi all
right now i am trying to convert the hibernate/jpa caveatemptor application
in an maven project.
The tools i am using are maven2 and eclipse. in Eclipse I am using the
testng plugin and in maven2 the surfire plugin and a dependency on testng.
however I have the following problems:

using the standard directory layout of maven my resources in
src/main/resourses are not copied during an eclipse full build. (neither are
the ones in src/test/resources).

after I've done a maven clean test and try to run the tests in eclipse my
tests fails because (naturally and correct my testclasses are not in the
eclipse known path for compiled classes target/classes but in
target/test-classes).

after finding out the hassle of correctly setting up the resources and
classes for testing in eclipse. (meaning everything is in a location where
eclipse finds its needed resources)
my tests all comply. Yay.

But for some reason maven cannot run the test without failure in the
execution of the tests.
(no compilation error but runtime errors)
Can someone help me how to fix this problem?

here is my pom:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
 <modelVersion>4.0.0</modelVersion>
 <groupId>jpa</groupId>
 <artifactId>jpa</artifactId>
 <version>0.0.1</version>
 <build>
   <defaultGoal>package</defaultGoal>
   <plugins>
     <plugin>
       <artifactId>maven-eclipse-plugin</artifactId>
     </plugin>
     <plugin>
       <artifactId>maven-compiler-plugin</artifactId>
       <configuration>
         <source>1.5</source>
         <target>1.5</target>
       </configuration>
     </plugin>
     <plugin>
       <artifactId>maven-surefire-plugin</artifactId>
       <configuration>
         <suiteXmlFiles>
           <suiteXmlFile>src/test/resources/testsuite-integration-ejb3.xml
</suiteXmlFile>
         </suiteXmlFiles>
       </configuration>
     </plugin>
   </plugins>
 </build>
 <repositories>
   <repository>
     <id>andromeda</id>
     <name>team-andromeda</name>
     <url>http://team.andromda.org/maven2/</url>
   </repository>
 </repositories>
 <dependencies>
   <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate</artifactId>
     <version>3.2.2.ga</version>
   </dependency>
   <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate-annotations</artifactId>
     <version>3.2.1.ga</version>
   </dependency>
   <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate-entitymanager</artifactId>
     <version>3.2.1.ga</version>
   </dependency>
   <dependency>
     <groupId>log4j</groupId>
     <artifactId>log4j</artifactId>
     <version>1.2.14</version>
   </dependency>
   <dependency>
     <groupId>c3p0</groupId>
     <artifactId>c3p0</artifactId>
     <version>0.9.1</version>
   </dependency>
   <dependency>
     <groupId>javax.persistence</groupId>
     <artifactId>persistence-api</artifactId>
     <version>1.0</version>
     <scope>provided</scope>
   </dependency>
   <dependency>
       <groupId>org.jboss.microcontainer</groupId>
       <artifactId>jboss-ejb3x-client</artifactId>
       <version>1.0</version>
       <scope>provided</scope>
   </dependency>

<!-- embedded ejb3 container -->
   <dependency>
     <groupId>org.jboss.microcontainer</groupId>
     <artifactId>jboss-ejb3-all</artifactId>
     <version>alpha_9</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>org.jboss.microcontainer</groupId>
     <artifactId>jcainflow</artifactId>
     <version>alpha_9</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>org.jboss.microcontainer</groupId>
     <artifactId>jms-ra</artifactId>
     <version>alpha_9</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>quartz</groupId>
     <artifactId>quartz</artifactId>
     <version>1.5.1</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>opensymphony</groupId>
     <artifactId>quartz-jboss</artifactId>
     <version>1.5.0</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>xerces</groupId>
     <artifactId>xercesImpl</artifactId>
     <version>2.8.1</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>sax</groupId>
     <artifactId>sax</artifactId>
     <version>2.0.1</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>trove</groupId>
     <artifactId>trove</artifactId>
     <version>1.0.2</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>concurrent</groupId>
     <artifactId>concurrent</artifactId>
     <version>1.3.4</version>
     <scope>test</scope>
   </dependency>

   <!-- test frameworks -->
   <dependency>
     <groupId>hsqldb</groupId>
     <artifactId>hsqldb</artifactId>
     <version>1.8.0.7</version>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>org.testng</groupId>
     <artifactId>testng</artifactId>
     <version>5.1</version>
     <classifier>jdk15</classifier>
     <scope>test</scope>
   </dependency>
   <dependency>
     <groupId>org.dbunit</groupId>
     <artifactId>dbunit</artifactId>
     <version>2.2</version>
     <scope>test</scope>
     <exclusions>
       <exclusion>
         <artifactId>junit-addons</artifactId>
         <groupId>junit-addons</groupId>
       </exclusion>
       <exclusion>
         <artifactId>poi</artifactId>
         <groupId>poi</groupId>
       </exclusion>
     </exclusions>
   </dependency>
 </dependencies>
</project>



Thanx Rolf.

Reply via email to