I have an archetype that we use to create new projects. At the point of project creation (i.e. when someone executes mvn archetype:generate) I want to pin some of the dependencies to RELEASE version available at that time (I strongly oppose putting <version>RELEASE</version> in POM file).
Is there a way I can make archetype to resolve RELEASE version and pin that for some of the libraries.
Only way I solve this problem right now is by releasing new version of archetype every time some of the core libraries are released and then hard coding versions of those in the archetype-resources/pom.xml
I did see couple of similar questions but none of the solutions for those work for me.
As I already mentioned, that I want to pin the latest release version available at the time of creating project from archetype. Using `RELEASE means that I can not recreate binaries from same source code as I will end up fetching a different version of dependency.
Let me explain with concrete example.
- I have an archetype with maven co-ordinate
com.my-company:my-awesome-framework:1.0. - I have a library with maven co-ordinates
com.my-company:core-lib:1.0. - Developer-1 runs command
mvn archeype:generate my-awesome-framework. He fills in required details and creates project calledservice-foo.service -foohas dependencycore-liband since. - We add more features to
core-liband release version2.0 - Developer-1 build
service-fooit still builds withcore-libversion1.0. (since he hasn't changed the version the project's POM file. Had I used<version>RELEASE<version>for 'core-lib, this timeservice-foowould have built with version2.0of thecore-lib`) - Devloper-2 runs
mvn archetype:generate my-awesome-framework. He fills out required fields and creates a service calledservice-bar. Now this time sincecore-libversion2.0. Note that I did not modifymy-awesome-archetypeto update version forcore-libinsidearchetype-resources\pom.xml
I hope this clarifies my use case