1

从我的 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>

我们去年在这里讨论过这个问题,并报告了一个相关的错误(没有人关心@eclipselink)。

4

2 回答 2

1

注意:我是插件的作者。

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

于 2013-01-17T11:52:20.387 回答
0

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

于 2011-06-10T10:48:38.680 回答