Grails自己的插件错误ActiveMQ

时间:2014-05-14 18:33:25

标签: grails plugins groovy

我正在创建自己的集成服务插件,但当我将其插入项目时,我有一个错误。为什么应用程序会抛出此异常?

  

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

[BuildConfig]

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

1 个答案:

答案 0 :(得分:1)

删除exported = false,它会起作用。说实话,我不明白为什么。添加exported = false后,依赖关系报告中缺少activemq-core。