是否简化了eclipselink JPA2 Criteria API pom.xml配置?

时间:2011-02-28 22:52:06

标签: maven eclipselink jpa-2.0 criteria-api pom.xml

从我的pom http://code.google.com/p/memorizeasy/source/browse/MemoPlatform/persistence/pom.xml

<plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>1.3.7</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
              <!-- Without this, the annotation processor complains about persistence.xml not being present and fail -->
                            <compilerArguments>-Aeclipselink.persistencexml=src/main/resources/META-INF/persistence.xml -Aeclipselink.persistenceunits=com.mysimpatico_MemoPlatform-database_nbm_1.0-SNAPSHOTPU</compilerArguments>
              <!-- For an unknown reason, the annotation processor is not discovered, have to list it explicitly -->
                            <processors>
                                <processor>org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor</processor>
                            </processors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <compilerArgument>-proc:none</compilerArgument>
                </configuration>
            </plugin>

我们去年讨论了here,并报告了一个相关的bug(没有人关心@eclipselink)。

2 个答案:

答案 0 :(得分:1)

注意:我是该插件的作者。

为了简化配置,我建议您测试:https://github.com/ethlo/eclipselink-maven-plugin

答案 1 :(得分:0)

使用EclipseLink 2.2.0,它适用于我而无需指定处理器。仍然需要编译器参数。