【问题标题】:Has eclipselink JPA2 Criteria API pom.xml configuration been simplified?eclipselink JPA2 Criteria API pom.xml 配置是否已简化?
【发布时间】:2011-02-28 22:52:05
【问题描述】:

来自我的 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)。

【问题讨论】:

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


【解决方案1】:

注意:我是插件的作者。

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

    • 那么你还在使用 maven-processor-plugin 吗?你会发布你的 pom.xml 配置吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-11-23
    • 2012-03-25
    • 2011-08-07
    • 2011-04-12
    • 1970-01-01
    • 2017-06-09
    • 1970-01-01
    相关资源
    最近更新 更多