Syntax error sounds like the best thing - using a enforcer plugin to produce an 
error will not be possible in arbritary locations.

And of course you also can add a commit or review hook to block template 
snippets to be committed.

Not sure if any of that is required if you have a commit review process.

Gruss
Bernd


--
http://bernd.eckenfels.net
________________________________
Von: David Karr <davidmichaelk...@gmail.com>
Gesendet: Wednesday, March 30, 2022 7:46:35 PM
An: Maven Users List <users@maven.apache.org>
Betreff: How to produce a pom.xml that is guaranteed to fail, with specific 
error messages

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