Skip to content

maven-bloop can't resolve the 2-depth dependency with "system scope" #27

@jsngbin

Description

@jsngbin

Hello.

I found that maven-bloop can't resolve the dependency with "system scope" in specific case.

First, I add dependency like below within my project's pom.xml and it works fine.

<dependency>
      <groupId>jdk.tools</groupId>
      <artifactId>jdk.tools</artifactId>
      <version>1.8</version>
      <scope>system</scope>
      <systemPath>${java.home}/../lib/tools.jar</systemPath>
    </dependency> 

But, when I add the "hadoop-annotations" as a dependency like below (without dependency jdk.tools 1.8 in pom.xml)

<dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-annotations</artifactId>
      <version>3.1.2</version>
 </dependency>

ch.epfl.scala:maven-bloop_2.13:1.4.11:bloopInstall got fail.
I think, maven-bloop doesn't search for a 2-depth dependency with 'system scope'.

  • It only search from remote repository not local file system(${java.home}/../lib/tools.jar (only when dependency of dependency)
2022.01.02 16:38:25 INFO  Downloading from central: https://repo.maven.apache.org/maven2/jdk/tools/jdk.tools/1.8/jdk.tools-1.8.jar
2022.01.02 16:38:27 INFO  [ERROR] FAILURE jdk.tools:jdk.tools:jar:1.8:system

...

2022.01.02 16:38:27 INFO  [ERROR] Failed to execute goal ch.epfl.scala:maven-bloop_2.13:1.4.11:bloopInstall (default-cli) on project json4s: Execution default-cli of goal ch.epfl.scala:maven-bloop_2.13:1.4.11:bloopInstall failed: Could not resolve jdk.tools:jdk.tools:jar:1.8:system -> [Help 1]

Doesn't it care of "scope" property of maven dependency?
https://github.com/scalacenter/bloop/blob/75fb344129bc92d3fff76f57429660e7014322c2/integrations/maven-bloop/src/main/scala/bloop/integrations/maven/MojoImplementation.scala#L83-L107


I have two solutions for not fixing it. but I don't like....

  • exclude the system scope dependency for each dependencies which has it.
  • add the dependency within my project.

Please check this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions