gpt4 book ai didi

java - Jar 没有为 Spring Boot 创建

转载 作者:行者123 更新时间:2023-12-02 10:40:47 25 4
gpt4 key购买 nike

我正在添加pluginManagement以避免无法在项目上执行目标 org.apache.openjpa:openjpa-maven-plugin:3.0.0:enhance (enhancer) 目标 org.apache.openjpa:openjpa-maven-plugin:3.0.0:enhance 的执行增强器失败:

错误。但是当我添加pluginManagement时,它会停止为我的项目创建jar。

    <build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.test.testApplication</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.6.201602180812</version>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<append>true</append>
</configuration>
<executions>
<execution>
<id>agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<includes>**/tablemodels/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
<persistenceXmlFile>src/main/resources/META-INF/persistence.xml</persistenceXmlFile>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

如果我从 pom 中删除pluginManagement,则会创建 Jar。

最佳答案

我的猜测是你刚刚包装了你的 <plugins>标签 <pluginManagement>标签,它不做你想做的事。我建议您阅读the documentation了解plugin之间的关系和pluginManagement 。另请参阅another post on StackOverflow .

至于你的根本问题:我猜你提到的错误是 Eclipse 错误。它由 m2e 插件发出,该插件需要为 pom 中的每个 Maven 插件提供一个连接器。

您通常可以通过在您最喜欢的搜索引擎中输入“m2e 连接器”来找到连接器(如果在 Eclipse Marketplace 上找不到)。

在这种情况下,您可能需要安装:https://github.com/beskow/openjpa-maven-connector

关于java - Jar 没有为 Spring Boot 创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52930492/

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