Hi. We have made some archetypes that we use internally, but they contain much of the same code. We would like to avoid the risk of updating one archetype, but forget the others when making changes in the code they have in common.
We are using Springsource Tool Suite and Maven to create bundles for Apache Felix. All bundles have some boilerplate code in common, and some bundles have boilerplate code for different technologies (XML reader, DB2 writer, etc.). We would like it if a developer could use our archetype to add or get the code for the needed technologies for a bundle and only get the files and project setup related to those technologies. The solution we are using now is different archetypes; Basic, Basic+XML, Basic+XML+DB2, but this is difficult to maintain. We thought about making one archetype project with all technologies and then build it multiple times with different archetype-metadata.xml files which includes/excludes the necessary files, but that does not solve our problem with files like for instance application-context.xml with varying contents but same name. We have looked into partial archetypes, but we still need to add beans for injection to the application-context.xml and code calling the library and Maven doesn’t seem able to merge files. We are unable to find any good documentation on this. A different solution could be to make an archetype for each technology (but not as a bundle), and then add them as modules, but we cannot see how this could solve our problem, when we still can’t change the code and xml files in the main project. Thanks in advance, Troels
