This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

"perform package" fails on simple JAR project with no persistencePage Title Module

"perform package" fails on simple JAR project with no persistence

Jul 27th, 2010, 10:53 AM

I'm creating a simple project which will be just a JAR archive that will be shared by a few web applications. I merely did the project setup and created a few classes, no persistence setup needed. If I "perform clean" followed by "perform package" I get weaving errors in the Roo shell. Something like "can't determine annotations of missing type javax.persistence.Entity when weaving type org.mypackage.MyClass" and I get the same thing on all the classes in the project. None of them have any annotations on them.

If I "perform clean" followed by "perform command --mavenCommand compile" followed by "perform command --mavenCommand compile" followed by "perform package" only then does it successfully package my JAR. I intentionally have to perform the maven compile twice because the first compile gives me the same errors as if I just "perform clean" then "perform package." The second compile seems to successfully complete, after which I can successfully package.

That is because Roo includes AspectJ into the project pom.xml. AspectJ is an integral part to almost all functionalities Roo offers. However, currenty AspectJ has a direct dependency for the JPA API so that API needs to be included in the Roo pom.xml as well. See more details here http://forum.springsource.org/showth...070#post293070.