Skip to content

Commit 78573d1

Browse files
Include com.sun.tools dependency only if Java 8
This change causes com.sun.tools to be included as a dependency only if the JDK version is 1.8.
1 parent 3f48926 commit 78573d1

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

pom.xml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,6 @@
8787
<plugin>
8888
<artifactId>maven-antrun-plugin</artifactId>
8989
<version>1.7</version>
90-
<dependencies>
91-
<dependency>
92-
<groupId>com.sun</groupId>
93-
<artifactId>tools</artifactId>
94-
<version>1.5.0</version>
95-
<scope>system</scope>
96-
<systemPath>${java.home}/../lib/tools.jar</systemPath>
97-
</dependency>
98-
</dependencies>
9990
<executions>
10091
<execution>
10192
<id>intitialize-sources</id>
@@ -124,8 +115,12 @@
124115
<property name="translator.sources" value="${basedir}/translator-src"/>
125116
<property name="translator.classes" value="${project.build.directory}/translator-classes"/>
126117
<mkdir dir="${translator.classes}"/>
127-
<javac srcdir="${translator.sources}" includes="nu/validator/htmlparser/generator/ApplyHotSpotWorkaround.java" destdir="${translator.classes}" includeantruntime="false"/>
128-
<java classname="nu.validator.htmlparser.generator.ApplyHotSpotWorkaround">
118+
<javac srcdir="${translator.sources}" destdir="${translator.classes}"
119+
includes="nu/validator/htmlparser/generator/ApplyHotSpotWorkaround.java"
120+
includeantruntime="false"
121+
fork="${fork}"/>
122+
<java classname="nu.validator.htmlparser.generator.ApplyHotSpotWorkaround"
123+
fork="${fork}">
129124
<classpath>
130125
<pathelement location="${translator.classes}"/>
131126
</classpath>
@@ -236,5 +231,26 @@
236231
<rpm.java.dir>/usr/share/java</rpm.java.dir>
237232
<rpm.javadoc.dir>/usr/share/javadoc</rpm.javadoc.dir>
238233
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
234+
<fork>false</fork>
239235
</properties>
236+
<profiles>
237+
<profile>
238+
<id>Java 8</id>
239+
<activation>
240+
<jdk>1.8</jdk>
241+
</activation>
242+
<properties>
243+
<fork>true</fork>
244+
</properties>
245+
<dependencies>
246+
<dependency>
247+
<groupId>com.sun</groupId>
248+
<artifactId>tools</artifactId>
249+
<version>1.5.0</version>
250+
<scope>system</scope>
251+
<systemPath>${java.home}/../lib/tools.jar</systemPath>
252+
</dependency>
253+
</dependencies>
254+
</profile>
255+
</profiles>
240256
</project>

0 commit comments

Comments
 (0)