Ich folgte der JPA Modelgen guide und ich konnte das kanonische Metamodell erzeugen, das ich brauche. Mit diesem pom ein:JPA Hibernate Metamodel Generierung durch Maven
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.6-redhat</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<outputDirectory>target/metamodel</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/metamodel</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Die erzeugte Quelle wird in dem angegebenen Verzeichnis ordnungsgemäß erstellt und ich muß manuell als Quelle in dem Eclipse-Projekt Klassenpfad angeben, es zu benutzen. Wenn ich einen Maven trigger die Protokolle zeigen cannot find symbol
oder duplicate class
und ich bekomme immer noch erfolgreich bauen. Also meine Frage ist, ist das erwartete/korrekte Verhalten beim Erstellen des Metamodells? oder habe ich etwas im cofig vermisst? Dank
FIY, werfen Sie einen Blick auf [jpa-Metamodell-mit-Maven] (https://jinahaya.wordpress.com/2014/03/29/jpa-metamodel-with-maven/) –