mavenarchitecturemaven-archetypearchetypes

Maven Archetype creation via Eclipse


I am willing to create an archetype which will be useful to create a lot of projects sharing the same architecture. I followed the maven guide and read some bloggers guides but even with these informations I am struggling.

I have some constraints for my projects :

How can I achieve this ? I tried several solutions but encountered a lot of errors. If you have a complete step-by-step guide in english or french that would be fantastic, but I would also like to understand how it works.

Many thanks for your help


Solution

  • Let me answer parts of your question.

    From an example project, you can create an archetype by using archetype:create-from-project (https://maven.apache.org/archetype/maven-archetype-plugin/create-from-project-mojo.html).

    You can supply a property file that will be used to replace actual values (like 1.0.0-SNAPSHOT) with references (like $version). All filtered files will be treated as velocity templates so that you can use $-type replacement.

    Your repository restriction may be problem because you probably need dozens of artifacts to make the archetype plugin run.