maven-enforcer-plugin

How to catch exception in a beanshell?

浪尽此生 提交于 2021-01-07 01:34:30
问题 I can use the evaluateBeanshell rule to enforce some convention: no colon's in directories below src. <plugin> <artifactId>maven-enforcer-plugin</artifactId> <version>1.4.1</version> <executions> <execution> <id>enforce-beanshell</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <evaluateBeanshell> <condition>org.codehaus.plexus.util.FileUtils.getDirectoryNames(new File("src"), "**/*:*", null, false).isEmpty()</condition> </evaluateBeanshell> </rules> </configuration> <

enforce custom rule in external projects

主宰稳场 提交于 2020-01-14 05:51:07
问题 I have one Parent maven project and 4 modules in that project: Now I want to put some custom rule that says there can be no project versions or dependency versions that begin with the string "master-". This rule will be applicable to all the external projects that depends on eBill Software. So I created a new module with name customRule whose parent is again eBill Software. I followed writing-a-custom-rule and my rule class is in new module. Relevant part of CustomRule.java in module

Run Maven Enforcer Plugin rule on command line

不打扰是莪最后的温柔 提交于 2019-12-23 07:27:27
问题 I would like to enforce the requireReleaseDeps rule of the Maven Enforcer Plugin on a Maven project without any POM configuration simply as a command line call. According to the docs I should be able to just pass in the rules parameter like so mvn enforcer:enforce -Drules=requireReleaseDeps or maybe this should work mvn enforcer:enforce -Drules=org.apache.maven.plugins.enforcer.RequireReleaseDeps However both of these calls result in [ERROR] Failed to execute goal org.apache.maven.plugins

Run Maven Enforcer Plugin rule on command line

烂漫一生 提交于 2019-12-23 07:27:09
问题 I would like to enforce the requireReleaseDeps rule of the Maven Enforcer Plugin on a Maven project without any POM configuration simply as a command line call. According to the docs I should be able to just pass in the rules parameter like so mvn enforcer:enforce -Drules=requireReleaseDeps or maybe this should work mvn enforcer:enforce -Drules=org.apache.maven.plugins.enforcer.RequireReleaseDeps However both of these calls result in [ERROR] Failed to execute goal org.apache.maven.plugins

maven custom rule failing or passing without considering custom rule

我与影子孤独终老i 提交于 2019-12-13 04:20:06
问题 I am following writing-a-custom-rule document to create custom rule and applying it. My enforcer plugin execution has the following entry in pom.xml file- <execution> <id>enforce-no-masters</id> <configuration> <skip>${masterDependenciesAllowed}</skip> <rules> <myCustomRule implementation="or.apache.customRule.CustomRule"> <excludes> <exclude>*:*:master-*:*:*</exclude> </excludes> <shouldIfail>false</shouldIfail> </myCustomRule> </rules> </configuration> <goals> <goal>enforce</goal> </goals>

How to resolve maven EnforcedBytecodeVersion failure?

老子叫甜甜 提交于 2019-12-11 17:54:41
问题 When trying to run maven enforcer getting a failure due to some classes conforming to 1.9 where as the entire project is confine dto 1.8. Following is the stack trace of the log. That specific dependency is being pulled by a different jar which can't be excluded as it has compile time dependency. [INFO] Checking unresolved references to org.codehaus.mojo.signature:java18:1.0 [INFO] Restricted to JDK 1.8 yet javax.json.bind:javax.json.bind-api:jar:1.0:compile contains module-info.class

Maven enforcer plugin missing or invalid rules

混江龙づ霸主 提交于 2019-12-03 15:16:22
问题 I am trying to setup the enforcer plugin for maven to enforce a minimum Java version. However, whenever I try to run mvn enforcer:enforce , I get: The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce are missing or invalid Here is the relevant portion of my pom file: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.3.1</version> <executions> <execution> <id>enforce-java</id> <phase>validate<

Maven enforcer plugin missing or invalid rules

你。 提交于 2019-12-03 05:50:29
I am trying to setup the enforcer plugin for maven to enforce a minimum Java version. However, whenever I try to run mvn enforcer:enforce , I get: The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce are missing or invalid Here is the relevant portion of my pom file: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.3.1</version> <executions> <execution> <id>enforce-java</id> <phase>validate</phase> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireJavaVersion> <version>(1.7

usage of maven enforcer plugin

人走茶凉 提交于 2019-11-27 21:13:40
问题 I'd like to use the maven enforcer plugin to check to see if I have duplicate classes on my path. I've tried the example from here. But when I run it like so: mvn enforcer:enforce I get this: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0.1:enforce (default-cli) on project datapopulator: The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.0.1:enforce are missing or invalid Is there a way to use this correctly? EDIT #1 If changing my