Unresolved Dependencies Grails 2.3 - maven

I am unable to run my Grails app because of a dependency problem. BuildConfig.groovy is set to use Maven Central which has the dependencies that Grails cannot find. Any idea why?
This is a project which I only just upgraded to Grails 2.3, if that matters.
Loading Grails 2.3.0
Dependency resolver grailsPlugins already defined. Ignoring...
Dependency resolver grailsHome already defined. Ignoring...
| Configuring classpath
:: problems summary ::
:::: WARNINGS
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: log4j#log4j;1.2.17: configuration not found in log4j#log4j;1.2.17: 'master'. It was required from org.grails.internal#manage;1301 runtime
:: org.jboss.netty#netty;3.2.5.Final: configuration not found in org.jboss.netty#netty;3.2.5.Final: 'compile'. It was required from com.mycompany.event#commons;35.9 compile
:: org.springframework#spring-test;3.2.4.RELEASE: configuration not found in org.springframework#spring-test;3.2.4.RELEASE: 'compile'. It was required from org.grails#grails-plugin-testing;2.3.0 compile
::::::::::::::::::::::::::::::::::::::::::::::
| Error Resolve error obtaining dependencies: Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- log4j:log4j:1.2.17
- org.jboss.netty:netty:3.2.5.Final
- org.springframework:spring-test:3.2.4.RELEASE
(Use --stacktrace to see the full trace)
:: problems summary ::
:::: WARNINGS
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: log4j#log4j;1.2.17: configuration not found in log4j#log4j;1.2.17: 'master'. It was required from org.grails.internal#manage;1301 runtime
:: org.jboss.netty#netty;3.2.5.Final: configuration not found in org.jboss.netty#netty;3.2.5.Final: 'compile'. It was required from com.mycompany.event#commons;35.9 compile
::::::::::::::::::::::::::::::::::::::::::::::
| Error Resolve error obtaining dependencies: Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- log4j:log4j:1.2.17
- org.jboss.netty:netty:3.2.5.Final
(Use --stacktrace to see the full trace)
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- log4j:log4j:1.2.17
- org.jboss.netty:netty:3.2.5.Final
| Run 'grails dependency-report' for further information.
How do I get Grails to find these dependencies?
Thanks!

Most probably you are facing this issue because of old version of spring-test transitive dependency by plugins or any other dependency.
You need to exclude spring-test as mentioned here in the upgrade guide
As suggested by the app, running a dependency-report will be the best bet to find out conflicts and missing dependencies.

Related

Maven osgi.bundle dependency missing

I am trying to build maven package and get a error:
Missing requirement: org.talend.designer.codegen 8.8.8.qualifier requires 'osgi.bundle; org.talend.repository 0.0.0' but it could not be found
But OK, org.talend.repository is another package in the parent directory.
But all my maven compilations was failed on "osgi.bundle" dependency.
Where can I get this dependency and how can I install it.

Unresolved Webjars dependency even though it seems to be in Maven Central

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"

SBT unresolved dependency: com.paypal.sdk#paypal-core;LATEST

I have a play framework 2.3.10 project and it can't find a paypal dependency. I suspect that it's due to the LATEST version tag (maybe it's a maven special version tag not supported by SBT?).
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.paypal.sdk#paypal-core;LATEST: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: com.paypal.sdk#paypal-core;LATEST: not found
We're not including this version directly, but it's a dependency of another dependency: com.paypal.sdk#merchantsdk;2.13.117.
Do you know how to solve this? Should we exclude the LATEST version and include a specific one (how?), or is there a way to include that LATEST dependency?
Thank you
I excluded core dependency from merchant and manually added core with the latest version.
"com.paypal.sdk" % "merchantsdk" % "2.14.117" exclude ("com.paypal.sdk","paypal-core"),
"com.paypal.sdk" % "paypal-core" % "1.7.0",

Errors in sbt Scala project

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

Escalante sbt plugin fails with missing org.apache.maven.wagon#wagon-provider-api;1.0!wagon-provider-api.jar

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

Resources