I did this earlier using maven build helper plugin and adding additional source directories, so that compiler plugin gets those during test-compile phase.
Simple examples can be found under build helper plugin site. Subir -----Original Message----- From: Adam Retter [mailto:[email protected]] Sent: Monday, January 25, 2010 7:14 PM To: Stephen Connolly Cc: Maven Users List Subject: Re: failsafe-maven-plugin configuration issues I tried to add a second compile phase but this didnt seem to help - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> <executions> <execution> <id>compile-it</id> <phase>pre-integration-test</phase> <goals> <goal>compile</goal> </goals> <configuration> <includes> <include>${basedir}/src/systest/java/**/*.java</include> </includes> </configuration> </execution> </executions> </plugin> Any chance, you could explain to me a simple pom.xml where I have my Unit tests and Integration tests separated? 2010/1/25 Stephen Connolly <[email protected]>: > failsafe & surefire do not compile the classes. m-compiler-p is > responsible for compiling the classes > > 2010/1/25 Adam Retter <[email protected]> >> >> Just wondering how they compile when I change the inclusion to >> "*/*.java" for the failsafe plugin? >> >> Is there some better way of doing this whilst keeping the Unit Tests >> and Integration Tests in separate folders? >> >> 2010/1/25 Stephen Connolly <[email protected]>: >> > you are failing to also compile your integration tests.... you'd >> > need a second execution of compiler:testCompile >> > >> > 2010/1/25 Adam Retter <[email protected]> >> >> >> >> I have both Unit tests and Integration tests in my project and was >> >> attempting to manage this with the Surefire plugin in this way - >> >> >> >> http://weblogs.java.net/blog/johnsmart/archive/2008/06/unit_tests_ >> >> are.html >> >> But I ran into problems - >> >> >> >> >> >> http://markmail.org/search/?q=list%3Aorg.apache.maven.users#query: >> >> list%3Aorg.apache.maven.users+page:4+mid:om7z6osunu5pz4gm+state:re >> >> sults >> >> >> >> It was recommended that I switch to the failsafe-maven-plugin for >> >> managing my integration tests and as such I modified my project >> >> layout so it looks like this - >> >> >> >> src/main/java >> >> src/main/resources >> >> src/test/java >> >> src/test/resources >> >> src/systest/java >> >> src/systest/resources >> >> >> >> So the idea is that I keep my tests in src/test and my integration >> >> tests in src/systest. I added the following to my pom.xml - >> >> >> >> <plugin> >> >> <groupId>org.codehaus.mojo</groupId> >> >> <artifactId>failsafe-maven-plugin</artifactId> >> >> <!-- version>2.4.3-alpha-1</version --> >> >> <configuration> >> >> >> >> <testSourceDirectory>${basedir}/src/systest/java</testSourceDirect >> >> ory> >> >> <includes> >> >> <include>*.java</include> >> >> </includes> >> >> </configuration> >> >> <executions> >> >> <execution> >> >> <id>integration-test</id> >> >> <phase>integration-test</phase> >> >> <goals> >> >> <goal>integration-test</goal> >> >> </goals> >> >> </execution> >> >> <execution> >> >> <id>verify</id> >> >> <phase>verify</phase> >> >> <goals> >> >> <goal>verify</goal> >> >> </goals> >> >> </execution> >> >> </executions> >> >> </plugin> >> >> >> >> >> >> But only the unit tests are run in the test goal and no >> >> integration tests are found or run during the integration-test goal. >> >> If I change the inclusion to "**/*.java", then the problem is that >> >> the unit tests are run during the test goal and the unit tests and >> >> integration tests are mixed up and run together during the >> >> integration-test goal. The idea is that the integration-test goal >> >> should just run the integration tests (obviously after running the >> >> unit tests as part of the test goal). >> >> >> >> So what am I doing wrong here? >> >> >> >> -- >> >> Adam Retter >> >> >> >> skype :adam.retter >> >> http://www.adamretter.org.uk >> > >> > >> >> >> >> -- >> Adam Retter >> >> skype :adam.retter >> http://www.adamretter.org.uk > > -- Adam Retter skype :adam.retter http://www.adamretter.org.uk --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
