Java 类未增强,尽管maven插件用于构建时增强
在运行时,我得到一个错误: xml的构建:Java 类未增强,尽管maven插件用于构建时增强,java,maven,jpa,jakarta-ee,openjpa,Java,Maven,Jpa,Jakarta Ee,Openjpa,在运行时,我得到一个错误: xml的构建: <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>openjpa-maven-plugin</artifactId> <executions>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<executions>
<execution>
<id>JPA Enhance</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- I tried with and without this -->
<persistenceXmlFile>${basedir}/src/main/webapp/META-INF/persistence.xml</persistenceXmlFile>
<toolProperties>
<property>
<name>addDefaultConstructor</name>
<value>true</value>
</property>
<property>
<name>enforcePropertyRestrictions</name>
<value>true</value>
</property>
</toolProperties>
</configuration>
</plugin>
</plugins>
</build>
org.codehaus.mojo
openjpa maven插件
JPA增强
进程类
增强
${basedir}/src/main/webapp/META-INF/persistence.xml
addDefaultConstructor
真的
强制执行财产限制
真的
我也尝试过:
<configuration>
<includes>**/User.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
**/用户类
真的
真的
我想知道增强过程的日志会告诉你什么…@NeilStockton当我运行maven“任务”手动增强类时,它会工作并增强类。但是,当我只是运行主构建时,它永远不会被调用。那么,增强后的类会被覆盖吗?或者您在运行时使用了一些不同的类?aka调试使用了什么when@NeilStockton我想它甚至都不叫那个插件。我正在使用IntelliJ,当我选择“增强”任务并右键单击并选择“调试前运行”时,它就工作了!为什么默认情况下不会调用它?