javaeclipsespringgrailsspringsource

Grails unresolved dependency error


I hope someone can help me. Im trying to install STS/grails on my Windows 7 Prof. machine, which has a 64 bit OS. I also have Ubuntu installed on the same machine (dual boot) and get the same error. When I run the IDE, with my application, i get an error. Can anyone tell me how to get this working? The error has something to do with unresolved dependencies.

My BuildConfig is as folllows:

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}-${grails.util.Environment.current.name}-${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()

        // uncomment these to enable remote dependency resolution from public Maven repositories
        mavenLocal()
        mavenCentral()
        //mavenRepo "http://uk.maven.org/maven2"
        //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 {      
        compile ('org.apache.tika:tika-core:1.0')
        compile ('org.apache.tika:tika-parsers:1.0') { excludes "xercesImpl", "xmlParserAPIs", "xml-apis", "log4j" }
        runtime ('mysql:mysql-connector-java:5.1.20') { excludes "commons-logging" }
        build ('org.apache.httpcomponents:httpcore:4.1.2')
        build ('org.apache.httpcomponents:httpclient:4.1.2')
        build ('org.apache.httpcomponents:httpmime:4.1.2')
        runtime ('org.apache.httpcomponents:httpcore:4.1.2')
        runtime ('org.apache.httpcomponents:httpclient:4.1.2')
        runtime ('org.apache.httpcomponents:httpmime:4.1.2')
    }

    plugins {
        runtime ":hibernate:$grailsVersion"
        runtime ":jquery:1.7.2"
        runtime ":resources:1.2-RC1"

        test ":spock:0.6"

        build ":tomcat:$grailsVersion"
    }
}

Below is the error:

Command terminated with an error code (see details for output)

System.out

| Loading Grails 2.0.4
| Configuring classpath
:: problems summary ::
:::: WARNINGS
module not found: org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0

==== grailsPlugins: tried

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

C:\Users\Delerium\Documents\workspace-sts-3.0.0.RELEASE\lmn-foresthills-feature-236/lib/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

==== grailsHome: tried

C:\grails\grails-2.0.4/lib/org.apache.tomcat/com.springsource.org.apache.tomcat.jdbc/ivy-1.0.9.0.xml

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

C:\grails\grails-2.0.4/lib/org.apache.tomcat/com.springsource.org.apache.tomcat.jdbc/jars/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

C:\grails\grails-2.0.4/lib/org.apache.tomcat/com.springsource.org.apache.tomcat.jdbc/bundles/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

==== grailsHome: tried

C:\grails\grails-2.0.4\src\libs/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.xml

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

C:\grails\grails-2.0.4\src\libs/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

==== grailsHome: tried

C:\grails\grails-2.0.4\dist/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.xml

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

C:\grails\grails-2.0.4\dist/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

==== grailsHome: tried

C:\Users\Delerium\.grails\2.0.4\cached-installed-plugins/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.xml

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

C:\Users\Delerium\.grails\2.0.4\cached-installed-plugins/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

==== grailsHome: tried

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

C:\grails\grails-2.0.4/plugins/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

==== grailsCentral: tried

http://plugins.grails.org/grails-com...bc-1.0.9.0.pom

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

http://plugins.grails.org/grails-com...bc-1.0.9.0.jar

==== http://repo.grails.org/grails/plugins: tried

http://repo.grails.org/grails/plugin...bc-1.0.9.0.pom

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

http://repo.grails.org/grails/plugin...bc-1.0.9.0.jar

==== http://repo.grails.org/grails/core: tried

http://repo.grails.org/grails/core/o...bc-1.0.9.0.pom

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

http://repo.grails.org/grails/core/o...bc-1.0.9.0.jar

==== grailsCore: tried

http://svn.codehaus.org/grails/trunk...bc-1.0.9.0.pom

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

http://svn.codehaus.org/grails/trunk...bc-1.0.9.0.jar

==== localMavenResolver: tried

C:\Users\Delerium/.m2/repository/org/apache/tomcat/com.springsource.org.apache.tomcat.jdbc/1.0.9.0/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.pom

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

C:\Users\Delerium/.m2/repository/org/apache/tomcat/com.springsource.org.apache.tomcat.jdbc/1.0.9.0/com.springsource.org.apache.tomcat.jdbc-1.0.9.0.jar

==== mavenCentral: tried

http://repo1.maven.org/maven2/org/ap...bc-1.0.9.0.pom

-- artifact org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0!com.springsource.org.apache.tomcat .jdbc.jar:

http://repo1.maven.org/maven2/org/ap...bc-1.0.9.0.jar

::::::::::::::::::::::::::::::::::::::::::::::

:: UNRESOLVED DEPENDENCIES ::

::::::::::::::::::::::::::::::::::::::::::::::

:: org.apache.tomcat#com.springsource.org.apache.tomc at.jdbc;1.0.9.0: not found

::::::::::::::::::::::::::::::::::::::::::::::
.... 

Solution

  • It's probably a dependency from a plugin. Post your application.properties.

    To solve it, add these lines to you BuildConfig.groovy inside repositories:

    grails.project.dependency.resolution = {
        repositories {
            mavenRepo "http://repository.springsource.com/maven/bundles/release"
            mavenRepo "http://repository.springsource.com/maven/bundles/external"
        }
    }