Skip to content

[MTOOLCHAINS-2] Dependencies with scope "system" (${java.home}/lib/tools.jar) doesn't use environment from toolchain #65

Description

@jira-importer

Denis Schettl opened MTOOLCHAINS-2 and commented

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>

Affects: 1.0

1 votes, 1 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:majorMajor loss of function

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions