Fix JavaDoc and lock sisu-maven-plugin
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
index fade2a2..2045b0c 100755
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
@@ -123,13 +123,16 @@
/**
* How the property that is being evaluated is called
+ * @return kind of property
*/
- public abstract String getName();
+ protected abstract String getName();
/**
- * The name of the property currently being evaluated, this is used for default message pourpouses only
+ * The name of the property currently being evaluated, this is used for default message purposes only
+ *
+ * @return the name of the property
*/
- public abstract String getPropertyName();
+ protected abstract String getPropertyName();
/**
* Resolves the property value
@@ -137,7 +140,7 @@
* @param helper
* @throws EnforcerRuleException
*/
- public abstract Object resolveValue( EnforcerRuleHelper helper )
+ protected abstract Object resolveValue( EnforcerRuleHelper helper )
throws EnforcerRuleException;
}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java
index 64c7802..172ee68 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java
@@ -73,11 +73,7 @@
* java.vendor, which you can also see with mvn --version. <br>
* Excludes override the include rules.
*
- * Some examples are:
- * <ul>
- * <li><code>AdoptOpenJDK</code> prohibits vendor name AdoptOpenJDK </li>
- * <li><code>Amazon</code> prohibits vendor name Amazon </li>
- * </ul>
+ * @param theExcludes the vendor to to exclude from the include list.
*/
public void setExcludes( List<String> theExcludes )
{
@@ -90,7 +86,15 @@
* The rule will fail if vendor name matches any exclude, unless it also matches an
* include rule.
*
- * @see #setIncludes(List)
+ * Some examples are:
+ * <ul>
+ * <li><code>AdoptOpenJDK</code> prohibits vendor name AdoptOpenJDK </li>
+ * <li><code>Amazon</code> prohibits vendor name Amazon </li>
+ * </ul>
+ *
+ * @param theIncludes the list of required vendors.
+ *
+ * @see #setExcludes(List)
*/
public void setIncludes( List<String> theIncludes )
{
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
index ff5803b..3817569 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
@@ -162,7 +162,9 @@
/**
* Construct class by providing patterns as strings. Empty strings are ignored.
- *
+ *
+ * @param patterns includes
+ * @param ignorePatterns excludes
* @throws NullPointerException if any of the arguments is null
*/
public ArtifactMatcher( final Collection<String> patterns, final Collection<String> ignorePatterns )
@@ -195,7 +197,10 @@
/**
* Check if artifact matches patterns.
*
- * @throws InvalidVersionSpecificationException
+ * @param artifact the artifact to match
+ * @return {@code true} if artifact matches any {@link #patterns} and none of the {@link #ignorePatterns}, otherwise
+ * {@code false}
+ * @throws InvalidVersionSpecificationException if any pattern contains an invalid version range
*/
public boolean match( Artifact artifact )
throws InvalidVersionSpecificationException
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java
index 70d2f11..fc10a52 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java
@@ -75,9 +75,12 @@
}
/**
+ * Whether the version is coming from the default lifecycle bindings.
+ * Cannot be determined before Maven 3.6.1
*
* @param o either Plugin or ReportPlugin
- * @return
+ * @return null if untraceable, otherwise its matching value
+ * @see <a href="https://issues.apache.org/jira/browse/MNG-6600">MNG-6600</a>
*/
public static Optional<Boolean> isVersionFromDefaultLifecycleBindings( InputLocationTracker o )
{
@@ -93,9 +96,12 @@
}
/**
+ * Whether the version is coming from the super POM.
+ * Cannot be determined before Maven 3.6.1
*
* @param o either Plugin or ReportPlugin
- * @return null if untraceable, otherwise its matching value
+ * @return null if untraceable, otherwise its matching value
+ * @see <a href="https://issues.apache.org/jira/browse/MNG-6593">MNG-6593</a>
*/
public static Optional<Boolean> isVersionFromSuperpom( InputLocationTracker o )
{
diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java
index c1af174..2c379e5 100644
--- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java
+++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java
@@ -62,7 +62,7 @@
* </distributionManagement>
* </pre>
*
- * @throws Exception
+ * @throws Exception if any occurs
*/
@Test( expected = EnforcerRuleException.class )
public void shouldThrowExceptionIfDistributionManagementIsDefinedWithRepository()
@@ -85,6 +85,8 @@
* </snapshotRepository>
* </distributionManagement>
* </pre>
+ *
+ * @throws Exception if any occurs
*/
@Test( expected = EnforcerRuleException.class )
public void shouldThrowExceptionIfDistributionManagementIsDefinedWithRepositorySnapshotRepository()
@@ -110,6 +112,8 @@
* </site>
* </distributionManagement>
* </pre>
+ *
+ * @throws Exception if any occurs
*/
@Test( expected = EnforcerRuleException.class )
public void shouldThrowExceptionIfDistributionManagementIsDefinedWithRepositorySnapshotRepositorySite()
@@ -130,6 +134,8 @@
* </repository>
* </distributionManagement>
* </pre>
+ *
+ * @throws Exception if any occurs
*/
@Test
public void shouldAllowDistributionManagementHavingRepository()
@@ -153,6 +159,8 @@
* </snapshotRepository>
* </distributionManagement>
* </pre>
+ *
+ * @throws Exception if any occurs
*/
@Test
public void shouldAllowDistributionManagementHavingRepositorySnapshotRepository()
@@ -180,6 +188,8 @@
* </site>
* </distributionManagement>
* </pre>
+ *
+ * @throws Exception if any occurs
*/
@Test
public void shouldAllowDistributionManagementHavingRepositorySnapshotRepositorySite()
diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java
index f78729f..62c6528 100644
--- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java
+++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java
@@ -53,9 +53,10 @@
/**
* Test rule.
+ *
*/
public void testRulePass()
- throws EnforcerRuleException, ExpressionEvaluationException
+ throws Exception
{
EvaluateBeanshell rule = new EvaluateBeanshell();
// this property should not be set
@@ -67,7 +68,7 @@
}
public void testRuleFail()
- throws EnforcerRuleException, ExpressionEvaluationException
+ throws Exception
{
EvaluateBeanshell rule = new EvaluateBeanshell();
// this property should be set by the surefire
@@ -88,7 +89,7 @@
}
public void testRuleFailNoMessage()
- throws EnforcerRuleException, ExpressionEvaluationException
+ throws Exception
{
EvaluateBeanshell rule = new EvaluateBeanshell();
// this property should be set by the surefire
@@ -108,7 +109,7 @@
}
public void testRuleInvalidExpression()
- throws EnforcerRuleException, ExpressionEvaluationException
+ throws Exception
{
EvaluateBeanshell rule = new EvaluateBeanshell();
rule.setCondition( "${env} == null" );
@@ -129,7 +130,7 @@
}
public void testRuleInvalidBeanshell()
- throws EnforcerRuleException, ExpressionEvaluationException
+ throws Exception
{
EvaluateBeanshell rule = new EvaluateBeanshell();
rule.setCondition( "this is not valid beanshell" );
@@ -147,7 +148,7 @@
}
- public void testRuleCanExecuteMultipleThreads() throws InterruptedException {
+ public void testRuleCanExecuteMultipleThreads() throws Exception {
final String condition = "String property1 = \"${property1}\";\n" +
"(property1.equals(\"prop0\") && \"${property2}\".equals(\"prop0\"))\n" +
"|| (property1.equals(\"prop1\") && \"${property2}\".equals(\"prop1\"))\n" +
diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java
index fa4ae75..84030ae 100644
--- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java
+++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java
@@ -41,7 +41,7 @@
/**
* Test rule.
*
- * @throws IOException Signals that an I/O exception has occurred.
+ * @throws Exception if any occurs
*/
@Test
public void testRule()
@@ -105,9 +105,17 @@
EnforcerRuleUtilsHelper.execute( rule, helper, false );
}
-
-
+ /**
+ * Test id.
+ */
+ @Test
+ public void testId()
+ {
+ RequireReleaseDeps rule = newRequireReleaseDeps();
+ rule.getCacheId();
+ }
+
private RequireReleaseDeps newRequireReleaseDeps()
{
RequireReleaseDeps rule = new RequireReleaseDeps()
@@ -125,14 +133,4 @@
};
return rule;
}
-
- /**
- * Test id.
- */
- @Test
- public void testId()
- {
- RequireReleaseDeps rule = newRequireReleaseDeps();
- rule.getCacheId();
- }
}
diff --git a/maven-enforcer-extension/pom.xml b/maven-enforcer-extension/pom.xml
index 6f95f5b..4d74caf 100644
--- a/maven-enforcer-extension/pom.xml
+++ b/maven-enforcer-extension/pom.xml
@@ -36,6 +36,7 @@
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
+ <version>0.3.4</version>
<executions>
<execution>
<id>index-project</id>
diff --git a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
index 77fad8d..da0f258 100644
--- a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
+++ b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
@@ -132,11 +132,6 @@
return rules != null && rules.length > 0;
}
- /**
- * Entry point to the mojo
- *
- * @throws MojoExecutionException
- */
@Override
public void execute()
throws MojoExecutionException