eclipse existing maven project add jpa support?
how to add jpa support for existing maven project
i tried
project-->configure--> convert to jp开发者_JAVA技巧a project (there is no this option)
but for my other projects, such option available... can comment?
I already have existing mven project and i want to generate jpa entity from tables. no need to create new jpa project right?
I'm not sure but I think that you need to setup your project to use the JPA Facet (right click on the project the Properties > Project Facets and select Java Persistence). I don't know if m2eclipse can add this facet automatically.
But actually, with the version of Eclipse I'm using, adding the JPA facet doesn't add any entry for JPA under Configure when I right click on a project. It adds a menu JPA Tools > Generate Entities from Tables... (and JPA Tools > Generate Tables from Entities...).
Be sure to coordinate your Maven dependencies with the Eclipse JPA configuration. By default, Eclipse uses EclipseLink as its JPA implementation, which would require the use of a specific repository location and set of dependencies for the associated components in your project POM. If you choose to use EclipseLink rather than another JPA user library, ensure that the version numbers are consistent between the Eclipse and Maven configuration settings. More information on Eclipse and Maven/Eclipse configuration can be found at: http://www.eclipse.org/eclipselink/downloads/.
Use the 'EclipseLink P2 Repository' info to set up your workbench EclipseLink version and libraries, and follow the 'EclipseLink Maven Repository' link to set up your project POM to match it.
精彩评论