views:

56

answers:

2

i search a maven archetype for hibernate 3 (Struts 2 application)

A: 

Maven archetypes are used to create pre-baked structures, if your structure is too specific it's better to create your own configuration files.
A project with struts2 and hibernate3 is really specific and should be created manually.

If you have a lot of projects based on the same structure, feel free to create your own archetype, it's not complicated at all.


Resources :

On the same topic :

Colin Hebert
one project is bases on the structure, i create manually but the proble I do not know what archetype used to hibernate 3
Mercer
A: 

There is no such archetypes AFAIK. The closest you can get is a JPA archetype:

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

But while this archetype uses Hibernate as JPA provider, it will generate an persistence.xml, not an hibernate.cfg.xml, and the generated classes use the JPA API.

Either adapt it or just start from a blank jar project.

Pascal Thivent