J Fabian Meier
J Fabian Meier

Reputation: 35843

Maven Enforcer Extension

I have just discovered the Maven Enforcer Extension

https://maven.apache.org/enforcer/maven-enforcer-extension/usage.html

I wonder whether it is possible to configure it outside the actual project, e.g. in the settings.xml, the Maven installation or on the command line.

I see that loading the extension can be done by adding a JAR to the Maven installation, but one still has configure the rules somewhere.

The use case: We would like to enforce some rules for all of our projects, but unfortunately, some projects cannot use the company parent POM. As we have more than 1000 projects, it would be great to have some project-independent way of achieving this.

EDIT

Seems like the location of the configuration file is hardcoded:

https://github.com/apache/maven-enforcer/blob/enforcer-3.0.0/maven-enforcer-extension/src/main/java/org/apache/maven/extensions/enforcer/EnforceExtension.java#L56

So I probably need to either fork the plugin, or create the file "on the fly" before the Maven build.

Upvotes: 1

Views: 112

Answers (0)

Related Questions