Feature Proposal: Archetype-Based Project Updates
New feature, improvement proposal
Hi,
I would like to propose adding support for updating existing projects from newer versions of Maven Archetypes in Maven 4.
Currently, Maven Archetypes provide a way to generate projects from templates, but there is no first-class workflow for taking an existing project that was created from an archetype and updating it when the archetype itself has evolved.
It would be useful if Maven 4 could introduce an archetype/template update capability. In general, the workflow could look something like:
- Create a project from an archetype.
- Later, when a newer version of the archetype is available, update the existing project to the newer template.
- Preserve project-specific changes while applying relevant changes from the updated archetype.
- Clearly surface any conflicts that require manual attention.
This would make archetypes more useful for maintaining multiple projects based on a common evolving template.
Projects such as Copier provide a similar template-update workflow: https://github.com/copier-org/copier
I think this could be an interesting feature to consider for Maven 4.
Thanks!
Thanks for raising this proposal. I looked through both "apache/maven" and "apache/maven-archetype" to understand what would be needed for an archetype-based project update workflow.
One prerequisite appears to be tracking the relationship between a generated project and the archetype that created it. Currently, "archetype:generate" does not persist the originating archetype coordinates/version in the generated project, so an automated update workflow would need either persisted metadata or explicit baseline information supplied by the user.
For a Copier-like update workflow, I see two main technical pieces:
- Archetype origin metadata — record the minimum information needed to reproduce the original template, while avoiding persistence of credentials, tokens, or environment-specific properties.
- Template update/merge — generate the original and newer archetype versions and merge the template changes with the user's current project, surfacing conflicts for manual resolution.
There is also an architectural question about where the update workflow should live: as an "archetype:update" goal in "maven-archetype-plugin", or as part of Maven 4's existing "mvnup" infrastructure.
I would be interested in maintainer feedback on the preferred architecture and metadata approach before starting an implementation. If this direction makes sense, I would be happy to investigate/contribute the initial metadata groundwork in "apache/maven-archetype".
Added a test to verify the root POM generated by the fileset archetype, including its groupId, artifactId, version, and packaging. This improves test coverage and helps ensure the generated project has the expected Maven configuration.