1
votes

I am trying to run this sbt project (based on play framework 2.4) https://github.com/pac4j/play-pac4j-scala-demo

I am using the "activator run" command. My activator version is 1.3.6

I do see the project in the default maven repo that sbt uses. But, the log above seems to indicate that it was not found.

https://repo1.maven.org/maven2/com/nimbusds/nimbus-jose-jwt/

I tried clearing the ivy cache directories. But, that didn't seem to help.

Output

    /Users/arun/workspace/samples/play-pac4j-scala-demo>activator run
[info] Loading global plugins from /Users/arun/.sbt/0.13/plugins
[info] Updating {file:/Users/arun/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/arun/workspace/samples/play-pac4j-scala-demo/project
[info] Updating {file:/Users/arun/workspace/samples/play-pac4j-scala-demo/project/}play-pac4j-scala-demo-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to play-pac4j-scala-demo (in build file:/Users/arun/workspace/samples/play-pac4j-scala-demo/)
[info] Updating {file:/Users/arun/workspace/samples/play-pac4j-scala-demo/}root...
[info] Resolving com.nimbusds#nimbus-jose-jwt;[4.0,] ...
[warn]  module not found: com.nimbusds#nimbus-jose-jwt;[4.0,]
[warn] ==== local: tried
[warn]   /Users/arun/.ivy2/local/com.nimbusds/nimbus-jose-jwt/[4.0,]/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn]   /usr/local/Cellar/typesafe-activator/1.3.5/libexec/repository/com.nimbusds/nimbus-jose-jwt/[4.0,]/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn]   /Users/arun/Downloads/activator-dist-1.3.6/repository/com.nimbusds/nimbus-jose-jwt/[4.0,]/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/nimbusds/nimbus-jose-jwt/[4.0,]/nimbus-jose-jwt-[4.0,].pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/nimbusds/nimbus-jose-jwt/[4.0,]/nimbus-jose-jwt-[4.0,].pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/com.nimbusds/nimbus-jose-jwt/[4.0,]/ivys/ivy.xml
[warn] ==== Maven2 Local: tried
[warn]   file:/Users/arun/.m2/repository/com/nimbusds/nimbus-jose-jwt/[4.0,]/nimbus-jose-jwt-[4.0,].pom
[warn] ==== Atlassian Releases: tried
[warn]   https://maven.atlassian.com/public/com/nimbusds/nimbus-jose-jwt/[4.0,]/nimbus-jose-jwt-[4.0,].pom
[warn] ==== Sonatype snapshots repository: tried
[warn]   https://oss.sonatype.org/content/repositories/snapshots/com/nimbusds/nimbus-jose-jwt/[4.0,]/nimbus-jose-jwt-[4.0,].pom
[warn] ==== Pablo repo: tried
[warn]   https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nimbusds/nimbus-jose-jwt/[4.0,]/nimbus-jose-jwt-[4.0,].pom
[info] Resolving jline#jline;2.12.1 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.nimbusds#nimbus-jose-jwt;[4.0,]: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:

...

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: unresolved dependency: com.nimbusds#nimbus-jose-jwt;[4.0,]: not found
[error] Total time: 26 s, completed Sep 16, 2015 5:46:27 PM
1

1 Answers

2
votes

The problem is in [4.0,].

Ivy Version Matchers does not support [4.0,] which is reported in this issue.

In Maven Version Range, it is not described explicitly but seems to accept [4.0,].

I think it should be[4.0,) which means version >= 4.0, both accepted by ivy and maven.

Using sbt-dependency-graph plugin, you can see that the problem is in com.nimbusds:oauth2-oidc-sdk:5.0-alpha2.

[info]   +-org.pac4j:pac4j-oidc:1.8.0-SNAPSHOT
[info]   | +-com.nimbusds:oauth2-oidc-sdk:5.0-alpha2
...
[info]   | | +-com.nimbusds:nimbus-jose-jwt:[4.0,] (error: not found) (evicted by: 4.0) 

Looking into pom.xml of this project, you can find that

<dependency>
  <groupId>com.nimbusds</groupId>
  <artifactId>nimbus-jose-jwt</artifactId>
  <version>[4.0,]</version>
</dependency>

Maybe you can give them an issue to replace [4.0,] to [4.0,).

The workaround is editing ~/.ivy2/cache/com.nimbusds/oauth2-oidc-sdk/ivy-5.0-alpha2.xml after com.nimbusds:oauth2-oidc-sdk:5.0-alpha2 is cached by sbt.

Replace line

<dependency org="com.nimbusds" name="nimbus-jose-jwt" rev="[4.0,]" force="true" conf="compile->compile(*),master(compile);runtime->runtime(*)"/>
                                                      ~~~~~~~~~~~~

to rev="[4.0,)" and run sbt again.