在运行时我收到错误:
pom.xml的构建:
<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>
我也尝试过:
<configuration>
<includes>**/User.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>