I tried to follow this "https://docs.jboss.org/hibernate/jpamodelgen/1.3/reference/en-US/html_single/" tutorial to set up metamodel generation. Unfortunately it is not working. Can someone tell me the correct set up and the steps to create the metamodels. I'm using eclipse and maven.
My current pom includes the following:
Code:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<compilerArgument>-proc:none</compilerArgument>
<!-- <compilerArguments> -->
<!-- <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor> -->
<!-- </compilerArguments> -->
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</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>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<outputDirectory>src/main/java/</outputDirectory>
<processors>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</processors>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.3.0.Final</version>
<scope>compile</scope>
</dependency>
</dependencies>
</plugin>
Do I have to run
Code:
mvn generate-sources
to create the metamodels?