Add maven toolchains
This commit is contained in:
@ -15,7 +15,11 @@ Our latest source of PMD can be found on [GitHub]. Fork us!
|
||||
|
||||
### How to build PMD?
|
||||
|
||||
Simply use maven in the top-level directory:
|
||||
You'll need to have a `~/.m2/toolchains.xml` file setup with jdk 1.6 (for pmd 5.3.x), jdk 1.7 (for pmd 5.4.x and pmd 5.5.x)
|
||||
and jdk 1.8 (for some features in pmd 5.5.x). See [maven toolchains](https://maven.apache.org/guides/mini/guide-using-toolchains.html).
|
||||
A example file can be found here: [example-toolchains.xml](https://github.com/pmd/pmd/blob/master/example-toolchains.xml).
|
||||
|
||||
Use maven in the top-level directory:
|
||||
|
||||
mvn clean package
|
||||
|
||||
|
32
example-toolchains.xml
Normal file
32
example-toolchains.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF8"?>
|
||||
<toolchains>
|
||||
<!-- place this file in ${user.home}/.m2/toolchains.xml -->
|
||||
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>1.6</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>/path/to/jdk/1.6</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>1.7</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>/path/to/jdk/1.7</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>1.8</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>/path/to/jdk/1.8</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
</toolchains>
|
48
pom.xml
48
pom.xml
@ -387,6 +387,25 @@
|
||||
<runOrder>alphabetical</runOrder>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-toolchains-plugin</artifactId>
|
||||
<version>1.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>toolchain</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<toolchains>
|
||||
<jdk>
|
||||
<version>${java.version}</version>
|
||||
</jdk>
|
||||
</toolchains>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
@ -557,6 +576,10 @@
|
||||
<suppressionsFile>${checkstyle.suppressionsFile}</suppressionsFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-toolchains-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@ -897,6 +920,31 @@
|
||||
<module>pmd-scala</module>
|
||||
</modules>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>travis</id>
|
||||
<activation>
|
||||
<!-- https://github.com/travis-ci/travis-ci/issues/2727 -->
|
||||
<!-- http://docs.travis-ci.com/user/ci-environment/#Environment-variables -->
|
||||
<!-- from: https://github.com/marschall/jdeps-maven-plugin/blob/master/pom.xml -->
|
||||
<property>
|
||||
<name>env.TRAVIS</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-toolchains-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>none</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<modules>
|
||||
|
Reference in New Issue
Block a user