Maven 谷歌应用引擎项目中数据核增强器的冲突版本 [英] Conflicting versions of datanucleus enhancer in a maven google app engine project

查看:33
本文介绍了Maven 谷歌应用引擎项目中数据核增强器的冲突版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在设置 datanucleus 增强器以与 Google 应用引擎项目一起使用时遇到问题.如果我使用 datanucleus eclipse 插件一切顺利,但在我的 maven 项目中,我收到一个奇怪的版本冲突错误.

我的 POM 有这些数据核引用:

<依赖><groupId>org.datanucleus</groupId><artifactId>datanucleus-core</artifactId><version>1.1.0</version></依赖>...<插件><groupId>org.datanucleus</groupId><artifactId>maven-datanucleus-plugin</artifactId><version>1.1.0</version><配置><mappingIncludes>**/*.class</mappingIncludes><详细>真</详细><enhancerName>ASM</enhancerName><api>JDO</api></配置><执行><执行><阶段>编译</阶段><目标><目标>增强</目标></目标></执行></执行></插件>

当我尝试构建项目时,出现以下错误:

<前>线程main"插件(Bundle)org.datanucleus"中的异常已经注册.确保类路径中没有同一个插件的多个 JAR 版本.URLfile:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.0/**datanucleus-core-1.1.0.jar**"已注册,您正在尝试在 URLfile:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.3/**datanucleus-core-1.1.3.jar**"注册一个相同的插件.org.datanucleus.exceptions.NucleusException:插件(捆绑包)org.datanucleus"已经注册.确保类路径中没有同一个插件的多个 JAR 版本.URLfile:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.0/datanucleus-core-1.1.0.jar"已注册,您正在尝试注册相同的插件位于 URLfile:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.3/datanucleus-core-1.1.3.jar".在 org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:437)在 org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:343)在 org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(NonManagedPluginRegistry.java:227)在 org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(NonManagedPluginRegistry.jav答:159)在 org.datanucleus.plugin.PluginManager.registerExtensionPoints(PluginManager.java:82)在 org.datanucleus.OMFContext.(OMFContext.java:164)在 org.datanucleus.enhancer.DataNucleusEnhancer.(DataNucleusEnhancer.java:171)在 org.datanucleus.enhancer.DataNucleusEnhancer.(DataNucleusEnhancer.java:149)在 org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1157)

我不明白为什么datanucleus需要maven下载datanucleus-core-1.1.3.jar,因为在pom.xml中没有引用这个

我也不明白为什么要注册datanucleus-core-1.1.3.jar...

有什么想法吗?提前致谢...

解决方案

DN M2 插件引入了可用的 DN jars 的最新版本来完成它的工作(除了使用最新的).您想将核心"限制为不同的版本,可以通过指定核心的插件依赖项,或在您的应用程序中指定为

<依赖><groupId>org.datanucleus</groupId><artifactId>datanucleus-core</artifactId><version>1.1.0</version><scope>运行时</scope></依赖>

I'm having a problem setting up datanucleus enhancer to use with a google app engine project. If I use the datanucleus eclipse plugin everything goes well, but in my maven project I get a strange conflicting version error.

My POM has these datanucleus references:

<dependency>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-core</artifactId>
    <version>1.1.0</version>
</dependency>

...

<plugin>
    <groupId>org.datanucleus</groupId>
    <artifactId>maven-datanucleus-plugin</artifactId>
    <version>1.1.0</version>
    <configuration>
        <mappingIncludes>**/*.class</mappingIncludes>
        <verbose>true</verbose>
        <enhancerName>ASM</enhancerName>
        <api>JDO</api>
    </configuration>
    <executions>
        <execution>
        <phase>compile</phase>
        <goals>
            <goal>enhance</goal>
        </goals>
        </execution>
    </executions>
</plugin>

When I try to build the project I get the following error:

Exception in thread "main" Plugin (Bundle) "org.datanucleus" is already registered. 
Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.0/**datanucleus-core-1.1.0.jar**" is already registered, and you are trying to register an identical plugin located at URL "file:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.3/**datanucleus-core-1.1.3.jar**."
org.datanucleus.exceptions.NucleusException: Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.0/datanucleus-core-1.1.0.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/Users/drome/.m2/repository/org/datanucleus/datanucleus-core/1.1.3/datanucleus-core-1.1.3.jar."
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:437)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:343)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(NonManagedPluginRegistry.java:227
)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(NonManagedPluginRegistry.jav
a:159)
at org.datanucleus.plugin.PluginManager.registerExtensionPoints(PluginManager.java:82)
at org.datanucleus.OMFContext.(OMFContext.java:164)
at org.datanucleus.enhancer.DataNucleusEnhancer.(DataNucleusEnhancer.java:171)
at org.datanucleus.enhancer.DataNucleusEnhancer.(DataNucleusEnhancer.java:149)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1157)

I don't understand why datanucleus required maven to download datanucleus-core-1.1.3.jar since this is not referenced in the pom.xml

I also do not understand why datanucleus-core-1.1.3.jar is being registered...

Any ideas? Thanks in advance...

解决方案

The DN M2 plugin pulls in the latest versions of the available DN jars that it needs to do its job (there is no other sensible way to do it other than use the latest). You want to restrict "core" to a different version, either by specifying the plugin dependency of core, or by specifying that in your application to

<dependency>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-core</artifactId>
    <version>1.1.0</version>
    <scope>runtime</scope> 
</dependency>

这篇关于Maven 谷歌应用引擎项目中数据核增强器的冲突版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆