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.

"configuration not public" on local test->test dependency if the same version has been resolved out of a public Maven repository

See original GitHub issue

Problem

I saw this problem on stackoverflow too, but it didn’t seem like it had been solved, and I couldn’t find an issue, so I’m posting it here.

I’m trying to do development on twitter/util, but when I try to run update on util-collection, it tells me:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.twitter#util-core_2.10;6.23.0: configuration not public in com.twitter#util-core_2.10;6.23.0: 'test'. It was required from com.twitter#util-collection_2.10;6.23.0 test
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      com.twitter:util-core_2.10:6.23.0
[warn]        +- com.twitter:util-collection_2.10:6.23.0
[trace] Stack trace suppressed: run last util-collection/*:update for the full output.
[error] (util-collection/*:update) sbt.ResolveException: unresolved dependency: com.twitter#util-core_2.10;6.23.0: configuration not public in com.twitter#util-core_2.10;6.23.0: 'test'. It was required from com.twitter#util-collection_2.10;6.23.0 test
[error] Total time: 1 s, completed Jan 27, 2015 1:49:54 AM

I tried making a demo project to repro, and I found that I could only repro when I chose the same version, organization, and artifact name.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:4
  • Comments:23 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
eed3si9ncommented, Sep 5, 2015

I’m running into this now as I’m trying to do "compile->compile;test->test" using a Maven style repository. It seems like when Maven’s "test" scope is translated into an Ivy configuration, Ivy makes it a private one.

https://github.com/sbt/ivy/blob/3cf31483b03e0ba294c76f5391dc7570b7649090/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java#L92-L96:

        new Configuration("test", Visibility.PRIVATE,
                "this scope indicates that the dependency is not required for normal use of "
                + "the application, and is only available for the test compilation and "
                + "execution phases.",
                new String[] {"runtime"}, true, null),

Modifying Ivy to make that public may have other consequences like update trying to resolve normally-unnecessary test dependencies. Not sure.

Here’s my current workaround:

    libraryDependencies ++= Seq(utilLogging, (utilLogging % Test).classifier("tests")),
3reactions
dragoscommented, Nov 19, 2015

This is pretty easy to run into when building Spark (fixed by rm -rf ~/.ivy2/cache):

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.apache.spark#spark-network-common_2.11;1.5.1: configuration not public in org.apache.spark#spark-network-common_2.11;1.5.1: 'test'. It was required from org.apache.spark#spark-network-shuffle_2.11;1.5.1 test
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      org.apache.spark:spark-network-common_2.11:1.5.1 ((com.typesafe.sbt.pom.MavenHelper) MavenHelper.scala#L76)
[warn]        +- org.apache.spark:spark-network-shuffle_2.11:1.5.1
[trace] Stack trace suppressed: run last network-shuffle/*:update for the full output.
[error] (network-shuffle/*:update) sbt.ResolveException: unresolved dependency: org.apache.spark#spark-network-common_2.11;1.5.1: configuration not public in org.apache.spark#spark-network-common_2.11;1.5.1: 'test'. It was required from org.apache.spark#spark-network-shuffle_2.11;1.5.1 test
Read more comments on GitHub >

github_iconTop Results From Across the Web

dependency resolution - Maven fails to find local artifact
The local Maven repo tracks where artifacts originally came from using a file named "_maven.repositories" in the artifact directory.
Read more >
Maven Error: Failed to collect dependencies - When trying to ...
I am facing an issue when trying to execute any Maven supported scenarios from ... the local repository, resolution will not be reattempted...
Read more >
Frequently Asked Technical Questions - Apache Maven
What is a Mojo? How to find dependencies on public Maven repositories? Why is my Javadoc JAR built twice during release?
Read more >
Maven packages in the Package Registry - GitLab Docs
If multiple packages have the same name and version, when you install a package, the most recently-published package is retrieved.
Read more >
Add build dependencies - Android Developers
Most app and test modules should use this configuration. api, Gradle adds the dependency to the compile classpath and build output. When a...
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