ivo*_*ivo 19 google-app-engine maven-2 datanucleus
我在设置datanucleus增强器时遇到问题,需要与谷歌应用程序引擎项目一起使用.如果我使用datanucleus eclipse插件一切顺利,但在我的maven项目中,我得到一个奇怪的冲突版本错误.
我的POM有这些数据核参考:
<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>
Run Code Online (Sandbox Code Playgroud)
当我尝试构建项目时,我收到以下错误:
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,因为pom.xml中没有引用它
我也不明白为什么datanucleus-core-1.1.3.jar正在注册......
有任何想法吗?提前致谢...
DN M2插件提供了它需要完成工作的最新版本的可用DN罐(除了使用最新版本之外,没有其他合理的方法可以做到这一点).您希望将"核心"限制为不同的版本,方法是指定核心的插件依赖项,或者在应用程序中指定
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>1.1.0</version>
<scope>runtime</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
不幸的是,答案在评论中"隐藏"了:
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>1.1.0</version>
<scope>runtime</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
这对我有用!
归档时间: |
|
查看次数: |
10479 次 |
最近记录: |