Grails插件传递依赖导致编译失败:spring-security-core(必需:1.2.7.3,找到:1.2.7.3)

时间:2014-05-29 12:02:51

标签: spring grails plugins spring-security

我编写了一个插件,它提供了一些围绕spring-security-core插件的自定义设置/功能。

在我的插件中,我依赖于BuildConfig.groovy文件中的spring-security-core。整个文件如下:

grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"

grails.project.fork = [
    test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
    run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
inherits("global") {
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
    grailsCentral()
    mavenLocal()
    mavenCentral()
}
dependencies {
}

plugins {

    compile ":spring-security-core:1.2.7.3"

    build(":release:3.0.1",
          ":rest-client-builder:1.0.3") {
        export = false
    }
}

}

然后我打包我的插件并将其安装到另一个应用程序中,如下所示:

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.work.dir = "target/work"
grails.project.target.level = 1.7
grails.project.source.level = 1.7
grails.project.war.file = "target/${appName}.war"

grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
inherits("global") {
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false

repositories {
    inherits true // Whether to inherit repository definitions from plugins

    grailsPlugins()
    grailsHome()
    mavenLocal()
    grailsCentral()
    mavenCentral()
    mavenRepo id: "uy_repo", url: "https://maven.york.ac.uk/nexus/content/repositories/infodir-thirdparty"
    mavenRepo id: "infodirreleases", url: "https://maven.york.ac.uk/nexus/content/repositories/releases"
    mavenRepo "http://download.java.net/maven/2/"
    mavenRepo "http://oss.sonatype.org/content/repositories/releases/"
}

dependencies {
    test "org.gebish:geb-spock:0.9.2"
    test "org.seleniumhq.selenium:selenium-firefox-driver:2.40.0", "org.seleniumhq.selenium:selenium-support:2.40.0"
    runtime 'com.oracle:ojdbc6:11.1.0'
}

plugins {
    compile ":jetty:2.0.3"
    compile ":scaffolding:2.0.2"
    compile ':cache:1.1.1'
    compile ":mongodb:1.3.1"
    compile ":mail:1.0.4"
    compile ":greenmail:1.3.4"
    compile ":elasticsearch:0.0.2.5"
    compile ":codenarc:0.21"

    compile "org.mycompany:grails-security-pre-authenticated:1.0.0"

    test ":geb:0.9.2"
    compile ":ckeditor:3.6.6.1.1"
    runtime ":hibernate:3.6.10.8" // or ":hibernate4:4.3.1.1"
    runtime ":database-migration:1.3.8"
    runtime ":jquery:1.11.0"
    runtime ":resources:1.2.1"
}

}

当我添加此插件依赖项时,它会成功安装,我还会看到消息,指示spring安全核心插件已成功安装在控制台中。但是,当我尝试运行和命令需要编译时,例如' grails war'我看到以下错误消息:

Error: The following plugins failed to load due to missing dependencies: [securityPreAuthenticated]
- Plugin: securityPreAuthenticated
   - Dependencies:
       - spring-security-core (Required: 1.2.7.3, Found: 1.2.7.3)

如您所见,错误是要求1.2.7.3并且找到1.2.7.3。有没有人见过这个,或者可能会建议?

由于

0 个答案:

没有答案