Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
导致编译失败的Grails插件可传递依赖项:spring安全核心(必需:1.2.7.3,找到:1.2.7.3)_Spring_Grails_Plugins_Spring Security - Fatal编程技术网

导致编译失败的Grails插件可传递依赖项:spring安全核心(必需:1.2.7.3,找到:1.2.7.3)

导致编译失败的Grails插件可传递依赖项:spring安全核心(必需:1.2.7.3,找到:1.2.7.3),spring,grails,plugins,spring-security,Spring,Grails,Plugins,Spring Security,我已经编写了一个插件,它围绕SpringSecurity核心插件提供了一些自定义设置/功能 在我的插件中,我在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/te

我已经编写了一个插件,它围绕SpringSecurity核心插件提供了一些自定义设置/功能

在我的插件中,我在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"
}
}

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

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"
}
}

当我添加这个插件依赖项时,它安装成功,我还看到一条消息,指示SpringSecurityCore插件已成功安装在控制台中。但是,当我尝试运行需要编译的and命令(如“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被找到。以前有没有人见过这种情况,或者可能会提出建议


谢谢

您的应用程序中是否也使用了
spring security core
?如果您这样做,那么
排除
pluginNo提供的依赖项,我们不会。我们希望SpringSecurity核心依赖项是我们自己插件的可传递依赖项。如果我添加了exclude,那么它将根本不会安装在应用程序中,并导致错误,例如:Dependencies:!spring security core(必需:1.2.7.3,找到:未安装)[无效]您可以从应用程序添加BuildConfig吗?另外,请在依赖关系报告中检查此依赖关系是否存在冲突。我已更新帖子,将插件的BuildConfig和已安装插件的应用程序的副本都包括在内。第二个BuildConfig中的grails安全性预认证依赖项拉入了我的自定义插件。你也尝试过清理和编译吗?我还将从本地repo中删除依赖项,并让它再次下载。