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

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

问题描述

我在设置datanucleus增强器时遇到了一个问题,需要与Google应用引擎项目配合使用。如果我使用datanucleus eclipse插件一切都很顺利,但是在我的maven项目中,我得到了一个奇怪的冲突版本错误。

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.

我的POM有这些datanucleus引用:

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)

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

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

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

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

有什么想法?
在此先感谢...

Any ideas? Thanks in advance...

推荐答案

DN M2插件提供最新版本的可用DN罐,它需要做好自己的工作(除了使用最新版本之外,没有其他明智的做法)。您想通过指定核心的插件依赖关系或通过在您的应用程序中指定core为不同的版本

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天全站免登陆