Hi there, I have been using the 'maven-archetype-plugin' and the 'create-from-project' more recently and I wanted to find what best practices others use when trying to maintain the development of thir own or company archetypes.
So picture this scene, I start my brand new maven project based the archetype artifact 'maven-archetype-quickstart'. I then decide that instead of starting with a simple 'Hello W'orld application I want a project that will have an application with a basic Spring configuration that delivers 'Hello World'. This is great and all that hard work can now be turned into another archetype and every time I am start a new project I can use this new archetype. A few more projects down the line and I know that I want to start with this Spring configuration and I also want to start with a few more utility classes as well. In this example I have also kept my sample project that I used to generate my initial archetype and so I add the new utility classes to it and regenerate the archetype. This is a brilliant feeling and I am just building on previous work. So from the example above I have a sample project that I add to each time I want a new archetype and then from each iteration I have generated archetype code. The first question is do other developers version control the generated archetype code? I ask this because if the sample project is version controlled then I know I can recreate the archetype artifact through the use of 'maven-archetype-plugin' and the 'create-from-project' goal. My initial reaction was to say yes, but what about the second part of the above example where I want to update my archetype to have some new classes. If I version controlled the generated code and then checked it out I could then overlay the newly generated code on top of it. I could then check in the changes but I am guessing that it gets a bit fiddly if archetype resources are removed in later version of the archetype, (maybe a patch would help here). I then thought that only the sample project only needs to be version controlled and then tagged with each update that introduces new archetype resources. The release process would be to execute the following command on the sample project: mvn release:prepare Then I would sync to the new tag location within version control and then execute on the following command on the local copy of the required code mvn archetype:create-from-project Then I would move into the generated archetype folder and execute the following command mvn deploy Ok so I know that these steps are a bit all over the place and not as smooth as a normal release of a standard maven project, but when generating an archetype it is a 2 stage process. The first part is to generate the archetype resources and then generate an archetype artifact from those new resources. As long as I have the initial sample project version controlled I can then recreate the final archetype artifact again and again. Any thoughts or feedback on how others develop their archetypes? Trent