尽管maven插件用于构建时增强,但类没有增强

时间:2017-06-07 04:11:39

标签: java maven jpa java-ee openjpa

在运行时我收到错误:

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>

0 个答案:

没有答案