Play upgrade to 2.4 but failed to fetch sbt-plugin - playframework-2.3

[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.play#sbt-plugin;2.4.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.typesafe.play:sbt-plugin:2.4.0 (scalaVersion=2.10, sbtVersion=0.13)
This is my plugins.sbt:
resolvers ++= Seq(
"Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/",
"Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/",
"Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
)
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.0")

Play Framework 2.4 is not yet available, however you can use release candidate. For latest releases, check Play Framework github home page.
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.0-RC5")
Edit: Play Framework 2.4 is now available.

Related

Trying to understand why a dependency's JAR file is not added to classpath

I'm trying to set up a Scala project which builds on the libGDX game engine using sbt. After adding the necessary dependencies and trying to instantiate LwjglApplication, it fails to load the shared library libgdx64.dylib, which contains some native code for my platform (macOS 10.13.6).
These are the dependencies I've declared:
libraryDependencies += "com.badlogicgames.gdx" % "gdx" % "1.9.14"
libraryDependencies += "com.badlogicgames.gdx" % "gdx-backend-lwjgl" % "1.9.14"
libraryDependencies += "com.badlogicgames.gdx" % "gdx-platform" % "1.9.14" % "natives-desktop"
This is the exception I get:
sbt:test_libgdx> run
[info] Compiling 1 Scala source to /Users/michi/Documents/Projects/Slick2D/test_libgdx/target/scala-2.13/classes ...
[info] running Main
[error] (run-main-3) com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'libgdx64.dylib' for target: Mac OS X, 64-bit
[error] com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'libgdx64.dylib' for target: Mac OS X, 64-bit
[error] at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:120)
[...]
With my limited knowledge of sbt, ivy and Maven artifacts I've investigated a bit and noticed that the JAR file containing libgdx64.dylib (gdx-platform-1.9.14-natives-desktop.jar) is not added to the classpath of the running application. I've narrowed it down to a minimal project setup which shows this problem:
$ ls
build.sbt project target
$ cat build.sbt
libraryDependencies += "com.badlogicgames.gdx" % "gdx-platform" % "1.9.14" % "natives-desktop"
$ sbt
[info] welcome to sbt 1.4.9 (AdoptOpenJDK Java 1.8.0_282)
[info] loading global plugins from [...]/.sbt/1.0/plugins
[info] loading project definition from [...]/test/project
[info] loading settings for project test from build.sbt ...
[info] set current project to test (in build file:[...]/test/)
[info] sbt server started at local://[...]/.sbt/1.0/server/dd1267d773c22c32c889/sock
[info] started sbt server
sbt:test> show compile:dependencyClasspath
[info] * Attributed([...]/.sbt/boot/scala-2.12.12/lib/scala-library.jar)
[success] Total time: 0 s, completed Mar 31, 2021 10:47:54 AM
sbt:test>
If I look in the maven repository at https://repo.maven.apache.org/... manually, I can see that JAR file.
What do I need to do to get that JAR file on the classpath so that the shared library can be loaded from it? Where's my mistake?
I have encountered the same issue - for sbt to comprehend an artifact with multiple builds (in this case, native binaries), instead of % you have to use a classifier:
libraryDependencies += "com.badlogicgames.gdx" % "gdx-platform" % "1.11.0" classifier "natives-desktop"

I am trying to build code with an older version of chisel

I am trying to build code with an older version of chisel.
So far I have been able to pull the older version (2.3) of the source and make it into a .jar file that I placed in the source directory and the .ivy/cache directory, and edited the "build.sbt" file to add a line:
libraryDependencies += "edu.berkeley.cs" %% "chisel" % "2.3-SNAPSHOT"
But when I do sbt run I get:
[warn] module not found: edu.berkeley.cs#chisel_2.11;2.3-SNAPSHOT
[warn] ==== local: tried
[warn] /root/.ivy2/local/edu.berkeley.cs/chisel_2.11/2.3-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/edu/berkeley/cs/chisel_2.11/2.3-SNAPSHOT/chisel_2.11-2.3-SNAPSHOT.pom
[info] Resolving jline#jline;2.12.1 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: edu.berkeley.cs#chisel_2.11;2.3-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] edu.berkeley.cs:chisel_2.11:2.3-SNAPSHOT (Local build Path)
[warn] +- default:chisel_2.11:0.1-SNAPSHOT
Any help would be appreciated.
Thanks
You can't just copy the jar to the ivy cache directory, other meta information are required for ivy/sbt to use the jars in the cache. Copy the jar to 'lib' directory in your project folder. This is called "unmanaged dependencies" in sbt jargon. For more info see the documentation. Curiously, may I ask why are you trying to use an "older" version of Chisel in the first place?

Chisel tools installation; Unable to fint scct

I am trying to get started with Chisel. Following the instructions on Chisel web page, I installed scala 2.11 and sbt, copied the build.sbt and Hello World example. However, I am unable to run the example. I am getting following errors.
tariq#ubuntu:~/work/scala-test$ sbt run
[info] Set current project to scala-test (in build file:/home/tariq/work/scala-test/)
[info] Updating {file:/home/tariq/work/scala-test/}scala-test...
[info] Resolving com.github.scct#sbt-scct;0.2.1 ...
[warn] Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/com/github/scct/sbt-scct_2.11_0.13/0.2.1/sbt-scct-0.2.1.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] module not found: com.github.scct#sbt-scct;0.2.1
[warn] ==== local: tried
<snip>
info] Resolving jline#jline;2.12 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.github.scct#sbt-scct;0.2.1: not found
[warn] :: edu.berkeley.cs#chisel_2.11;latest.release: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.github.scct:sbt-scct:0.2.1 (sbtVersion=0.13, scalaVersion=2.11)
<snip>
at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: unresolved dependency: com.github.scct#sbt-scct;0.2.1: not found
[error] unresolved dependency: edu.berkeley.cs#chisel_2.11;latest.release: not found
[error] Total time: 23 s, completed Nov 19, 2014 4:26:38 PM
It appears sbt can't reach the internet (4th [info] line refers to this).
sbt needs to be able to reach the internet in order to download packages.
Are you behind a proxy? Are you running this in a VM?

unresolved dependencies with chisel setup

I tried to set up chisel in my machine. I'm following this link:
tutorial set up
but when I type
make Parity.out
I get:
[info] [SUCCESSFUL ] com.github.scct#scct_2.10;0.2!scct_2.10.jar (8159ms)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: edu.berkeley.cs#chisel_2.10;2.3-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
What's wrong?
Try out the latest version of the chisel-tutorial, hopefully this commit (https://github.com/ucb-bar/chisel-tutorial/commits/master) fixes your issue.
(The release version should be latest.release, and not 2.3-SNAPSHOT which I believe is not publicly visible).

Play Framework: how to resolve failure to download a JSON-LIB dependent library?

I am working with Play Framework 1.2.4, and using JSON-LIB to parse some JSON data from Java code.
Initially, I just put the 'json-lib-2.4-jdk15.jar' into the 'lib' folder, and the application worked fine. At some point, I got that this is not the right way to add libraries, and "play dependencies --sync" will even delete the JAR.
This is how my 'dependencies.yml' file looks now:
# Application dependencies
transitiveDependencies: false
require:
- play
- play -> crud
- play -> secure
- play -> cloudbees 0.2.2
- net.sf.flexjson -> flexjson 2.1
- net.sf.json-lib -> json-lib 2.4
Why I had a successful import of dependencies with 'flexjson', it fails with 'json-lib'.
Running "play dependencies -- verbose" gets to the following error:
:: problems summary ::
:::: WARNINGS
[NOT FOUND ] net.sf.json-lib#json-lib;2.4!json-lib.jar (347ms)
==== mavenCentral: tried
http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: FAILED DOWNLOADS ::
:: ^ see resolution messages for details ^ ::
::::::::::::::::::::::::::::::::::::::::::::::
:: net.sf.json-lib#json-lib;2.4!json-lib.jar
::::::::::::::::::::::::::::::::::::::::::::::
Isn't it here?
http://mvnrepository.com/artifact/net.sf.json-lib/json-lib/2.4
In addition, the process brings additional JARs to the 'lib' folder: xerces, xalan etc. - even after I asked to ignore transitive dependencies.
2 questions:
1. What did I do wrong?
2. Is there a good way to "force" Play to recognize certain JAR as a "local" library (so it won't be downloaded from external repository), and yet allow working with other modules and libraries via 'dependencies' mechanism