gpt4 book ai didi

google-app-engine - maven google app engine 项目中 datanucleus 增强器的冲突版本

转载 作者:太空宇宙 更新时间:2023-11-03 15:18:01 25 4
gpt4 key购买 nike

我在设置 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>

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

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.java: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 jar 的最新版本(除了使用最新版本之外,没有其他明智的方法可以做到这一点)。你想限制“核心”到不同的版本,要么通过指定核心的插件依赖,要么在你的应用程序中指定它

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

关于google-app-engine - maven google app engine 项目中 datanucleus 增强器的冲突版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/877949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com