question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

a transitive non-optional dependency that is optional in its parent POM is missing

See original GitHub issue

This was originally reported as https://github.com/sbt/sbt/issues/4968 by @anilkumarmyla

steps

Setup

$ cat build.sbt 
libraryDependencies ++= Seq(
  "net.javacrumbs.json-unit" % "json-unit" % "2.8.0"
)
$ cat project/sbt-dependency-graph.sbt 
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")
$ cat project/build.properties 
sbt.version=1.3.0-RC4

sbt dependencyList test:dependencyList

problem

$ sbt dependencyList test:dependencyList
...
[info] default:optional_2.12:0.1.0-SNAPSHOT
[info] net.javacrumbs.json-unit:json-unit:2.8.0
[info] net.javacrumbs.json-unit:json-unit-core:2.8.0
[info] org.opentest4j:opentest4j:1.1.1
...
[info] default:optional_2.12:0.1.0-SNAPSHOT
[info] net.javacrumbs.json-unit:json-unit:2.8.0
[info] net.javacrumbs.json-unit:json-unit-core:2.8.0
[info] org.opentest4j:opentest4j:1.1.1

This is missing org.hamcrest:hamcrest-core:1.3.

expectations

It includes org.hamcrest:hamcrest-core:1.3 as it did in sbt 1.2.8.

notes

https://repo1.maven.org/maven2/net/javacrumbs/json-unit/json-unit-parent/2.8.0/json-unit-parent-2.8.0.pom

<dependency>
  <groupId>org.hamcrest</groupId>
  <artifactId>hamcrest-core</artifactId>
  <version>1.3</version>
  <optional>true</optional>
</dependency>

https://repo1.maven.org/maven2/net/javacrumbs/json-unit/json-unit-core/2.8.0/json-unit-core-2.8.0.pom

<dependency>
  <groupId>org.hamcrest</groupId>
  <artifactId>hamcrest-core</artifactId>
</dependency>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
anilkumarmylacommented, Sep 17, 2019

thanks @alexarchambault for looking into this. filed issue at https://github.com/lukas-krecan/JsonUnit/issues/193

0reactions
alexarchambaultcommented, Sep 17, 2019

Closing then, thanks @anilkumarmyla! (and @eed3si9n for reporting the issue and the initial investigation)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven – Optional Dependencies and ... - Apache Maven
When A declares B as an optional dependency in its POM, this relationship remains unchanged. It's just like a normal build where Project-B...
Read more >
Parent POM Missing on deployed Github package
1 Answer 1 ... If you use a jar as dependency, Maven needs to also resolve the POM and the parent POM (and...
Read more >
Optional Dependency in Maven | Baeldung
Learn now to use Maven's optional tag. ... doesn't use that feature subset, the project still transitively pulls in those dependencies.
Read more >
License Maven Plugin – license:add-third-party - MojoHaus
This file contains a list of the dependencies and their licenses. ... the license report; otherwise only non-optional dependencies will be ...
Read more >
How do I manage the version of a dependency in a parent ...
A "dependencyMangement" section of a parent POMW can be used to manage the version numbers of dependencies in child projects. If a dependency...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found