[ https://issues.apache.org/jira/browse/MTOOLCHAINS-2?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17000890#comment-17000890 ]
Sjoerd Talsma commented on MTOOLCHAINS-2: ----------------------------------------- [~michael-o] I understand the issue was auto closed, but I ended up here because I too need the location of JDK home / tools.jar and am using toolchains in my build. I am trying to create a multi-release jar for a Javadoc doclet. As you may know the Doclet spec changed from JDK 9 onwards. I have the JDK 9 build working, I also have code to compile a JDK 8 maven module with the old spec which requires tools.jar system dependency. However, I cannot figure out how to locate it with help from the toolchains. Is there a possibility to re-open this issue or point me to a workaround I could apply? > Dependencies with scope "system" (${java.home}/lib/tools.jar) doesn't use > environment from toolchain > ---------------------------------------------------------------------------------------------------- > > Key: MTOOLCHAINS-2 > URL: https://issues.apache.org/jira/browse/MTOOLCHAINS-2 > Project: Maven Toolchains Plugin > Issue Type: Bug > Affects Versions: 1.0 > Environment: Windows + Ubuntu Linux > Java 1.5.0_22 (Starting Maven 2.2.1), using Java 1.4.2_19 configured in > toolchain > Reporter: Denis Schettl > Priority: Major > > We need a system dependency ({{$\{java.home}/lib/tools.jar}}) with scope > system. > {code:xml}<dependency> > <groupId>com.sun</groupId> > <artifactId>tools</artifactId> > <version>1.4</version> > <scope>system</scope> > <systemPath>${java.home}/lib/tools.jar</systemPath> > </dependency>{code} > {noformat}D:\sandbox\QUERTOOLS-HEAD\apps\jdi-profiling>mvn clean package > -Penv.km [INFO] Scanning for projects... > [INFO] > ------------------------------------------------------------------------ > [INFO] Building jdi-profiling > [INFO] task-segment: [clean, package] > [INFO] > ------------------------------------------------------------------------ > [INFO] [clean:clean {execution: default-clean}] [INFO] [toolchains:toolchain > {execution: set_java-version_to_use}] [INFO] Type:jdk [INFO] Toolchain (jdk) > matched:JDK[C:\Programme\Java\j2sdk1.4.2_19] > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to resolve artifact. > Missing: > ---------- > 1) com.sun:tools:jar:1.4 > Try downloading the file manually from the project website. > Then, install it using the command: > mvn install:install-file -DgroupId=com.sun -DartifactId=tools > -Dversion=1.4 -Dpackaging=jar -Dfile=/path/to/file > Alternatively, if you host your own repository you can deploy the file > there: > mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools > -Dversion=1.4 -Dpackaging=jar -Dfile=/path/to/file -Du rl=[url] > -DrepositoryId=[id] > Path to dependency: > 1) de.ipcc.quer.tools:jdi-profiling:jar:1.0-SNAPSHOT > 2) com.sun:tools:jar:1.4 > ---------- > 1 required artifact is missing. > for artifact: > de.ipcc.quer.tools:jdi-profiling:jar:1.0-SNAPSHOT{noformat} > An solution can be that toolchain supply an property with the jdkhome > directory (e.g. toolchain.jdkhome), so that we can use this for definition of > tools.jar like: > {code:xml}<dependency> > <groupId>com.sun</groupId> > <artifactId>tools</artifactId> > <version>1.4</version> > <scope>system</scope> > <systemPath>${toolchain.jdkhome}/lib/tools.jar</systemPath> > </dependency>{code} -- This message was sent by Atlassian Jira (v8.3.4#803005)