Sahoo wrote:
(Resending as I am on the users alias now. I have also put a reference to a similar unsolved question from the past)

Hi,

I want to pass different options to maven-compiler-plugin during compile
and testCompile goals. Let's say, I want to set source level as 1.4 for
all my src/main/java code and set source level as 1.5 for my test
sources. How do I do it? I found someone having similar requirements in the past [1], but there is no mention of a working solution yet.

Thanks,
Sahoo

[1] http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/[EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

what about something like this?

<build>
      <plugins>
              <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler
-plugin</artifactId>
                      <configuration>
<compilerVersion>${sourceLevel}</compilerVersion>
                              <source>${sourceLevel}</source>
                              <target>${sourceLevel}</target>
                      </configuration>
                      <executions>
                              <execution>
                                      <id>compile-tests</id>
                                      <phase>process-test-sources</phase>
                                      <goals>
                                              <goal>testCompile</goal>
                                      </goals>
                                      <configuration>
<source>${testSourceLevel}</source> <target>${testSourceLevel}</target>
                                      </configuration>
                              </execution>
                      </executions>
              </plugin>
      </plugins>
</build>
<properties>
      <sourceLevel>1.4</sourceLevel>
      <testSourceLevel>1.5</testSourceLevel>
</properties>

Regards

Milos Kleint


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to