【问题标题】:Grails own plugin error ActiveMQGrails自己的插件错误ActiveMQ
【发布时间】:2014-05-14 18:33:24
【问题描述】:

我正在为集成服务创建自己的插件,但是当我将它插入项目时,我遇到了错误。为什么应用会抛出此异常?

Error 编译时出现致命错误 org.codehaus.groovy.control.MultipleCompilationErrorsException:

[构建配置]

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 = [
    // configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
    //  compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

    // configure settings for the test-app JVM, uses the daemon by default
    test: [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
    // configure settings for the run-app JVM
    run: [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    // configure settings for the run-war JVM
    war: [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    // configure settings for the Console UI JVM
    console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

grails.project.dependency.resolver = "maven" // or ivy
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 {
        //grailsHome()

        grailsCentral()
        mavenCentral()
        mavenLocal()

        // uncomment the below to enable remote dependency resolution
        // from public Maven repositories
        //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.27'
        compile('org.apache.activemq:activemq-core:5.7.0',
                'org.apache.activemq:activeio-core:3.1.4',
                'org.apache.xbean:xbean-spring:3.17') {
                excludes 'activemq-openwire-generator'
                excludes 'commons-logging'
                excludes 'xalan'
                excludes 'xml-apis'
                exported = false
       }
    }

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

    }
}

[插件描述符]

def doWithSpring = {
        jmsConnectionFactory(ActiveMQConnectionFactory) {
            brokerURL = "tcp://localhost:61616"
        }
    }

错误信息

ExpediaGrailsPlugin.groovy: 1: unable to resolve class org.apache.activemq.ActiveMQConnectionFactory
 @ line 1, column 1.
   import org.apache.activemq.ActiveMQConnectionFactory

【问题讨论】:

  • 我遇到了同样的问题,最后不得不在我的 BuildConfig.groovy 中添加这个:compile ('org.apache.activemq:activemq-all:5.5.1')。查看 jms 插件中的 dependencies.groovy,看起来它只包含了带有测试范围的 ActiveMQ 依赖项。所以,他们没有出现是有道理的。我不确定为什么它们不包含这些依赖项 - 一定有一些原因。

标签: grails plugins groovy


【解决方案1】:

删除exported = false,它将起作用。老实说,我不明白为什么。一旦添加了exported = false,依赖报告中就缺少activemq-core。

【讨论】:

  • 但exported = false 不在应用程序中添加依赖项,它已经安装了插件,但在(只是)插件中工作正常!当我在我的应用程序中安装它时,会抛出一个 expetion。但是,谢谢你的回复!
猜你喜欢
  • 2012-01-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-01-14
  • 1970-01-01
  • 2011-01-10
  • 2014-01-07
  • 1970-01-01
相关资源
最近更新 更多