Grails 1.3.7和springcache插件1.2.1的编译错误

时间:2011-09-12 07:42:39

标签: grails compiler-errors grails-plugin

我正在尝试使用Grails 1.3.7编译Grails项目。该项目依赖于springcache 1.2.1插件。但是,我收到以下编译错误(29次):

/Users/myself/.grails/1.3.7/projects/myproject/plugins/springcache-1.2.1/src/groovy/grails/plugin/springcache/web/Timer.groovy: 29: cannot modify final field 'uri' outside of constructor.
 @ line 29, column 4.
            this.uri = uri
      ^

1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:969)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:519)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:497)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:474)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:453)
    at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:67)
    at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:180)
    at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:905)
    at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:607)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at _GrailsCompile_groovy$_run_closure4_closure10.doCall(_GrailsCompile_groovy:117)
    at _GrailsCompile_groovy$_run_closure4_closure10.doCall(_GrailsCompile_groovy)
    at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
    at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
    at _GrailsCompile_groovy$_run_closure4.doCall(_GrailsCompile_groovy:104)
    at _GrailsCompile_groovy$_run_closure3.doCall(_GrailsCompile_groovy:69)
    at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy:85)
    at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy)
    at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
    at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
    at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:84)
    at RunApp$_run_closure1.doCall(RunApp.groovy:28)
    at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:427)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:415)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.executeTargets(Gant.groovy:590)
    at gant.Gant.executeTargets(Gant.groovy:589)

根据堆栈跟踪,我的项目非常无辜;-)

我尝试使用springcache 1.3.1,但后来遇到另一个第三方插件也需要1.2.1版本的问题。有没有办法为同一个版本使用两个不同的版本?

1 个答案:

答案 0 :(得分:0)

Grails不允许在项目中安装同一插件的两个版本。