Skip to content

Commit c9f26f7

Browse files
Fix JDK 17+ build failure by restricting tools.jar dependency
Modified maven/parparvm/pom.xml to move the system dependency on tools.jar into a Maven profile active only for JDKs < 9. This prevents the 'Could not find artifact com.sun:tools:jar:1.5.0' error on newer JDKs (like 17+) where tools.jar has been removed.
1 parent 7f9ebf1 commit c9f26f7

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

maven/parparvm/pom.xml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,6 @@
8585
<plugin>
8686
<groupId>org.apache.maven.plugins</groupId>
8787
<artifactId>maven-antrun-plugin</artifactId>
88-
<dependencies>
89-
<dependency>
90-
<groupId>com.sun</groupId>
91-
<artifactId>tools</artifactId>
92-
<version>1.5.0</version>
93-
<scope>system</scope>
94-
<systemPath>${java.home}/../lib/tools.jar</systemPath>
95-
</dependency>
96-
</dependencies>
9788
<executions>
9889
<execution>
9990
<id>compile-java-api</id>
@@ -159,6 +150,31 @@
159150
</plugin>
160151
</plugins>
161152
</build>
162-
153+
154+
<profiles>
155+
<profile>
156+
<id>legacy-jdk-tools</id>
157+
<activation>
158+
<jdk>(,9)</jdk>
159+
</activation>
160+
<build>
161+
<plugins>
162+
<plugin>
163+
<groupId>org.apache.maven.plugins</groupId>
164+
<artifactId>maven-antrun-plugin</artifactId>
165+
<dependencies>
166+
<dependency>
167+
<groupId>com.sun</groupId>
168+
<artifactId>tools</artifactId>
169+
<version>1.5.0</version>
170+
<scope>system</scope>
171+
<systemPath>${java.home}/../lib/tools.jar</systemPath>
172+
</dependency>
173+
</dependencies>
174+
</plugin>
175+
</plugins>
176+
</build>
177+
</profile>
178+
</profiles>
163179

164180
</project>

0 commit comments

Comments
 (0)