As Haleim says, you need to do this in two steps: one for compilation and one for cans.
For the compiler
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.5</version> <executions> <execution> <configuration> <source>1.3</source> <target>1.5</target> <fork>true</fork> <outputDirectory>${project.build.outputDirectory}_jdk5</outputDirectory> </configuration> </execution> <execution> <configuration> <source>1.3</source> <target>1.6</target> <fork>true</fork> <outputDirectory>${project.build.outputDirectory}_jdk6</outputDirectory> </configuration> </execution> </executions> </plugin>
And then for the jar plugin
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.1</version> <executions> <execution> <goals> <goal>jar</goal> </goals> <configuration> <classesDirectory>${project.build.outputDirectory}_jdk5</classesDirectory> <classifier>jdk5</classifier> </configuration> </execution> <execution> <goals> <goal>jar</goal> </goals> <configuration> <classesDirectory>${project.build.outputDirectory}_jdk6</classesDirectory> <classifier>jdk6</classifier> </configuration> </execution> </executions> </plugin>
you can access the bank you want by adding the <classifier> element to your dependency. eg.
<dependency> <groupId>br.com.comp.proj</groupId> <artifactId>proj-cryptolib</artifactId> <version>0.0.4-SNAPSHOT</version> <classifier>jdk5</classifier> </dependency>
user2623688
source share