Create a Maven project with hibernate
I need to c开发者_StackOverflow中文版reate a maven project, which also has hibernate. How do i write the maven create project command.
The IDE i'm using is Eclipse.
If you're asking what archetype would be best to use from the command line, then the below will give you a nice list to choose from:
mvn archetype:generate
However, you say you're using Eclipse - if so, take advantage of the Maven integration and you'll be offered a similar choice when creating the project (basically just a nice GUI around archetype:generate and friends)
What you need is an appropriate maven archetype E.g.:
mvn archetype:generate -B \
-DgroupId=com.my-company.my-project \
-DartifactId=my-project-domain \
-DpackageName=com.company.project.domain \
-DarchetypeGroupId=com.rfc.maven.archetypes \
-DarchetypeArtifactId=jpa-maven-archetype \
-DremoteRepositories=http://maven.rodcoffin.com/repo \
-DarchetypeVersion=1.0.0
You can find some Hibernate archetypes here http://docs.codehaus.org/display/MAVENUSER/Archetypes+List or use google
精彩评论