sbt librarymanagement ResolveException Error downloading com.atlassian.jwt:jwt-core - sbt

Get dependency error (play application with silhouette) after switching to a new development system.
sbt.version=1.3.3
in build.sbt:
resolvers += Resolver.jcenterRepo
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
[error] Error downloading com.atlassian.jwt:jwt-api:2.0.5
[error] Not found
[error] Not found
[error] not found: /Users/robert/.ivy2/local/com.atlassian.jwt/jwt-api/2.0.5/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/atlassian/jwt/jwt-api/2.0.5/jwt-api-2.0.5.pom

The artifact com.atlassian.jwt:jwt-api:2.0.5 seems to be available only from Atlassian's repositories (see https://mvnrepository.com/artifact/com.atlassian.jwt/jwt-api/2.0.5).
Add the following resolver:
resolvers += "Atlassian's Maven Public Repository" at "https://packages.atlassian.com/maven-public/"

Related

Why does the sbt tutorial fail on adding the plugin?

I'm working thru the sbt introductory tutorial at https://www.scala-sbt.org/1.x/docs/sbt-by-example.html and when I reload after the step "Add sbt-native-packager plugin" which adds a plugin, it fails, with many warnings and errors, to a prompt of "Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?" At that point sbt has basically died. I will append a full capture of the errors.
I believe I followed all instructions. What is going wrong?
I have tried:
Restarting sbt
Undoing the latest code the tutorial asked for (plugins.sbt and changes in build.sbt) and restarting sbt. Then sbt is live again, but of course as soon as I add the code back it dies again.
Adding resolvers for other repos that I know of,
The built-in resolvers mentioned in https://www.scala-sbt.org/1.x/docs/Resolvers.html
resolvers += "apache-repo" at "https://repo.maven.apache.org/maven2/com/typesafe/"
resolvers += "lightbend" at "https://repo.lightbend.com/typesafe/releases/"
resolvers += "lightbend" at "https://repo.lightbend.com/typesafe/ivy-releases/"
Totally replacing the "resolvers" variable in case an early one was poisoning the process.
Changing the requested version from "1.3.4" to other versions of sbt-native-
packager that I know exist. Basically the same story with different version numbers.
As I am new to Scala and sbt, I may be missing something elementary, but I'm just not seeing it.
Here is the complete error log:
[info] Loading settings for project foo-build-build from plugins.sbt ...
[info] Loading project definition from /home/tehom/projects/ic-fab/foo-build/project
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.typesafe.sbt:sbt-native-packager:1.3.4 (sbtVersion=1.0, scalaVersion=2.12)
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.sbt:sbt-native-packager;sbtVersion=1.0;scalaVersion=2.12:1.3.4
[error] Not found
[error] Not found
[error] not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.3.4/sbt-native-packager-1.3.4.pom
[error] not found: /home/tehom/.ivy2/local/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml
[error] download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml
[error] download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:246)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$34(CoursierDependencyResolution.scala:215)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:215)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:52)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:102)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:69)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:115)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:115)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:96)
[error] at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:150)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:129)
[error] at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:2947)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] at java.base/java.lang.Thread.run(Thread.java:834)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.sbt:sbt-native-packager;sbtVersion=1.0;scalaVersion=2.12:1.3.4
[error] Not found
[error] Not found
[error] not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.3.4/sbt-native-packager-1.3.4.pom
[error] not found: /home/tehom/.ivy2/local/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml
[error] download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml
[error] download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.3.4/ivys/ivy.xml
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
I found out what was going wrong - approximately, anyways. Sbt and Java underneath it seemed to have had outdated security certificates. Odd, as I just installed it this week.
The command:
sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure
updated the relevant certificates and then it worked.

sbt doc error with Antler generated source code

I have ANTLR to generate parser/lexer code in "./gen" directory.
With sbt, everything works fine; no issue with compile and test.
However, when I executed doc to invoke scaladoc, I have error messages saying that it cannot find the object that ANTLR generated.
> doc
[info] Main Scala API documentation to /Users/smcho/github/ChitchatCompilerScala/doc/api...
[error] /Users/smcho/github/ChitchatCompilerScala/src/main/scala/node/NodeGenerator.scala:6: not found: object parser
[error] import parser.{ChitchatLexer, ChitchatParser}
[error] ^
What might be wrong?
I had to teach sbt about the new source directory.
unmanagedSourceDirectories in Compile += baseDirectory.value / "extra-src"
Hint from http://www.scala-sbt.org/0.13/docs/Howto-Customizing-Paths.html

sbt inconsistent module descriptor file found

I have some errors in sbt:
[error] (system/*:update) sbt.ResolveException: unresolved dependency: org.apache.ant#ant-compress;1.4: java.text.ParseException: inconsistent module descriptor file found in 'http://central.maven.org/maven2/org/apache/ant/ant-compress/1.4/ant-compress-1.4.pom': bad module name: expected='ant-compress' found='compress-antlib';
the artifact id of ant-compress not same as the module name
how can i figure out this?
does sbt has some configuration to suppress the consistency check?
I have using the method refer to unresolved dependency org.mongodb#bson#2.5, bad organisation in sbt
"com.example.utils" % "example-lang" % "0.0.3-SNAPSHOT" exclude("org.apache.ant", "ant-compress"),
"org.apache.ant" % "ant-compress" % "1.4" from "http://central.maven.org/maven2/org/apache/ant/ant-compress/1.4/ant-compress-1.4.jar",
but some other errors occured:
[error] (system/*:update) sbt.ResolveException: unresolved dependency: org.apache.ant#ant-compress;1.4: configuration not found in org.apache.ant#ant-compress;1.4: 'master(compile)'. Missing configuration: 'comp
ile'. It was required from com.example.utils#example-lang;0.0.2-SNAPSHOT runtime

Spark: A signature in package.class refers to type compileTimeOnly

When trying to build MLlib example with Spark 1.2.1 using SBT I get the whole bunch of strange compilation errors. The same code builds fine with Spark 1.1.0. For Spark 1.2.1 I use the following SBT build file:
name := "Test"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "1.2.1" % "provided"
As a result I get the following set of strange errors:
[info] Compiling 1 Scala source to /home/test/target/scala-2.10/classes...
[error] bad symbolic reference. A signature in package.class refers to type compileTimeOnly
[error] in package scala.annotation which is not available.
[error] It may be completely missing from the current classpath, or the version on
[error] the classpath might be incompatible with the version used when compiling package.class.
[error] /home/test/src/main/scala/Test.scala:16: Reference to method augmentString in object Predef should not have survived past type checking,
[error] it should have been processed and eliminated during expansion of an enclosing macro.
[error] val parsedData = data.map(s => Vectors.dense(s.split(' ').map(_.toDouble))).cache()
[error] /home/test/src/main/scala/Test.scala:16: Reference to method augmentString in object Predef should not have survived past type checking,
[error] it should have been processed and eliminated during expansion of an enclosing macro.
[error] val parsedData = data.map(s => Vectors.dense(s.split(' ').map(_.toDouble))).cache()
[error] ^
[error] three errors found
[error] (compile:compile) Compilation failed
[error] Total time: 21 s, completed 26.02.2015 17:47:29
How to fix this? It would be great if somebody could post a general SBT to build Spark 1.2.1 + MLlib code. Thanks!
Try changing the libraryDependencies line to the following:
libraryDependencies += "org.apache.spark" %% "spark-mllib" % "1.2.1" % "provided"
You are using Scala 2.10.4 and you are trying to install the Spark library for Scala 2.11.x - the %% will automatically select the correct Scala library version for you.
I am using IntelliJ to compile spark 1.6.0 code. And faced the same errors. [ERROR] error: bad symbolic reference. A signature in package.class refers to type compileTimeOnly.
I solve this problem by adding Scala language related dependencies to the project. Maybe maven can't use the Scala config from Intellij. So we should explicitly specify the Scala dependencies.
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>2.10.6</version>
</dependency>

Different errors during 'sbt' and 'sbt run' in scalafx-ensemble

I downloaded the scalafx-ensemble project. When I run sbt in the project's folder I'm facing the following error:
[info] Set current project to scalafxEnsemble (in build file:/C:/dev/sample/scalafx-ensemble-master/)
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
at jline.TerminalFactory.create(TerminalFactory.java:101)
at jline.TerminalFactory.get(TerminalFactory.java:159)
at sbt.JLine$.sbt$JLine$$terminal(LineReader.scala:87)
at sbt.JLine$.withTerminal(LineReader.scala:91)
at sbt.JLine$.usingTerminal(LineReader.scala:97)
at sbt.JLine$.createReader(LineReader.scala:103)
at sbt.FullReader.<init>(LineReader.scala:135)
at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:149)
...
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
at sbt.JLine$$anonfun$usingTerminal$1.apply(LineReader.scala:98)
at sbt.JLine$$anonfun$usingTerminal$1.apply(LineReader.scala:97)
at sbt.JLine$.withTerminal(LineReader.scala:92)
at sbt.JLine$.usingTerminal(LineReader.scala:97)
at sbt.JLine$.createReader(LineReader.scala:103)
at sbt.FullReader.<init>(LineReader.scala:135)
at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:149)
at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:146)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:31)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:31)
at sbt.Command$.process(Command.scala:95)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:100)
...
[error] java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
[error] Use 'last' for the full log.
If I run sbt run I'm getting the following:
at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3193)
at scala.tools.nsc.typechecker.Typers$Typer.handleOverloaded$1(Typers.scala:3190)
at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3193)
at scala.tools.nsc.typechecker.Typers$Typer.handleOverloaded$1(Typers.scala:3190)
[error] (compile:compile) java.lang.StackOverflowError
[error] Total time: 9 s, completed Jan 6, 2014 4:47:49 PM
What am I doing wrong?
This is likely problem with outdated SBT launcher. Make sure that your SBT is v.0.13 or newer.
I fixed the path to jfxrt.jar in build.sbt from
System.getenv("JAVA_HOME") + "jre/lib/jfxrt.jar"
to
System.getenv("JAVA_HOME") + "/lib/jfxrt.jar"
which is correct for my system. With the change, sbt run works fine.

Resources