Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Metamodel generation with Maven

I managed to make it work and wrote a blog about it

http://agoncal.wordpress.com/2010/05/28/jpa-2-0-criteria-api-with-maven-and-eclipselink/

Antonio

2010/5/27 Antonio Goncalves <antonio.mailing@xxxxxxxxx>
Hi all,
 
I'm using EclipseLink 2.0.1 to generate entities metamodel so I can use the new Criteria API. I've setup Intellij Idea annotation processing and everything works fine. Now, I need to industrialize the metamodel generation with Maven and I can't make it work. I'm using the apt-maven-plugin as follow :
 
 <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.0-alpha-3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>                    <factory>org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor</factory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.eclipse.persistence</groupId>
                        <artifactId>javax.persistence</artifactId>
                        <version>2.0.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.eclipse.persistence</groupId>
                        <artifactId>eclipselink</artifactId>
                        <version>2.0.1</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
 
The problem is that the APT plugin needs an implementation of AnnotationProcessorFactory, so when I run Maven I have the following :
 
[WARNING] warning: Specified factory, 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor', is not an AnnotationProcessorFactory.
[WARNING] warning: No annotation processors found but annotations present.
 
And, indeed, CanonicalModelProcessor doesn't implement AnnotationProcessorFactory.
 
Does anybody know how to generate metamodel classes with Maven ? Am I using the right plugin (APT) ?
 
Thanks,
Antonio



--
--
Antonio Goncalves (antonio.goncalves@xxxxxxxxx)
Software architect

Web site : www.antoniogoncalves.org
Blog: agoncal.wordpress.com
Feed: feeds2.feedburner.com/AntonioGoncalves
Paris JUG leader : www.parisjug.org
LinkedIn: www.linkedin.com/in/agoncal

Back to the top