Are you saying that this is not a Maven archetype or that it is? The Maven 
archtetype feature allows the POM (and other files) to be templated. It sounds 
like exactly what you are looking for. Check out 
https://maven.apache.org/guides/mini/guide-creating-archetypes.html it will 
probably do what you want.

From: David Karr <davidmichaelk...@gmail.com>
Date: Wednesday, March 30, 2022 at 10:47 AM
To: Maven Users List <users@maven.apache.org>
Subject: How to produce a pom.xml that is guaranteed to fail, with specific 
error messages
External Email

I work in a large company on a large project with hundreds of services,
most of which are Java Maven projects.  We have an "archetype" we use for
new services. It doesn't use the Maven archetype process.  There are
particular areas in the pom.xml that is generated that really need to be
modified by the developer to reflect their actual application.

We could certainly put comments in the template that tell the developer
what sort of changes need to be made, but I wonder if there's any way we
can ensure that they notice and handle particular areas of the pom.xml.
Just generating a comment with directions isn't enough.  I wish there was
some way I could ensure that running the build would fail with a specific
error message if they haven't dealt with each area. I suppose I could
create an XML syntax error in each area that should be addressed, with text
near the error that explains what to do, but that seems like a bit of a
hack, although it may be the only strategy I can use.  Is there a cleaner
way to do this sort of thing that I'm not aware of?

Reply via email to