I am in the process of upgrading an old grails app from 2.1.0 to 2.4 and Java 1.6 to 1.8. I'm trying to build the project, but I can't resolve this one dependency for some reason:
Error |
Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information): org.springframework:spring-test:4.0.5.RELEASE
My BuildConfig.groovy is below. How can I fix this?
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.8
grails.project.source.level = 1.8
grails.project.war.file = "target/clinicaloutcome.war"
//grails.dependency.cache.dir = "target/ivy-cache"
//grails.dependency.cache.dir = "${user.home}/.ivy2/cache"
grails.tomcat.jvmArgs=["-Xms2048m", "-Xmx2048m", "-XX:PermSize=2048m", "-XX:MaxPermSize=2048m"]
grails.project.dependency.resolution = {
// pom true
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsCentral()
mavenCentral()
//mavenRepo "https://oss.sonatype.org/content/groups/public/"
// uncomment these to enable remote dependency resolution from public Maven repositories
mavenLocal()
mavenRepo "https://oss.sonatype.org/content/repositories/releases/"
mavenRepo "https://repo.grails.org/grails/plugins"
mavenRepo "https://repo.grails.org/grails/core"
mavenRepo "https://mvnrepository.com/artifact/"
mavenRepo "https://mvnrepository.com/artifact/org.springframework/spring-test/"
mavenRepo "http://repository.springsource.com/maven/bundles/release"
mavenRepo "http://repository.springsource.com/maven/bundles/external"
mavenRepo "http://snapshots.repository.codehaus.org"
mavenRepo "http://repository.codehaus.org"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repository.jboss.com/maven2/"
// // Hardcoded path to the jar fields
// flatDir name:'myRepo', dirs:'lib'
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
runtime 'mysql:mysql-connector-java:5.1.20'
}
plugins {
build ":release:2.2.1"
// runtime ":hibernate:$grailsVersion"
runtime ":hibernate4:4.3.5.3"
runtime ":jquery:1.7.2"
runtime ":resources:1.1.6"
runtime ":cached-resources:1.0"
compile "org.grails.plugins:google-visualization:1.0.2"
compile ":less-resources:1.3.3.2"
compile ':app-info:1.0.1'
compile ":svn:1.0.2"
compile ":famfamfam:1.0.1"
compile ":mail:1.0"
compile ":spring-security-ui:0.2"
compile ":spring-security-core:2.0-RC4"
compile ":lang-selector:0.3"
compile ":google-analytics:2.0"
compile ":cache-headers:1.1.5"
compile ":dynamic-controller:0.4"
compile ":jquery-ui:1.8.15"
compile ":events-push:1.0.M3"
compile ":platform-core:1.0.M6"
// Uncomment these (or add new ones) to enable additional resources capabilities
runtime ":zipped-resources:1.0"
runtime ":cached-resources:1.0"
//runtime ":yui-minify-resources:0.1.4"
build ":tomcat:7.0.53"
}
}
Add this dependency in your build.gradle
runtime "org.springframework:spring-test:4.0.5.RELEASE"
Related
I started a brand new grails 2.2 app. I want to add qrcode plugin.
https://plugins.grails.org/plugin/technipelago/qrcode
the documentation says for grails 2 app use
grails.project.dependency.resolution = {
// ...
plugins {
compile ':qrcode:0.7'
// ...
}
}
here is my buildconfig after adding qrcode plugin
grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
// uncomment (and adjust settings) to fork the JVM to isolate classpaths
//grails.project.fork = [
// run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256]
//]
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsCentral()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// runtime 'mysql:mysql-connector-java:5.1.20'
}
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.3"
runtime ":resources:1.1.6"
build ":tomcat:$grailsVersion"
runtime ":database-migration:1.2.1"
compile ':cache:1.0.1'
compile ':qrcode:0.7'
}
}
when i build
it says
|Loading Grails 2.2.0
|Configuring classpath
Error |
Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:qrcode:0.7
I appreciate any help as to integrating qrcode plugin. I dont need latest version. I just need to make qrcode plugin to work. Old version will do.
Thanks for the help!
First add local maven repo (mavenLocal()) to your in BuildConfig.groovy:
repositories {
inherits true
grailsPlugins()
mavenLocal()
mavenCentral()
}
Then add dependency in BuildConfig.groovy:
dependencies {
compile "org.grails.plugins:qrcode:0.7"
}
If by adding in dependency not work then add it to plugins:
plugins {
compile(':qrcode:0.7')
}
You can refer repo of this plugin where you can see available versions.
Hope this helps you.
Try version 0.7.1
I looks
It is also for Grails 2.x and should load just fine by putting it in the plugins {} section like you did.
I'm trying to use the Jasper Plugin with the version 1.11.0 with the following Build.config:
grails.servlet.version = "3.0"
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
inherits("global") { }
log "error"
checksums true
legacyResolve false
repositories {
inherits true
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
mavenRepo "http://jasperreports.sourceforge.net/maven2/"
mavenRepo "http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repository.jboss.com/maven2/"
mavenRepo "http://repo.spring.io/milestone/"
}
dependencies {
runtime 'mysql:mysql-connector-java:5.1.29'
test "org.grails:grails-datastore-test-support:1.0-grails-2.4"
build "net.sf.jasperreports:jasperreports-fonts:4.0.0"
build "net.sf.jasperreports:jasperreports:4.0.1"
build "joda-time:joda-time:2.8.2"
compile "com.lowagie:itext:2.1.7"
build('org.grails:grails-docs:2.4.3') {
excludes 'itext'
}
}
plugins {
build ":tomcat:7.0.55"
compile ":scaffolding:2.1.2"
compile ':cache:1.1.7'
compile ":asset-pipeline:1.9.6"
compile ":portal-core:1.7"
compile ":platform-core:1.0.0"
compile ":spring-security-core:2.0-RC5"
compile ":spring-security-cas:2.0-RC1"
runtime ":hibernate4:4.3.5.5"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
compile ":remote-pagination:0.4.8"
compile ":cxf-client:2.1.1"
compile ":cxf:2.1.1"
compile ":jasper:1.11.0"
}
}
When I let grails getting the artifacts I'm getting an Forbidden (403) Error:
Could not transfer artifact org.olap4j:olap4j:jar:0.9.7.309-JS-3 from/to jaspersoft_artifactoryonline_com_jaspersoft_third-party-ce-artifacts_ (http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/): Forbidden (403)
|Run 'grails dependency-report' for further information.
How do I resolve this Problem?
try this one as answered on today:
mavenRepo("https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/")
I am using Grails 2.0.0 and I tried to download webflow 2.0.0 but I am getting only webflow 2.0.0-RELEASE as a zip folder or as a jar file.Are both webflow 2.0.0 and webflow 2.0.0-RELEASE the same?
I even got grails-webflow-2.0.3 jar file also. I also tried with webflow 1.3.8 which I got from grails official website. I tried changing the name of the plugin in the compile statement in Build.Config each time and ran and am ending up with this kind error each time :
Error WARNING: Specified dependency definition compile(:org.springframework.webflow-2.0.0.RELEASE) is invalid! Skipping..
what shall i do?
Given below is my BuildConfig.groovy file :
grails.servlet.version = "2.5" // Change depending on target container
compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info',
'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
repositories {
inherits true // Whether to inherit repository definitions from
plugins
grailsPlugins()
grailsHome()
grailsCentral()
mavenCentral()
// uncomment these to enable remote dependency resolution
from public Maven repositories
mavenCentral()
mavenRepo
"http://repository.springsource.com/maven/bundles/release"
mavenRepo
"http://repository.springsource.com/maven/bundles/external"
mavenRepo
"http://repository.springsource.com/maven/libraries/release"
mavenRepo
"http://repository.springsource.com/maven/libraries/external"
mavenLocal()
mavenRepo "http://snapshots.repository.codehaus.org"
mavenRepo "http://repository.codehaus.org"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile',
'runtime', 'test' or 'provided' scopes eg.
// runtime 'mysql:mysql-connector-java:5.1.16'
}
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.5"
compile ":webflow:2.0.0"
// compile ":spring-security-core:1.2.7.3"
build ":tomcat:$grailsVersion"
}
}
The right way to add webflow is to put the dependecy in BuildConfig.groovy
...
plugins {
...
compile ":webflow:2.0.0"
...
}
...
Don't download or add it manually
Or try replace your repositories with this
repositories {
inherits true
grailsPlugins()
grailsHome()
grailsCentral()
mavenLocal()
mavenCentral()
mavenRepo name: "Grails Snapshots", root:"http://snapshots.repository.codehaus.org/"
mavenRepo name: "Spring Milestone", root:"http://maven.springframework.org/milestone/"
mavenRepo name: "Spring Milestone", root:"http://maven.springframework.org/milestone/"
ebr()
mavenRepo "http://repository.codehaus.org"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repository.jboss.com/maven2/"
mavenRepo "http://repository.springsource.com/maven/bundles/release"
mavenRepo "http://repository.springsource.com/maven/bundles/external"
mavenRepo "http://repository.springsource.com/maven/libraries/release"
mavenRepo "http://repository.springsource.com/maven/libraries/external"
}
I'm suffering from grails dependencies with only pom.xml in the jar files at the moment. Basically, I'm trying to use grails dependencies to include neo4j which the main file only contain pom.xml http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22neo4j%22.
This is my BuildConfig.groovy
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.war.file = "target/ROOT.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
mavenLocal()
// mavenCentral()
// mavenRepo "http://m2.neo4j.org/snapshots/"
// flatDir name:'neo4j', dirs:'/lib/neo4j'
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
/*
* Configure our resolver.
*/
// def libResolver = new org.apache.ivy.plugins.resolver.URLResolver()
// ['libraries', 'builds'].each {
// libResolver.addArtifactPattern(
// "/Users/ncharass/.ivy/cache/[artifact]-[revision].[ext]")
//
// }
// libResolver.name = "my-repository"
// libResolver.settings = ivySettings
// resolver libResolver
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
compile 'org.neo4j:neo4j:1.4.1'
// runtime 'mysql:mysql-connector-java:5.1.13'
}
}
It seems to download all the jar files successfully, but those jars only contain pom.xml which it seems that Gradle or Ivy doesn't pick up any pom.xml for any references, so I got complication errors.
I tried almost everything but it doesn't seem to work. Also, the lib that I download from neo4j website also only contains pom.xml.
Please help! :(
Someone already proposed the following on the neo4j mailing list:
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
mavenLocal()
mavenCentral()
flatDir name:'neo4j', dirs:'/${PATH}/lib/neo4j'
}
dependencies {
compile 'org.neo4j:neo4j-kernel:1.4.1'
compile 'org.neo4j:neo4j-cypher:1.4.1'
compile 'org.neo4j:neo4j-graph-algo:1.4.1'
compile 'org.neo4j:neo4j-graph-matching:1.4.1'
compile 'org.neo4j:neo4j-jmx:1.4.1'
compile 'org.neo4j:neo4j-lucene-index:1.4.1'
compile 'org.neo4j:neo4j-shell:1.4.1'
compile 'org.neo4j:neo4j-udc:1.4.1'
compile 'org.neo4j:lucene-core:3.1.0'
compile 'org.neo4j:scala-library:2.9.0-1'
compile 'org.neo4j:server-api:1.4.1'
}
or just use
compile 'org.neo4j:neo4j-community:1.4.1'
in the dependencies section.
I am using grails 1.3.7 and I'm trying to install acegi plugin with below command getting above error
install-plugin acegi 0.5.2
BuildConfig.groovy:
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
mavenLocal()
mavenCentral()
mavenRepo "http://snapshots.repository.codehaus.org"
mavenRepo "http://repository.codehaus.org"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
// runtime 'mysql:mysql-connector-java:5.1.13'
}
}
In my BuildConfig.groovy I have un commented to maven repo's to resolve plugins but still its doesn't make any difference.
Is there any way to make install acegi plugin with above command.
You might try adding these two to repositories
repositories {
....
mavenRepo "http://repo.grails.org/grails/core"
mavenRepo "http://repo.grails.org/grails/plugins"
}