【发布时间】:2013-06-02 03:09:43
【问题描述】:
Grails 附带 Protobuf 2.4.1 作为“全局依赖项”,但我的应用程序使用针对 Protobuf 2.5.0 编译的库(并且 2.5.0 版本与 2.4.1 不兼容)。
我看不到任何方法告诉 Grails 仅使用指定版本而不是捆绑版本的问题。如果我在BuildConfig 中排除它,它只是从应用程序中排除,所有版本。我的意思是:
inherits("global") {
excludes 'protobuf-java'
}
dependencies {
//build 'com.google.protobuf:protobuf-java:2.5.0'
// or
compile 'com.google.protobuf:protobuf-java:2.5.0'
}
Grails 失败:
Fatal error during compilation org.apache.tools.ant.BuildException:
java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder
如何排除全局库,并将其添加为新的依赖项?我正在使用 Grails 2.2.2
【问题讨论】: