I have a Play 2.1-SNAPSHOT based application that runs fine locally but when I try to deploy to Heroku I get the following error:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: play#sbt-plugin;2.1-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested
attributes.
My plugins.sbt file points to a local repository containing the 2.1-SNAPSHOT dependencies:
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
Resolver.file("My Repository", file( "repository/local") )
)
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-SNAPSHOT")
The directory "repository/local" is checked into my GIT repository. It does look like SBT on Heroku is looking in the local repository since before the "Unresolved Dependency" error I see the following warnings:
[warn] ==== Typesafe repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.1_0.11.2/2.1-SNAPSHOT/sbt-plugin-2.1-SNAPSHOT.pom
[warn] ==== My Repository: tried
[warn] ==== heroku-sbt-typesafe: tried
[warn] ==== heroku-central: tried
Running the command "play stage" locally finishes successfully.
An alternative is to add the Typesafe ivy-snapshots repository as a plugin resolver if you'd prefer to not use a local file repo.
In project/plugins.sbt:
resolvers += Resolver.url("Typesafe Ivy Snapshots", url("http://repo.typesafe.com/typesafe/ivy-snapshots/"))(Resolver.ivyStylePatterns)
Found the issue. I needed to declare "My Repository" as an Ivy repository by adding "Resolver.ivyStylePatterns" after the file resolver like this:
Resolver.file("My Repository", file( "repository/local/") )(Resolver.ivyStylePatterns)
The http://repo.typesafe.com/typesafe/ivy-snapshots/ seems no longer active, the following configuration works for me:
in your plugins.sbt:
//play sbt-plugin snapshot
resolvers += Resolver.url("Typesafe Simple Snapshots", url("https://repo.typesafe.com/typesafe/simple/snapshots/"))(Resolver.ivyStylePatterns)
//play snapshot
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
// The Play plugin
addSbtPlugin("com.typesafe.play" %% "sbt-plugin" % "2.4-SNAPSHOT")
in your build.sbt
//play snapshot
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
Related
I am trying to use React Bootstrap -library having this in my build.sbt
"org.webjars.npm" % "react-bootstrap" % "0.27.2"
This has worked before, but some version dependency must have recently changed, as trying to compile the project now gives following error.
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.webjars.npm#js-tokens;[3.0.0,4),[4.0.0,5): not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.webjars.npm:js-tokens:[3.0.0,4),[4.0.0,5)
[warn] +- org.webjars.npm:loose-envify:[1.0.0,2)
[warn] +- org.webjars.npm:warning:[2.0.0,3)
[warn] +- org.webjars.npm:react-prop-types:[0.3.0,0.4)
[warn] +- org.webjars.npm:react-bootstrap:0.27.2
Trying to add it in Webjars-page says that all versions (4.0.0, 3.0.2, 3.0.1, 3.0.0) have already been added to Maven Central.
Starting Deploy
Got package info for org.webjars.npm js-tokens 4.0.0
Determining dependency graph
No dependencies.
WebJar org.webjars.npm js-tokens 4.0.0 has already been deployed
So my questions are
What does the version syntax js-tokens;[3.0.0,4),[4.0.0,5) mean?
How can I add the required version so that the Scala Play project compiles again?
So searched a bit further (didn't search well enough, apparently).
Syntax js-tokens;[3.0.0,4),[4.0.0,5) means larger than or equal of 3.0.0 but below 4 or larger than or equal of 4.0.0 but below 5, two sets, I think. Someone else can clarify, but that's what I got from https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html :)
Maven Version Range Sets in Transitives Do Not Work. This can be handled currently with this
dependencyOverrides += "org.webjars.npm" % "js-tokens" % "3.0.2"
I am trying to deploy an activator app to Heroku. Without an Proc-file Heroku tells me that no cedar app is detected. When i add a Proc file and add
web: ./activator start -Dhttp.port=${PORT}
the startup fails.
How to get it running on Heroku?
UPDATE
The problem was a (not yet needed) package.json. Heroku obviously infered by that file that it is a node.js app. After renaming the app startet without a Proc file. But now i got unresolved dependencies for
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.play#play_2.11;2.3.2: not found
[warn] :: com.typesafe.play#play-jdbc_2.11;2.3.2: not found
[warn] :: com.atlassian.jwt#jwt-core;1.2.3: not found
[warn] :: com.atlassian.jwt#jwt-api;1.2.3: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
and solved that by adding
resolvers += "typesafe" at "http://repo.typesafe.com/typesafe/releases/"
Then I had the problem that we use SASS and it is not supported by Heroku. So I tried to deploy via the sbt plugin. That led to the following problem:
[error] (fashion-advice-common/compile:deployHeroku) You must stage your application before deploying it!
[error] (fashion-advice-customer/compile:deployHeroku) Could not find app ''. Check that herokuAppName setting is correct.
[error] (fashion-advice-stylist/compile:deployHeroku) Could not find app ''. Check that herokuAppName setting is correct.
Perhaps because we use 3 sub modules?
Your Procfile should look more like this:
web: target/universal/stage/bin/name_of_app_repo -Dhttp.port=${PORT}
Source
Created a sample Scala project structure (on my OS X Mavericks based computer) as follows:
Inside sample_project dir:
src
main
java
scala
Hello.scala
resources
test
java
scala
resources
build.sbt
Hello.scala:
object Hello {
def main(args: Array[String]) = println("Hello!")
}
build.sbt:
name := "hello"
version := "1.0"
scalaVersion := "2.11.1"
Placed the build.properties under sample_project/project:
sbt.version=0.13.5
When I try to run it using the "sbt" command inside the root folder:
/sample_project $ sbt
Getting org.scala-tools.sbt sbt_2.8.1 0.13.5 ...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-tools.sbt#sbt_2.8.1;0.13.5
==== local: tried
.ivy2/local/org.scala-tools.sbt/sbt_2.8.1/0.13.5/ivys/ivy.xml
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
.ivy2/local/org.scala-tools.sbt/sbt_2.8.1/0.13.5/jars/sbt_2.8.1.jar
==== Maven2 Local: tried
file://.m2/repository/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
file://.m2/repository/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
==== typesafe-ivy-releases: tried
http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt_2.8.1/0.13.5/ivys/ivy.xml
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt_2.8.1/0.13.5/jars/sbt_2.8.1.jar
==== Maven Central: tried
http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
==== Scala-Tools Maven2 Repository: tried
http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
==== Scala-Tools Maven2 Snapshots Repository: tried
http://scala-tools.org/repo-snapshots/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://scala-tools.org/repo-snapshots/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-tools.sbt#sbt_2.8.1;0.13.5: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-tools.sbt#sbt_2.8.1;0.13.5: not found
Error during sbt execution: Error retrieving required libraries
(see sample_project/project/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.5
This looks like an sbt version mismatch. Create a project directory under sample_project and inside it create a file called build.properties with the following contents:
sbt.version=0.13.5
It seems you have an old launcher version of sbt, perhaps even too old to cope with the new 0.13.5.
Try to update your launcher to the latest version. On MacOS, the easiest way is to use the Homebrew package manager. If not already done, install it with:
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
then, install sbt:
$ brew install sbt
i've got a build problem on CloudBees that i hope someone will be able to offer some suggestions on resolving.
i've got two projects:
"common" --> a Maven project composed of three modules (models, utilities, etc)
"service" --> a Play Framework application that depends on the aforementioned "common" project
i've configured the Jenkins job for building "common" so as to deploy to my private release repository, and i can see it does as much:
...
Deploying the main artifact models-0.0.1-SNAPSHOT.jar
Downloading: dav:https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/maven-metadata.xml
Uploading: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-20140329.091117-1.jar
Uploaded: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-20140329.091117-1.jar (12 KB at 246.0 KB/sec)
Uploading: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-20140329.091117-1.pom
Uploaded: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-20140329.091117-1.pom (428 B at 11.3 KB/sec)
Downloading: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/maven-metadata.xml
Uploading: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/maven-metadata.xml
Uploaded: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/maven-metadata.xml (772 B at 19.8 KB/sec)
Uploading: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/maven-metadata.xml
Uploaded: https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/maven-metadata.xml (282 B at 8.1 KB/sec)
...
i've configured my Play application's build.sbt file with details and credentials to read from this repository as such:
...
credentials += Credentials("CloudBees private Maven repos", "repository-myDomain.forge.cloudbees.com", "username", "password")
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
"CloudBees private snapshot repo" at "https://repository-myDomain.forge.cloudbees.com/snapshot/",
"CloudBees private release repo" at "https://repository-myDomain.forge.cloudbees.com/release/"
)
...
however, when i run the build job for my "service" project the dependencies cannot be found:
...
[warn] module not found: com.myDomain#models;0.0.1-SNAPSHOT
[warn] ==== local: tried
[warn] /home/jenkins/.ivy2/local/com.myDomain/models/0.0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-SNAPSHOT.pom
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-SNAPSHOT.pom
[warn] ==== Typesafe repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-SNAPSHOT.pom
[warn] ==== CloudBees private snapshot repo: tried
[warn] https://repository-myDomain.forge.cloudbees.com/snapshot/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-SNAPSHOT.pom
[warn] ==== CloudBees private release repo: tried
[warn] https://repository-myDomain.forge.cloudbees.com/release/com/myDomain/models/0.0.1-SNAPSHOT/models-0.0.1-SNAPSHOT.pom
...
i've mounted my CloudBees WebDAV snapshot and release repos, and i can see my "common" modules there... albeit suffixed with timestamp or build info.
can anyone spot something i've either overlooked? or perhaps my understanding of this setup is inaccurate? any help would be greatly appreciated!
The first part of the Credentials constructor should be the realm sent in the basic auth by the server. You can also provide the credentials as explained here.
In my case, the real was clipnow repository and I had to add the following lines to build.sbt (Play Framework 2.3)
credentials += Credentials("clipnow repository", "repository-clipnow.forge.cloudbees.com", "USERNAME", "PASSWORD")
resolvers += "clipnow repository" at "https://repository-clipnow.forge.cloudbees.com/snapshot/"
I'm trying to get escalante-sbt running but without luck so far. I tried SBT 0.13.1 with Scala 2.10.3. Had the same issue as in this question and nothing worked for me. In my last attempt I cloned an sbt-escalante example but not even this is working.
[info] Resolving org.scala-sbt#sbt-launch;0.13.1 ...
[warn] [NOT FOUND ] org.apache.maven.wagon#wagon-provider-api;1.0!wagon-provider-api.jar (1794ms)
[warn] ==== JBoss repository: tried
[warn] http://repository.jboss.org/nexus/content/groups/public/org/apache/maven/wagon/wagon-provider-api/1.0/wagon-provider-api-1.0.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.apache.maven.wagon#wagon-provider-api;1.0!wagon-provider-api.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: download failed: org.apache.maven.wagon#wagon-provider-api;1.0!wagon-provider-api.jar
I would really like to get sbt-escalante working but I'm out of ideas. What is left to try?
I've never worked with the Escalante SBT plugin so please excuse mistakes. The following seemed to work for me.
project/build.properties
sbt.version=0.13.2-M3
project/sbt-escalante.sbt (I thought I'd change the official *.scala approach to *.sbt)
resolvers ++= Seq(
"JBoss repository" at "http://repository.jboss.org/nexus/content/groups/public/",
"Project Odd repository" at "http://repository-projectodd.forge.cloudbees.com/upstream/"
)
lazy val plugins = project in file(".") dependsOn(sbtEscalante)
lazy val sbtEscalante = uri("git://github.com/escalante/sbt-escalante.git#0.2.0")
build.sbt
import io.escalante.sbt.EscalantePlugin._
escalanteSettings
With the files in place, I could run escalante-version and hence assumed it worked fine.
[sbt-escalante]> escalante-version
[info] 0.3.0