Do you need to generate the metamodel classes for only a subset of your
entities, or will generating them for everything work?
Adding just this will generate the metamodel classes for everything (you had
most of this already) :
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Aopenjpa.metamodel=true</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
If you only want metamodel classes for a subset of your entities you might
have to use <excludes> or <includes> in the configuration for the compiler
(and two different executions of the plugin). Of course there could be some
Maven wushu that I don't know that makes this easier.
hth
-mike
On Sun, Aug 15, 2010 at 10:58 AM, JVerstry <[email protected]> wrote:
>
> I got as far as updating my pom.xml as following:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> <encoding>${project.build.sourceEncoding}</encoding>
> <fork>true</fork>
> <compilerArgument>-classpath openjpa-all.jar
> -Aopenjpa.metamodel=true -Aopenjpa.log=TRACE
> /my/package/MyClass.java</compilerArgument>
> <meminitial>128m</meminitial>
> <maxmem>1024m</maxmem>
> </configuration>
> </plugin>
>
> If I run javac with a command line from the right directory, the class is
> processed.
>
> i) But it fails with maven. Does anyone know how to make this work with
> maven?
> ii) Is there any simple way to specify a list of classes to process using
> '*.java'-like parameters?
>
> Thanks!
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Generation-of-Canonical-MetaModel-Classes-with-Maven-tp5424291p5425470.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>