Compile and Test with Different JDK Versions


The original content is here.

I use a slightly modified version.

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>compile-1.1</id>
            <phase>process-sources</phase> <!-- was 'compile' -->
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <source>1.3</source>
              <target>1.1</target>
            </configuration>
          </execution>
          <execution>
            <id>testCompile-1.5</id>
            <phase>process-test-sources</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <source>1.5</source>
              <target>1.5</target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s