Dependencies with scope "system" (${java.home}/lib/tools.jar) doesn't use environment from toolchain ----------------------------------------------------------------------------------------------------
Key: MTOOLCHAINS-2 URL: http://jira.codehaus.org/browse/MTOOLCHAINS-2 Project: Maven 2.x 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 We need a system dependency (${java.home}/lib/tools.jar) with scope system. <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.4</version> <scope>system</scope> <systemPath>${java.home}/lib/tools.jar</systemPath> </dependency> 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 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: <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.4</version> <scope>system</scope> <systemPath>${toolchain.jdkhome}/lib/tools.jar</systemPath> </dependency> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira