You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2014/10/24 23:23:02 UTC
svn commit: r1634140 - in /maven/enforcer/trunk: ./
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/
enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/
maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enfor...
Author: khmarbaise
Date: Fri Oct 24 21:23:01 2014
New Revision: 1634140
URL: http://svn.apache.org/r1634140
Log:
- Upgrade to maven-parent version 25.
- Fixed a large number of checkstyle reported issues.
Modified:
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DistributionManagementCheck.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java
maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java
maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/AbstractEnforceMojo.java
maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceOnceMojo.java
maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/RecommendMojo.java
maven/enforcer/trunk/pom.xml
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java Fri Oct 24 21:23:01 2014
@@ -64,8 +64,10 @@ public abstract class AbstractVersionEnf
* @param actualVersion the version to be checked.
* @throws EnforcerRuleException the enforcer rule exception
*/
+ // CHECKSTYLE_OFF: LineLength
public void enforceVersion( Log log, String variableName, String requiredVersionRange, ArtifactVersion actualVersion )
throws EnforcerRuleException
+ // CHECKSTYLE_ON: LineLength
{
if ( StringUtils.isEmpty( requiredVersionRange ) )
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java Fri Oct 24 21:23:01 2014
@@ -188,9 +188,11 @@ public class BanTransitiveDependencies
private DependencyGraphBuilder createDependencyGraphBuilder()
throws ComponentLookupException
{
+ // CHECKSTYLE_OFF: LineLength
DefaultDependencyGraphBuilder builder =
(DefaultDependencyGraphBuilder) helper.getContainer().lookup( DependencyGraphBuilder.class.getCanonicalName(),
"default" );
+ // CHECKSTYLE_ON: LineLength
builder.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, "DefaultDependencyGraphBuilder" ) );
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java Fri Oct 24 21:23:01 2014
@@ -42,8 +42,10 @@ public class BannedDependencies
/**
* Specify the banned dependencies. This can be a list of artifacts in the format
- * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard by using '*' (ie group:*:1.0) <br>
- * The rule will fail if any dependency matches any exclude, unless it also matches an include rule.
+ * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
+ * by using '*' (ie group:*:1.0) <br>
+ * The rule will fail if any dependency matches any exclude, unless it also matches
+ * an include rule.
*
* @see {@link #setExcludes(List)}
* @see {@link #getExcludes()}
@@ -52,8 +54,10 @@ public class BannedDependencies
/**
* Specify the allowed dependencies. This can be a list of artifacts in the format
- * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard by using '*' (ie group:*:1.0) <br>
- * Includes override the exclude rules. It is meant to allow wide exclusion rules with wildcards and still allow a
+ * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
+ * by using '*' (ie group:*:1.0) <br>
+ * Includes override the exclude rules. It is meant to allow wide exclusion rules
+ * with wildcards and still allow a
* smaller set of includes. <br>
* For example, to ban all xerces except xerces-api -> exclude "xerces", include "xerces:xerces-api"
*
@@ -164,8 +168,10 @@ public class BannedDependencies
/**
* Specify the banned dependencies. This can be a list of artifacts in the format
- * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard by using '*' (ie group:*:1.0) <br>
- * The rule will fail if any dependency matches any exclude, unless it also matches an include rule.
+ * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
+ * by using '*' (ie group:*:1.0) <br>
+ * The rule will fail if any dependency matches any exclude, unless it also matches an
+ * include rule.
*
* @see {@link #getExcludes()}
* @param theExcludes the excludes to set
@@ -187,10 +193,13 @@ public class BannedDependencies
/**
* Specify the allowed dependencies. This can be a list of artifacts in the format
- * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard by using '*' (ie group:*:1.0) <br>
- * Includes override the exclude rules. It is meant to allow wide exclusion rules with wildcards and still allow a
+ * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
+ * by using '*' (ie group:*:1.0) <br>
+ * Includes override the exclude rules. It is meant to allow wide exclusion rules with
+ * wildcards and still allow a
* smaller set of includes. <br>
- * For example, to ban all xerces except xerces-api -> exclude "xerces", include "xerces:xerces-api"
+ * For example, to ban all xerces except xerces-api -> exclude "xerces",
+ * include "xerces:xerces-api"
*
* @see {@link #setIncludes(List)}
* @param theIncludes the includes to set
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java Fri Oct 24 21:23:01 2014
@@ -43,16 +43,16 @@ public class DefaultEnforcementRuleHelpe
{
/** The log. */
- Log log;
+ private Log log;
/** The evaluator. */
- ExpressionEvaluator evaluator;
+ private ExpressionEvaluator evaluator;
/** The session. */
- MavenSession session;
+ private MavenSession session;
/** The container. */
- PlexusContainer container;
+ private PlexusContainer container;
/**
* Instantiates a new default enforcement rule helper.
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java Fri Oct 24 21:23:01 2014
@@ -60,6 +60,7 @@ public class DependencyConvergence
this.uniqueVersions = uniqueVersions;
}
+ // CHECKSTYLE_OFF: LineLength
/**
* Uses the {@link EnforcerRuleHelper} to populate the values of the
* {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
@@ -70,6 +71,7 @@ public class DependencyConvergence
* @return a Dependency Node which is the root of the project's dependency tree
* @throws EnforcerRuleException
*/
+ // CHECKSTYLE_ON: LineLength
private DependencyNode getNode( EnforcerRuleHelper helper )
throws EnforcerRuleException
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java Fri Oct 24 21:23:01 2014
@@ -38,15 +38,14 @@ public class EvaluateBeanshell
{
/** Beanshell interpreter. */
- private static final Interpreter bsh = new Interpreter();
+ private static final Interpreter BSH = new Interpreter();
/** The condition to be evaluated.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setCondition(String)}
* @see {@link #getCondition()}
* */
- public String condition;
+ private String condition;
public final void setCondition( String condition )
{
@@ -104,7 +103,7 @@ public class EvaluateBeanshell
Boolean evaluation = Boolean.FALSE;
try
{
- evaluation = (Boolean) bsh.eval( script );
+ evaluation = (Boolean) BSH.eval( script );
log.debug( "Echo evaluating : " + evaluation );
}
catch ( EvalError ex )
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java Fri Oct 24 21:23:01 2014
@@ -133,6 +133,7 @@ public class ReactorModuleConvergence
{
StringBuilder sb = new StringBuilder().append( SystemUtils.LINE_SEPARATOR );
addMessageIfExist( sb );
+ // CHECKSTYLE_OFF: LineLength
for ( Entry<MavenProject, List<Dependency>> item : areThereDependenciesWhichAreNotPartOfTheReactor.entrySet() )
{
sb.append( " module: " );
@@ -150,6 +151,7 @@ public class ReactorModuleConvergence
throw new EnforcerRuleException(
"Reactor modules contains dependencies which do not reference the reactor."
+ sb.toString() );
+ // CHECKSTYLE_ON: LineLength
}
}
@@ -369,8 +371,9 @@ public class ReactorModuleConvergence
* @param sortedProjects The list of existing projects within this build.
* @return List of violations. Never null. If the list is empty than no violation has happened.
*/
- private Map<MavenProject, List<Dependency>> areThereDependenciesWhichAreNotPartOfTheReactor( String reactorVersion,
- List<MavenProject> sortedProjects )
+ // CHECKSTYLE_OFF: LineLength
+ private Map<MavenProject, List<Dependency>> areThereDependenciesWhichAreNotPartOfTheReactor( String reactorVersion, List<MavenProject> sortedProjects )
+ // CHECKSTYLE_ON: LineLength
{
Map<MavenProject, List<Dependency>> result = new HashMap<MavenProject, List<Dependency>>();
for ( MavenProject mavenProject : sortedProjects )
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java Fri Oct 24 21:23:01 2014
@@ -40,19 +40,17 @@ public class RequireActiveProfile
/** Comma separated list of profiles to check.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setProfiles(String)}
* @see {@link #getProfiles()}
*/
- public String profiles = null;
+ private String profiles = null;
/** If all profiles must be active. If false, only one must be active
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setAll(boolean)}
* @see {@link #isAll()}
*/
- public boolean all = true;
+ private boolean all = true;
public final String getProfiles()
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java Fri Oct 24 21:23:01 2014
@@ -34,12 +34,11 @@ public class RequireEnvironmentVariable
/**
* Specify the required variable.
*/
- public String variableName = null;
+ private String variableName = null;
/**
* @param variableName the variable name
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setVariableName(String)}
* @see {@link #getVariableName()}
*/
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java Fri Oct 24 21:23:01 2014
@@ -38,8 +38,10 @@ public class RequireFilesSize
extends AbstractRequireFiles
{
+ private static final long MAXSIZE = 10000;
+
/** the max size allowed. */
- private long maxsize = 10000;
+ private long maxsize = MAXSIZE;
/** the min size allowed. */
private long minsize = 0;
@@ -50,10 +52,8 @@ public class RequireFilesSize
/** The log. */
private Log log;
- /*
- * (non-Javadoc)
- * @see
- * org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)
+ /**
+ * {@inheritDoc}
*/
public void execute( EnforcerRuleHelper helper )
throws EnforcerRuleException
@@ -66,7 +66,7 @@ public class RequireFilesSize
try
{
MavenProject project = (MavenProject) helper.evaluate( "${project}" );
- setFiles( new File[1]);
+ setFiles( new File[1] );
getFiles()[0] = project.getArtifact().getFile();
super.execute( helper );
@@ -83,28 +83,24 @@ public class RequireFilesSize
}
- /*
- * (non-Javadoc)
- * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable()
+ /**
+ * {@inheritDoc}
*/
public boolean isCacheable()
{
return false;
}
- /*
- * (non-Javadoc)
- * @see
- * org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule)
+ /**
+ * {@inheritDoc}
*/
public boolean isResultValid( EnforcerRule cachedRule )
{
return false;
}
- /*
- * (non-Javadoc)
- * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#checkFile(java.io.File)
+ /**
+ * {@inheritDoc}
*/
boolean checkFile( File file )
{
@@ -148,9 +144,8 @@ public class RequireFilesSize
}
}
- /*
- * (non-Javadoc)
- * @see org.apache.maven.plugins.enforcer.AbstractRequireFiles#getErrorMsg()
+ /**
+ * {@inheritDoc}
*/
String getErrorMsg()
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java Fri Oct 24 21:23:01 2014
@@ -48,50 +48,44 @@ public class RequireNoRepositories
/**
* Whether to ban non-plugin repositories. By default they are banned.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setBanRepositories(boolean)}
*/
- public boolean banRepositories = true;
+ private boolean banRepositories = true;
/**
* Whether to ban plugin repositories. By default they are banned.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setBanPluginRepositories(boolean)}
*/
- public boolean banPluginRepositories = true;
+ private boolean banPluginRepositories = true;
/**
* Specify explicitly allowed non-plugin repositories. This is a list of ids.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setAllowedRepositories(List)}
*/
- public List<String> allowedRepositories = Collections.emptyList();
+ private List<String> allowedRepositories = Collections.emptyList();
/**
* Specify explicitly allowed plugin repositories. This is a list of ids.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setAllowedPluginRepositories(List)}
*/
- public List<String> allowedPluginRepositories = Collections.emptyList();
+ private List<String> allowedPluginRepositories = Collections.emptyList();
/**
* Whether to allow repositories which only resolve snapshots. By default they are banned.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setAllowSnapshotRepositories(boolean)}
*/
- public boolean allowSnapshotRepositories = false;
+ private boolean allowSnapshotRepositories = false;
/**
* Whether to allow plugin repositories which only resolve snapshots. By default they are banned.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setAllowSnapshotPluginRepositories(boolean)}
*/
- public boolean allowSnapshotPluginRepositories = false;
+ private boolean allowSnapshotPluginRepositories = false;
public final void setBanRepositories( boolean banRepositories )
{
@@ -123,10 +117,8 @@ public class RequireNoRepositories
this.allowSnapshotPluginRepositories = allowSnapshotPluginRepositories;
}
- /*
- * (non-Javadoc)
- * @see
- * org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)
+ /**
+ * {@inheritDoc}
*/
public void execute( EnforcerRuleHelper helper )
throws EnforcerRuleException
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java Fri Oct 24 21:23:01 2014
@@ -59,47 +59,42 @@ public class RequireOS
* <li>os/400</li>
* </ul>
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setFamily(String)}
* @see {@link #getFamily()}
*/
- public String family = null;
+ private String family = null;
/**
* The OS name desired.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setName(String)}
* @see {@link #getName()}
*/
- public String name = null;
+ private String name = null;
/**
* The OS version desired.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setVersion(String)}
* @see {@link #getVersion()}
*/
- public String version = null;
+ private String version = null;
/**
* The OS architecture desired.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setArch(String)}
* @see {@link #getArch()}
*/
- public String arch = null;
+ private String arch = null;
/**
* Display detected OS information.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setDisplay(boolean)}
* @see {@link #isDisplay()}
*/
- public boolean display = false;
+ private boolean display = false;
/**
* Instantiates a new RequireOS.
@@ -109,10 +104,8 @@ public class RequireOS
}
- /*
- * (non-Javadoc)
- * @see
- * org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)
+ /**
+ * {@inheritDoc}
*/
public void execute( EnforcerRuleHelper helper )
throws EnforcerRuleException
@@ -122,8 +115,9 @@ public class RequireOS
if ( allParamsEmpty() )
{
- throw new EnforcerRuleException(
- "All parameters can not be empty. You must pick at least one of (family, name, version, arch) or use -Denforcer.os.display=true to see the current OS information." );
+ throw new EnforcerRuleException( "All parameters can not be empty. "
+ + "You must pick at least one of (family, name, version, arch) "
+ + "or use -Denforcer.os.display=true to see the current OS information." );
}
if ( isValidFamily( this.family ) )
@@ -133,19 +127,25 @@ public class RequireOS
String message = getMessage();
if ( StringUtils.isEmpty( message ) )
{
+ //@formatter:off
message =
- ( "OS Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: "
+ ( "OS Arch: "
+ + Os.OS_ARCH + " Family: "
+ + Os.OS_FAMILY + " Name: "
+ + Os.OS_NAME + " Version: "
+ Os.OS_VERSION + " is not allowed by" + ( arch != null ? " Arch=" + arch : "" )
- + ( family != null ? " Family=" + family : "" ) + ( name != null ? " Name=" + name : "" ) + ( version != null ? " Version="
- + version
- : "" ) );
+ + ( family != null ? " Family=" + family : "" )
+ + ( name != null ? " Name=" + name : "" )
+ + ( version != null ? " Version=" + version : "" ) );
+ //@formatter:on
}
throw new EnforcerRuleException( message );
}
}
else
{
- StringBuilder buffer = new StringBuilder( 50 );
+ final int minimumBufferSize = 50;
+ StringBuilder buffer = new StringBuilder( minimumBufferSize );
Iterator<?> iter = Os.getValidFamilies().iterator();
while ( iter.hasNext() )
{
@@ -199,8 +199,9 @@ public class RequireOS
*/
public boolean allParamsEmpty()
{
+ // CHECKSTYLE_OFF: LineLength
return ( StringUtils.isEmpty( family ) && StringUtils.isEmpty( arch ) && StringUtils.isEmpty( name ) && StringUtils.isEmpty( version ) );
-
+ // CHECKSTYLE_ON: LineLength
}
/**
@@ -353,6 +354,9 @@ public class RequireOS
this.version = theVersion;
}
+ /**
+ * @param display The value for the display.
+ */
public final void setDisplay( boolean display )
{
this.display = display;
@@ -363,9 +367,8 @@ public class RequireOS
return display;
}
- /*
- * (non-Javadoc)
- * @see org.apache.maven.enforcer.rule.api.EnforcerRule#getCacheId()
+ /**
+ * {@inheritDoc}
*/
public String getCacheId()
{
@@ -390,9 +393,8 @@ public class RequireOS
return b.toString();
}
- /*
- * (non-Javadoc)
- * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable()
+ /**
+ * {@inheritDoc}
*/
public boolean isCacheable()
{
@@ -400,10 +402,8 @@ public class RequireOS
return true;
}
- /*
- * (non-Javadoc)
- * @see
- * org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule)
+ /**
+ * {@inheritDoc}
*/
public boolean isResultValid( EnforcerRule theCachedRule )
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java Fri Oct 24 21:23:01 2014
@@ -87,80 +87,72 @@ public class RequirePluginVersions
/**
* Don't allow the LATEST identifier.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setBanLatest(boolean)}
* @see {@link #isBanLatest()}
*/
- public boolean banLatest = true;
+ private boolean banLatest = true;
/**
* Don't allow the RELEASE identifier.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setBanRelease(boolean)}
* @see {@link #isBanRelease()}
*/
- public boolean banRelease = true;
+ private boolean banRelease = true;
/**
* Don't allow snapshot plugins.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setBanSnapshots(boolean)}
* @see {@link #isBanSnapshots()}
*/
- public boolean banSnapshots = true;
+ private boolean banSnapshots = true;
/**
* Don't allow timestamp snapshot plugins.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setBanTimestamps(boolean)}
* @see {@link #isBanTimestamps()}
*/
- public boolean banTimestamps = true;
+ private boolean banTimestamps = true;
/**
* The comma separated list of phases that should be used to find lifecycle plugin bindings. The default value is
* "clean,deploy,site".
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setPhases(String)}
* @see {@link #getPhases()}
*/
- public String phases = "clean,deploy,site";
+ private String phases = "clean,deploy,site";
/**
* Additional plugins to enforce have versions. These are plugins that may not be in the poms but are used anyway,
* like help, eclipse etc. <br>
* The plugins should be specified in the form: <code>group:artifactId</code>.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setAdditionalPlugins(List)}
* @see {@link #getAdditionalPlugins()}
*/
- public List<String> additionalPlugins;
+ private List<String> additionalPlugins;
/**
* Plugins to skip for version enforcement. The plugins should be specified in the form:
* <code>group:artifactId</code>. NOTE: This is deprecated, use unCheckedPluginList instead.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setUnCheckedPlugins(List)}
* @see {@link #getUnCheckedPlugins()}
*/
- public List unCheckedPlugins;
+ private List unCheckedPlugins;
/**
* Same as unCheckedPlugins but as a comma list to better support properties. Sample form:
* <code>group:artifactId,group2:artifactId2</code>
*
* @since 1.0-beta-1
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setUnCheckedPlugins(List)}
* @see {@link #getUnCheckedPlugins()}
*/
- public String unCheckedPluginList;
+ private String unCheckedPluginList;
/** The plugin manager. */
private PluginManager pluginManager;
@@ -404,7 +396,9 @@ public class RequirePluginVersions
* @param uncheckedPluginsList
* @return
*/
+ // CHECKSTYLE_OFF: LineLength
public Collection<String> combineUncheckedPlugins( Collection<String> uncheckedPlugins, String uncheckedPluginsList )
+ // CHECKSTYLE_ON: LineLength
{
// if the comma list is empty, then there's nothing to do here.
if ( StringUtils.isNotEmpty( uncheckedPluginsList ) )
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java Fri Oct 24 21:23:01 2014
@@ -87,8 +87,10 @@ public class RequirePrerequisite
if ( packagings != null && !packagings.contains( project.getPackaging() ) )
{
+ // CHECKSTYLE_OFF: LineLength
helper.getLog().debug( "Packaging is " + project.getPackaging() + ", skipping requirePrerequisite rule" );
return;
+ // CHECKSTYLE_ON: LineLength
}
Prerequisites prerequisites = project.getPrerequisites();
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java Fri Oct 24 21:23:01 2014
@@ -32,15 +32,14 @@ public class RequireProperty
extends AbstractPropertyEnforcerRule
{
- /** Specify the required property.
+ /**
+ * Specify the required property.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setProperty(String)}
* @see {@link #getPropertyName()}
*/
- public String property = null;
-
-
+ private String property = null;
+
public final void setProperty( String property )
{
this.property = property;
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java Fri Oct 24 21:23:01 2014
@@ -48,43 +48,39 @@ public class RequireReleaseDeps
*
* @parameter
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setOnlyWhenRelease(boolean)}
* @see {@link #isOnlyWhenRelease()}
*/
- public boolean onlyWhenRelease = false;
+ private boolean onlyWhenRelease = false;
/**
* Allows this rule to fail when the parent is defined as a snapshot.
*
* @parameter
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setFailWhenParentIsSnapshot(boolean)}
* @see {@link #isFailWhenParentIsSnapshot()}
*/
- public boolean failWhenParentIsSnapshot = true;
+ private boolean failWhenParentIsSnapshot = true;
/**
* Dependencies to ignore when checking for release versions. For example, inter-module dependencies
* can be excluded from the check and therefore allowed to contain snapshot versions.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setExcludes(List)}
* @see {@link #getExcludes()}
*/
- public List<String> excludes = null;
+ private List<String> excludes = null;
/**
* Dependencies to include when checking for release versions. If any of the included dependencies
* have snapshot versions, the rule will fail.
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setIncludes(List)}
* @see {@link #getIncludes()}
*/
- public List<String> includes = null;
+ private List<String> includes = null;
/**
* Override parent to allow optional ignore of this rule.
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java Fri Oct 24 21:23:01 2014
@@ -39,11 +39,10 @@ public class RequireReleaseVersion
*
* @parameter
*
- * @deprecated the visibility will be reduced to private with the next major version
* @see {@link #setFailWhenParentIsSnapshot(boolean)}
* @see {@link #isFailWhenParentIsSnapshot()}
*/
- public boolean failWhenParentIsSnapshot = true;
+ private boolean failWhenParentIsSnapshot = true;
/*
* (non-Javadoc)
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java Fri Oct 24 21:23:01 2014
@@ -73,9 +73,11 @@ public class RequireSameVersions
Set<String> reportPluginSet = new HashSet<String>( reportPlugins );
reportPluginSet.addAll( plugins );
+ // CHECKSTYLE_OFF: LineLength
versionMembers.putAll( collectVersionMembers( project.getArtifacts(), dependencies, " (dependency)" ) );
versionMembers.putAll( collectVersionMembers( project.getPluginArtifacts(), buildPlugins, " (buildPlugin)" ) );
versionMembers.putAll( collectVersionMembers( project.getReportArtifacts(), reportPlugins, " (reportPlugin)" ) );
+ // CHECKSTYLE_ON: LineLength
if ( versionMembers.size() > 1 )
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java Fri Oct 24 21:23:01 2014
@@ -75,6 +75,7 @@ public class RequireUpperBoundDeps
this.uniqueVersions = uniqueVersions;
}
+ // CHECKSTYLE_OFF: LineLength
/**
* Uses the {@link EnforcerRuleHelper} to populate the values of the
* {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
@@ -85,6 +86,7 @@ public class RequireUpperBoundDeps
* @return a Dependency Node which is the root of the project's dependency tree
* @throws EnforcerRuleException when the build should fail
*/
+ // CHECKSTYLE_ON: LineLength
private DependencyNode getNode( EnforcerRuleHelper helper )
throws EnforcerRuleException
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java Fri Oct 24 21:23:01 2014
@@ -36,6 +36,9 @@ import java.util.LinkedList;
public final class ArtifactMatcher
{
+ /**
+ * @author I don't know
+ */
public static class Pattern
{
private String pattern;
@@ -109,9 +112,11 @@ public final class ArtifactMatcher
case 3:
if ( !matches( parts[2], artifact.getVersion() ) )
{
+ // CHECKSTYLE_OFF: LineLength
if ( !AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( parts[2] ),
new DefaultArtifactVersion(
artifact.getVersion() ) ) )
+ // CHECKSTYLE_ON: LineLength
{
return false;
}
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java Fri Oct 24 21:23:01 2014
@@ -29,6 +29,10 @@ import org.apache.maven.plugin.logging.L
import org.apache.maven.shared.dependency.tree.DependencyNode;
import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;
+/**
+ * @author Brian Fox
+ *
+ */
public class DependencyVersionMap
implements DependencyNodeVisitor
{
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DistributionManagementCheck.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DistributionManagementCheck.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DistributionManagementCheck.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DistributionManagementCheck.java Fri Oct 24 21:23:01 2014
@@ -23,6 +23,10 @@ import org.apache.maven.enforcer.rule.ap
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.project.MavenProject;
+/**
+ * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
+ *
+ */
public class DistributionManagementCheck
{
private DistributionManagement distributionManagement;
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java Fri Oct 24 21:23:01 2014
@@ -252,7 +252,10 @@ public class EnforcerRuleUtils
parentPom = new File( parentPom, "pom.xml" );
}
- models = getModelsRecursively( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parentPom );
+ //@formatter:off
+ models = getModelsRecursively( parent.getGroupId(), parent.getArtifactId(),
+ parent.getVersion(), parentPom );
+ //@formatter:on
}
else
{
@@ -317,8 +320,10 @@ public class EnforcerRuleUtils
{
// as above
}
+ // CHECKSTYLE_OFF: LineLength
return ( StringUtils.equals( groupId, modelGroup ) && StringUtils.equals( version, modelVersion ) && StringUtils.equals( artifactId,
modelArtifactId ) );
+ // CHECKSTYLE_ON: LineLength
}
private void resolve( Plugin plugin )
Modified: maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java (original)
+++ maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java Fri Oct 24 21:23:01 2014
@@ -25,6 +25,10 @@ import java.util.List;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.ReportPlugin;
+/**
+ * @author Brian Fox
+ *
+ */
public class PluginWrapper
{
private String groupId;
Modified: maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/AbstractEnforceMojo.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/AbstractEnforceMojo.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/AbstractEnforceMojo.java (original)
+++ maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/AbstractEnforceMojo.java Fri Oct 24 21:23:01 2014
@@ -51,50 +51,58 @@ public abstract class AbstractEnforceMoj
* This is a static variable used to persist the cached results across plugin invocations.
*/
protected static Hashtable<String, EnforcerRule> cache = new Hashtable<String, EnforcerRule>();
+
/**
* Path Translator needed by the ExpressionEvaluator
*/
- @Component(role = PathTranslator.class)
+ @Component( role = PathTranslator.class )
protected PathTranslator translator;
+
/**
* The MavenSession
*/
@Parameter( defaultValue = "${session}", readonly = true, required = true )
protected MavenSession session;
+
/**
* POM
*/
@Parameter( defaultValue = "${project}", readonly = true, required = true )
protected MavenProject project;
+
/**
* Flag to easily skip all checks
*/
- @Parameter(property = "enforcer.skip", defaultValue = "false")
+ @Parameter( property = "enforcer.skip", defaultValue = "false" )
protected boolean skip = false;
+
/**
- * Use this flag to disable rule result caching. This will cause
- * all rules to execute on each project even if the rule indicates it can
- * safely be cached.
+ * Use this flag to disable rule result caching. This will cause all rules to execute on each project even if the
+ * rule indicates it can safely be cached.
*/
- @Parameter(property = "enforcer.ignoreCache", defaultValue = "false")
+ @Parameter( property = "enforcer.ignoreCache", defaultValue = "false" )
protected boolean ignoreCache = false;
+
// set by the contextualize method. Only way to get the
// plugin's container in 2.0.x
protected PlexusContainer container;
- public void contextualize(Context context) throws ContextException {
- container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
+ public void contextualize( Context context )
+ throws ContextException
+ {
+ container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
/**
* Entry point to the mojo
+ *
* @throws MojoExecutionException
*/
- public void execute() throws MojoExecutionException
+ public void execute()
+ throws MojoExecutionException
{
Log log = this.getLog();
- EnforcerExpressionEvaluator evaluator = new EnforcerExpressionEvaluator(
- session , translator , project );
+ EnforcerExpressionEvaluator evaluator = new EnforcerExpressionEvaluator( session, translator, project );
// the entire execution can be easily skipped
if ( !skip )
{
@@ -105,8 +113,7 @@ public abstract class AbstractEnforceMoj
{
String currentRule = "Unknown";
// create my helper
- EnforcerRuleHelper helper = new DefaultEnforcementRuleHelper(
- session , evaluator , log , container );
+ EnforcerRuleHelper helper = new DefaultEnforcementRuleHelper( session, evaluator, log, container );
// if we are only warning, then disable
// failFast
if ( !isFail() )
@@ -129,7 +136,7 @@ public abstract class AbstractEnforceMoj
if ( ignoreCache || shouldExecute( rule ) )
{
// execute the rule
- //noinspection SynchronizationOnLocalVariableOrMethodParameter
+ // noinspection SynchronizationOnLocalVariableOrMethodParameter
synchronized ( rule )
{
rule.execute( helper );
@@ -143,15 +150,13 @@ public abstract class AbstractEnforceMoj
// false if fail is false.
if ( isFailFast() )
{
- throw new MojoExecutionException(
- currentRule + " failed with message:\n"
- + e.getMessage() , e );
+ throw new MojoExecutionException( currentRule + " failed with message:\n"
+ + e.getMessage(), e );
}
else
{
- list.add( createRuleMessage( i , currentRule , e ));
- log.debug( "Adding failure due to exception" ,
- e );
+ list.add( createRuleMessage( i, currentRule, e ) );
+ log.debug( "Adding failure due to exception", e );
}
}
}
@@ -165,15 +170,19 @@ public abstract class AbstractEnforceMoj
}
if ( isFail() )
{
+ // CHECKSTYLE_OFF: LineLength
throw new MojoExecutionException(
- "Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed." );
+ "Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed." );
+ // CHECKSTYLE_ON: LineLength
}
}
}
else
{
+ // CHECKSTYLE_OFF: LineLength
throw new MojoExecutionException(
- "No rules are configured. Use the skip flag if you want to disable execution." );
+ "No rules are configured. Use the skip flag if you want to disable execution." );
+ // CHECKSTYLE_ON: LineLength
}
}
else
@@ -183,8 +192,7 @@ public abstract class AbstractEnforceMoj
}
/**
- * This method determines if a rule should execute based
- * on the cache
+ * This method determines if a rule should execute based on the cache
*
* @param rule the rule to verify
* @return {@code true} if rule should be executed, otherwise {@code false}
@@ -201,14 +209,12 @@ public abstract class AbstractEnforceMoj
log.debug( "Key " + key + " was found in the cache" );
if ( rule.isResultValid( (EnforcerRule) cache.get( key ) ) )
{
- log.debug(
- "The cached results are still valid. Skipping the rule: "
- + rule.getClass().getName() );
+ log.debug( "The cached results are still valid. Skipping the rule: " + rule.getClass().getName() );
return false;
}
}
- //add it to the cache of executed rules
- EnforceMojo.cache.put( key , rule );
+ // add it to the cache of executed rules
+ EnforceMojo.cache.put( key, rule );
}
return true;
}
@@ -231,14 +237,16 @@ public abstract class AbstractEnforceMoj
/**
* @return the skip
*/
- public boolean isSkip() {
+ public boolean isSkip()
+ {
return this.skip;
}
/**
* @param theSkip the skip to set
*/
- public void setSkip(boolean theSkip) {
+ public void setSkip( boolean theSkip )
+ {
this.skip = theSkip;
}
@@ -255,42 +263,48 @@ public abstract class AbstractEnforceMoj
/**
* @return the project
*/
- public MavenProject getProject() {
+ public MavenProject getProject()
+ {
return this.project;
}
/**
* @param theProject the project to set
*/
- public void setProject(MavenProject theProject) {
+ public void setProject( MavenProject theProject )
+ {
this.project = theProject;
}
/**
* @return the session
*/
- public MavenSession getSession() {
+ public MavenSession getSession()
+ {
return this.session;
}
/**
* @param theSession the session to set
*/
- public void setSession(MavenSession theSession) {
+ public void setSession( MavenSession theSession )
+ {
this.session = theSession;
}
/**
* @return the translator
*/
- public PathTranslator getTranslator() {
+ public PathTranslator getTranslator()
+ {
return this.translator;
}
/**
* @param theTranslator the translator to set
*/
- public void setTranslator(PathTranslator theTranslator) {
+ public void setTranslator( PathTranslator theTranslator )
+ {
this.translator = theTranslator;
}
@@ -302,5 +316,5 @@ public abstract class AbstractEnforceMoj
* @param e rule exception
* @return rule message
*/
- protected abstract String createRuleMessage( int i , String currentRule , EnforcerRuleException e );
+ protected abstract String createRuleMessage( int i, String currentRule, EnforcerRuleException e );
}
Modified: maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java (original)
+++ maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java Fri Oct 24 21:23:01 2014
@@ -40,8 +40,7 @@ import org.codehaus.plexus.context.Conte
import org.codehaus.plexus.context.ContextException;
/**
- * This goal executes the defined enforcer-rules once per
- * module.
+ * This goal executes the defined enforcer-rules once per module.
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
@@ -53,26 +52,24 @@ public class EnforceMojo
/**
* Flag to fail the build if a version check fails.
*/
- @Parameter(property = "enforcer.fail", defaultValue = "true")
+ @Parameter( property = "enforcer.fail", defaultValue = "true" )
private boolean fail = true;
/**
* Fail on the first rule that doesn't pass
*/
- @Parameter(property = "enforcer.failFast", defaultValue = "false")
+ @Parameter( property = "enforcer.failFast", defaultValue = "false" )
private boolean failFast = false;
/**
- * Array of objects that implement the EnforcerRule
- * interface to execute.
+ * Array of objects that implement the EnforcerRule interface to execute.
*/
@Parameter( required = true )
private EnforcerRule[] rules;
/**
- * Use this flag to disable rule result caching. This will cause
- * all rules to execute on each project even if the rule indicates it can
- * safely be cached.
+ * Use this flag to disable rule result caching. This will cause all rules to execute on each project even if the
+ * rule indicates it can safely be cached.
*/
@Parameter( property = "enforcer.ignoreCache", defaultValue = "false" )
protected boolean ignoreCache = false;
@@ -82,12 +79,11 @@ public class EnforceMojo
*/
protected static Hashtable<String, EnforcerRule> cache = new Hashtable<String, EnforcerRule>();
-
// set by the contextualize method. Only way to get the
// plugin's container in 2.0.x
protected PlexusContainer container;
- public void contextualize ( Context context )
+ public void contextualize( Context context )
throws ContextException
{
container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
@@ -95,9 +91,10 @@ public class EnforceMojo
/**
* Entry point to the mojo
+ *
* @throws MojoExecutionException
*/
- public void execute ()
+ public void execute()
throws MojoExecutionException
{
Log log = this.getLog();
@@ -145,10 +142,10 @@ public class EnforceMojo
if ( ignoreCache || shouldExecute( rule ) )
{
// execute the rule
- //noinspection SynchronizationOnLocalVariableOrMethodParameter
+ // noinspection SynchronizationOnLocalVariableOrMethodParameter
synchronized ( rule )
{
- rule.execute( helper );
+ rule.execute( helper );
}
}
}
@@ -167,13 +164,15 @@ public class EnforceMojo
if ( level == EnforcerLevel.ERROR )
{
hasErrors = true;
- list.add( "Rule " + i + ": " + currentRule + " failed with message:\n" + e.getMessage() );
- log.debug( "Adding failure due to exception" , e );
+ list.add( "Rule " + i + ": " + currentRule + " failed with message:\n"
+ + e.getMessage() );
+ log.debug( "Adding failure due to exception", e );
}
else
{
- list.add( "Rule " + i + ": " + currentRule + " warned with message:\n" + e.getMessage() );
- log.debug( "Adding warning due to exception" , e );
+ list.add( "Rule " + i + ": " + currentRule + " warned with message:\n"
+ + e.getMessage() );
+ log.debug( "Adding warning due to exception", e );
}
}
}
@@ -183,21 +182,25 @@ public class EnforceMojo
// if we found anything
if ( !list.isEmpty() )
{
- for ( String failure : list )
+ for ( String failure : list )
{
log.warn( failure );
}
if ( fail && hasErrors )
{
+ // CHECKSTYLE_OFF: LineLength
throw new MojoExecutionException(
"Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed." );
+ // CHECKSTYLE_ON: LineLength
}
}
}
else
{
+ // CHECKSTYLE_OFF: LineLength
throw new MojoExecutionException(
"No rules are configured. Use the skip flag if you want to disable execution." );
+ // CHECKSTYLE_ON: LineLength
}
}
else
@@ -207,13 +210,12 @@ public class EnforceMojo
}
/**
- * This method determines if a rule should execute based
- * on the cache
+ * This method determines if a rule should execute based on the cache
*
* @param rule the rule to verify
* @return {@code true} if rule should be executed, otherwise {@code false}
*/
- protected boolean shouldExecute ( EnforcerRule rule )
+ protected boolean shouldExecute( EnforcerRule rule )
{
if ( rule.isCacheable() )
{
@@ -230,7 +232,7 @@ public class EnforceMojo
}
}
- //add it to the cache of executed rules
+ // add it to the cache of executed rules
EnforceMojo.cache.put( key, rule );
}
return true;
@@ -239,7 +241,7 @@ public class EnforceMojo
/**
* @return the fail
*/
- public boolean isFail ()
+ public boolean isFail()
{
return this.fail;
}
@@ -247,7 +249,7 @@ public class EnforceMojo
/**
* @param theFail the fail to set
*/
- public void setFail ( boolean theFail )
+ public void setFail( boolean theFail )
{
this.fail = theFail;
}
@@ -256,7 +258,7 @@ public class EnforceMojo
* @return the rules
*/
@Override
- public EnforcerRule[] getRules ()
+ public EnforcerRule[] getRules()
{
return this.rules;
}
@@ -265,7 +267,7 @@ public class EnforceMojo
* @param theRules the rules to set
*/
@Override
- public void setRules ( EnforcerRule[] theRules )
+ public void setRules( EnforcerRule[] theRules )
{
this.rules = theRules;
}
@@ -274,19 +276,19 @@ public class EnforceMojo
* @param theFailFast the failFast to set
*/
@Override
- public void setFailFast ( boolean theFailFast )
+ public void setFailFast( boolean theFailFast )
{
this.failFast = theFailFast;
}
@Override
- public boolean isFailFast() {
+ public boolean isFailFast()
+ {
return failFast;
}
-
@Override
- protected String createRuleMessage( int i , String currentRule , EnforcerRuleException e )
+ protected String createRuleMessage( int i, String currentRule, EnforcerRuleException e )
{
return "Rule " + i + ": " + currentRule + " failed with message:\n" + e.getMessage();
}
@@ -294,14 +296,13 @@ public class EnforceMojo
/**
* @param theTranslator the translator to set
*/
- public void setTranslator ( PathTranslator theTranslator )
+ public void setTranslator( PathTranslator theTranslator )
{
this.translator = theTranslator;
}
/**
- * Returns the level of the rule, defaults to {@link EnforcerLevel#ERROR}
- * for backwards compatibility.
+ * Returns the level of the rule, defaults to {@link EnforcerLevel#ERROR} for backwards compatibility.
*
* @param rule might be of type {@link EnforcerRule2}.
* @return level of the rule.
Modified: maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceOnceMojo.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceOnceMojo.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceOnceMojo.java (original)
+++ maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceOnceMojo.java Fri Oct 24 21:23:01 2014
@@ -24,6 +24,7 @@ import org.apache.maven.plugins.annotati
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
+// CHECKSTYLE_OFF: LineLength
/**
* This goal has been deprecated.
*
@@ -31,8 +32,7 @@ import org.apache.maven.plugins.annotati
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
*/
-@Mojo( name = "enforce-once", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true,
- requiresDependencyResolution = ResolutionScope.TEST )
+@Mojo( name = "enforce-once", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST )
public class EnforceOnceMojo
extends EnforceMojo
{
@@ -43,3 +43,4 @@ public class EnforceOnceMojo
super.execute();
}
}
+// CHECKSTYLE_ON: LineLength
Modified: maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/RecommendMojo.java
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/RecommendMojo.java?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/RecommendMojo.java (original)
+++ maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/RecommendMojo.java Fri Oct 24 21:23:01 2014
@@ -19,7 +19,6 @@ package org.apache.maven.plugins.enforce
* under the License.
*/
-
import org.apache.maven.enforcer.rule.api.EnforcerRule;
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
@@ -27,9 +26,8 @@ import org.apache.maven.plugins.annotati
import org.apache.maven.plugins.annotations.Parameter;
/**
- * This goal executes the defined enforcer-recommendations once per
- * module. In contrast to {@link EnforceMojo} it will never fail the
- * build, i.e. it will only warn.
+ * This goal executes the defined enforcer-recommendations once per module. In contrast to {@link EnforceMojo} it will
+ * never fail the build, i.e. it will only warn.
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @author Mirko Friedenhagen
@@ -41,8 +39,7 @@ public class RecommendMojo
{
/**
- * Array of objects that implement the EnforcerRule
- * interface to execute.
+ * Array of objects that implement the EnforcerRule interface to execute.
*/
@Parameter( required = true )
private EnforcerRule[] recommendations;
@@ -51,7 +48,7 @@ public class RecommendMojo
* @return the recommendedRules
*/
@Override
- public EnforcerRule[] getRules ()
+ public EnforcerRule[] getRules()
{
return this.recommendations;
}
@@ -60,7 +57,7 @@ public class RecommendMojo
* @param theRules the recommendedRules to set
*/
@Override
- public void setRules ( EnforcerRule[] theRules )
+ public void setRules( EnforcerRule[] theRules )
{
this.recommendations = theRules;
}
@@ -69,31 +66,35 @@ public class RecommendMojo
* @param theFailFast the failFast to set
*/
@Override
- public void setFailFast ( boolean theFailFast )
+ public void setFailFast( boolean theFailFast )
{
// intentionally blank
}
/**
* Always return false, as this Mojo should never fail the build.
+ *
* @return false
*/
@Override
- public boolean isFail() {
+ public boolean isFail()
+ {
return false;
}
/**
* Always return false, as this Mojo should never fail the build.
+ *
* @return false
*/
@Override
- public boolean isFailFast() {
+ public boolean isFailFast()
+ {
return false;
}
@Override
- protected String createRuleMessage( int i , String currentRule , EnforcerRuleException e )
+ protected String createRuleMessage( int i, String currentRule, EnforcerRuleException e )
{
return "Recommendation " + i + ": " + currentRule + " failed with message:\n" + e.getMessage();
}
Modified: maven/enforcer/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/enforcer/trunk/pom.xml?rev=1634140&r1=1634139&r2=1634140&view=diff
==============================================================================
--- maven/enforcer/trunk/pom.xml (original)
+++ maven/enforcer/trunk/pom.xml Fri Oct 24 21:23:01 2014
@@ -23,7 +23,7 @@
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.apache.maven</groupId>
- <version>24</version>
+ <version>25</version>
<relativePath>../pom/maven/pom.xml</relativePath>
</parent>
<groupId>org.apache.maven.enforcer</groupId>