Skip to content

Commit 05b9024

Browse files
Include com.sun.tools as 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. Otherwise, without this change, the build fails when run under any Java version later than Java 8.
1 parent 3f48926 commit 05b9024

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

pom.xml

Lines changed: 17 additions & 9 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>
@@ -237,4 +228,21 @@
237228
<rpm.javadoc.dir>/usr/share/javadoc</rpm.javadoc.dir>
238229
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
239230
</properties>
231+
<profiles>
232+
<profile>
233+
<id>Java 8</id>
234+
<activation>
235+
<jdk>1.8</jdk>
236+
</activation>
237+
<dependencies>
238+
<dependency>
239+
<groupId>com.sun</groupId>
240+
<artifactId>tools</artifactId>
241+
<version>1.5.0</version>
242+
<scope>system</scope>
243+
<systemPath>${java.home}/../lib/tools.jar</systemPath>
244+
</dependency>
245+
</dependencies>
246+
</profile>
247+
</profiles>
240248
</project>

0 commit comments

Comments
 (0)