Java 目标org.bsc.maven的执行流程:maven处理器插件:4.0-rc1:流程失败
我有一个问题,我想与大家分享,也许能得到你们的帮助 就在今天,我重新安装了我的开发环境,并意识到无法使用maven(版本3.6.3,但我也尝试了旧版本)构建我的项目。下一步是问题堆栈跟踪:Java 目标org.bsc.maven的执行流程:maven处理器插件:4.0-rc1:流程失败,java,maven,version,conflict,Java,Maven,Version,Conflict,我有一个问题,我想与大家分享,也许能得到你们的帮助 就在今天,我重新安装了我的开发环境,并意识到无法使用maven(版本3.6.3,但我也尝试了旧版本)构建我的项目。下一步是问题堆栈跟踪: Execution process of goal org.bsc.maven:maven-processor-plugin:4.0-rc1:process failed: Unable to load the mojo 'process' in the plugin 'org.bsc.maven:mave
Execution process of goal org.bsc.maven:maven-processor-plugin:4.0-rc1:process failed:
Unable to load the mojo 'process' in the plugin 'org.bsc.maven:maven-processor-plugin:4.0-rc1' due to an API incompatibility:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
org/bsc/maven/plugin/processor/MainAnnotationProcessorMojo has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Java版本为:Java版本:1.8.0_242,供应商:Oracle公司,运行时:/usr/lib/jvm/Java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre
我花了一些时间来理解什么是错误的,为什么在本地机器上它可以工作,但在新的开发机器上却不能。我知道问题在于maven插件(maven处理器插件)的依赖关系是由比我用于项目的版本更新的版本构建的。但是为什么Maven加载这个候选版本而不是稳定的3.3.3呢
然后我从本地机器上删除了~/.m2/repository/org/bsc/maven/maven处理器插件
,然后。。。是的,我在我的开发机器上遇到了相同的问题。我的本地Maven版本是3.6.1
我假设Maven开始使用该插件的最新版本,并在没有向后兼容性的情况下向前移动。这听起来像是Maven生态系统中的最后一个Java 8天,但我不相信这一点
顺便说一句:MAVEN处理器插件»4.0-rc1
已经发布(2020年4月17日),这就解释了为什么之前我没有遇到这样的问题
如果有人有类似的问题或者可以解释Maven的情况,我会非常感激。提前谢谢大家,注意安全
附:pom.xml中插件配置的外观
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<outputDirectory>src/generated</outputDirectory>
<processors>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</processors>
<compilerArguments>-ApersistenceXml="src/main/resources/META-INF/persistence-data.xml"</compilerArguments>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>
</plugin>
org.bsc.maven
maven处理器插件
过程
过程
生成源
src/generated
org.hibernate.jpamodelgen.jpametamodelenticyprocessor
-ApersistenceXml=“src/main/resources/META-INF/persistence data.xml”
org.hibernate
冬眠
${hibernate.version}
p.p.S.我并没有被这个阻止,因为我只是使用了一个版本标签并设置了插件的最新稳定版本3.3.3
。但我仍然很好奇为什么会发生这样的冲突。而且,再一次,我将非常高兴有任何想法和评论