Oleg Gusakov wrote: > Such contriction will not work. The problem is in the way compiler > plugin is instantiated: compiler environment is created, and them the > same instance is reused for test-compiler, sticking to the existing > plugin configuration. Execution does not get a new instance of as far > as can see. > > That is why I had to enhance the configuration of compiler plugin - > 2.1-SNAPSHOT now accepts the "test" set of parameters; see > http://jira.codehaus.org/browse/MCOMPILER-83
It can work, we do so for years now: http://svn.xstream.codehaus.org/browse/~raw,r=HEAD/xstream/trunk/xstream/pom.xml. The profile for JDK 5 + 6 configure the compiler plugin with a second execution to compile the JDK 5 specific stuff with source/target=1.5 while the standard execution uses source/target=1.3. The only caveat is that the entries in the excludes lists must have exactly the same number of entries. This can be used to compile main source with source/target=1.3 while the test source is compiled with source/target = 1.5: ============= %< =============== <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.3</source> <target>1.3</target> <excludes> <exclude>foo</exclude> </excludes> <testExcludes> <exclude>**</exclude> </testExcludes> </configuration> <executions> <execution> <id>compile-jdk15</id> <configuration> <source>1.5</source> <target>1.5</target> <excludes> <exclude>**</exclude> </excludes> <testExcludes> <exclude>foo</exclude> </testExcludes> </configuration> <goals> <goal>compile</goal> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> ============= %< =============== - Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
