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 2017/09/09 10:36:01 UTC
svn commit: r1807877 [2/4] - in
/maven/plugins/trunk/maven-dependency-plugin/src:
main/java/org/apache/maven/plugins/dependency/
main/java/org/apache/maven/plugins/dependency/analyze/
main/java/org/apache/maven/plugins/dependency/fromConfiguration/ mai...
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java Sat Sep 9 10:35:59 2017
@@ -55,8 +55,9 @@ import java.util.regex.Pattern;
* @version $Id$
* @since 2.0-alpha-2
*/
-@Mojo( name = "build-classpath", requiresDependencyResolution = ResolutionScope.TEST,
- defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true )
+// CHECKSTYLE_OFF: LineLength
+@Mojo( name = "build-classpath", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true )
+// CHECKSTYLE_ON: LineLength
public class BuildClasspathMojo
extends AbstractDependencyFilterMojo
implements Comparator<Artifact>
@@ -73,7 +74,7 @@ public class BuildClasspathMojo
*/
@Parameter( property = "mdep.stripClassifier", defaultValue = "false" )
private boolean stripClassifier = false;
-
+
/**
* The prefix to prepend on each dependent artifact. If undefined, the paths refer to the actual files store in the
* local repository (the stripVersion parameter does nothing then).
@@ -86,7 +87,7 @@ public class BuildClasspathMojo
*/
@Parameter( property = "mdep.outputProperty" )
private String outputProperty;
-
+
/**
* The file to write the classpath string. If undefined, it just prints the classpath as [INFO].
*/
@@ -146,8 +147,9 @@ public class BuildClasspathMojo
private boolean outputFilterFile;
/**
- * Either append the artifact's baseVersion or uniqueVersion to the filename.
- * Will only be used if {@link #isStripVersion()} is {@code false}.
+ * Either append the artifact's baseVersion or uniqueVersion to the filename. Will only be used if
+ * {@link #isStripVersion()} is {@code false}.
+ *
* @since 2.6
*/
@Parameter( property = "mdep.useBaseVersion", defaultValue = "true" )
@@ -158,9 +160,9 @@ public class BuildClasspathMojo
*/
@Component
private MavenProjectHelper projectHelper;
-
+
@Component
- private RepositoryManager repositoryManager;
+ private RepositoryManager repositoryManager;
/**
* Main entry into mojo. Gets the list of dependencies and iterates to create a classpath.
@@ -176,7 +178,7 @@ public class BuildClasspathMojo
boolean isFileSepSet = StringUtils.isNotEmpty( fileSeparator );
boolean isPathSepSet = StringUtils.isNotEmpty( pathSeparator );
- //don't allow them to have absolute paths when they attach.
+ // don't allow them to have absolute paths when they attach.
if ( attach && StringUtils.isEmpty( localRepoProperty ) )
{
localRepoProperty = "${M2_REPO}";
@@ -217,7 +219,7 @@ public class BuildClasspathMojo
cpString = cpString.replaceAll( pattern, replacement );
}
- //make the string valid for filtering
+ // make the string valid for filtering
if ( outputFilterFile )
{
cpString = "classpath=" + cpString;
@@ -265,8 +267,8 @@ public class BuildClasspathMojo
/**
* Appends the artifact path into the specified StringBuilder.
*
- * @param art
- * @param sb
+ * @param art {@link Artifact}
+ * @param sb {@link StringBuilder}
*/
protected void appendArtifactPath( Artifact art, StringBuilder sb )
{
@@ -277,7 +279,7 @@ public class BuildClasspathMojo
if ( StringUtils.isNotEmpty( localRepoProperty ) )
{
File localBasedir = repositoryManager.getLocalRepositoryBasedir( session.getProjectBuildingRequest() );
-
+
file = StringUtils.replace( file, localBasedir.getAbsolutePath(), localRepoProperty );
}
sb.append( file );
@@ -308,8 +310,8 @@ public class BuildClasspathMojo
}
catch ( Exception ex )
{
- this.getLog().warn(
- "Error while reading old classpath file '" + outputFile + "' for up-to-date check: " + ex );
+ this.getLog().warn( "Error while reading old classpath file '" + outputFile + "' for up-to-date check: "
+ + ex );
return false;
}
@@ -324,7 +326,7 @@ public class BuildClasspathMojo
private void storeClasspathFile( String cpString, File out )
throws MojoExecutionException
{
- //make sure the parent path exists.
+ // make sure the parent path exists.
out.getParentFile().mkdirs();
Writer w = null;
@@ -352,15 +354,15 @@ public class BuildClasspathMojo
* 'outputFile' is not null.
*
* @return the string contained in the classpathFile, if exists, or null otherwise.
- * @throws MojoExecutionException
+ * @throws IOException in case of an error.
*/
protected String readClasspathFile()
throws IOException
{
if ( outputFile == null )
{
- throw new IllegalArgumentException(
- "The outputFile parameter cannot be null if the file is intended to be read." );
+ throw new IllegalArgumentException( "The outputFile parameter "
+ + "cannot be null if the file is intended to be read." );
}
if ( !outputFile.isFile() )
@@ -395,9 +397,9 @@ public class BuildClasspathMojo
*
* @param art1 first object
* @param art2 second object
- * @return the value <code>0</code> if the argument string is equal to this string; a value less than
- * <code>0</code> if this string is lexicographically less than the string argument; and a value greater
- * than <code>0</code> if this string is lexicographically greater than the string argument.
+ * @return the value <code>0</code> if the argument string is equal to this string; a value less than <code>0</code>
+ * if this string is lexicographically less than the string argument; and a value greater than
+ * <code>0</code> if this string is lexicographically greater than the string argument.
*/
@Override
public int compare( Artifact art1, Artifact art2 )
@@ -434,7 +436,7 @@ public class BuildClasspathMojo
{
this.outputFile = outputFile;
}
-
+
/**
* @param theOutputProperty the outputProperty to set
*/
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java Sat Sep 9 10:35:59 2017
@@ -43,15 +43,15 @@ import java.util.Map;
import java.util.Set;
/**
- * Goal that copies the project dependencies from the repository to a defined
- * location.
+ * Goal that copies the project dependencies from the repository to a defined location.
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
* @since 1.0
*/
-@Mojo( name = "copy-dependencies", requiresDependencyResolution = ResolutionScope.TEST,
- defaultPhase = LifecyclePhase.PROCESS_SOURCES, threadSafe = true )
+//CHECKSTYLE_OFF: LineLength
+@Mojo( name = "copy-dependencies", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.PROCESS_SOURCES, threadSafe = true )
+//CHECKSTYLE_ON: LineLength
public class CopyDependenciesMojo
extends AbstractFromDependenciesMojo
{
@@ -75,10 +75,10 @@ public class CopyDependenciesMojo
@Component( role = ArtifactRepositoryLayout.class )
private Map<String, ArtifactRepositoryLayout> repositoryLayouts;
-
/**
- * Either append the artifact's baseVersion or uniqueVersion to the filename.
- * Will only be used if {@link #isStripVersion()} is {@code false}.
+ * Either append the artifact's baseVersion or uniqueVersion to the filename. Will only be used if
+ * {@link #isStripVersion()} is {@code false}.
+ *
* @since 2.6
*/
@Parameter( property = "mdep.useBaseVersion", defaultValue = "true" )
@@ -86,6 +86,7 @@ public class CopyDependenciesMojo
/**
* Add parent poms to the list of copied dependencies (both current project pom parents and dependencies parents).
+ *
* @since 2.8
*/
@Parameter( property = "mdep.addParentPoms", defaultValue = "false" )
@@ -104,8 +105,7 @@ public class CopyDependenciesMojo
protected boolean ignorePermissions;
/**
- * Main entry into mojo. Gets the list of dependencies and iterates through
- * calling copyArtifact.
+ * Main entry into mojo. Gets the list of dependencies and iterates through calling copyArtifact.
*
* @throws MojoExecutionException with a message if an error occurs.
* @see #getDependencySets(boolean, boolean)
@@ -141,14 +141,17 @@ public class CopyDependenciesMojo
Set<Artifact> skippedArtifacts = dss.getSkippedDependencies();
for ( Artifact artifact : skippedArtifacts )
{
- getLog().info( artifact.getId() + " already exists in destination." ) ;
+ getLog().info( artifact.getId() + " already exists in destination." );
}
if ( isCopyPom() && !useRepositoryLayout )
{
copyPoms( getOutputDirectory(), artifacts, this.stripVersion );
- copyPoms( getOutputDirectory(), skippedArtifacts,
- this.stripVersion, this.stripClassifier ); // Artifacts that already exist may not yet have poms
+ copyPoms( getOutputDirectory(), skippedArtifacts, this.stripVersion, this.stripClassifier ); // Artifacts
+ // that already
+ // exist may
+ // not yet have
+ // poms
}
}
@@ -187,12 +190,12 @@ public class CopyDependenciesMojo
if ( artifact.isSnapshot() && !artifact.getBaseVersion().equals( artifact.getVersion() ) )
{
String version = artifact.getVersion();
- try
+ try
{
artifact.setVersion( artifact.getBaseVersion() );
installer.install( buildingRequest, Collections.singletonList( artifact ) );
}
- finally
+ finally
{
artifact.setVersion( version );
}
@@ -200,13 +203,11 @@ public class CopyDependenciesMojo
}
/**
- * Copies the Artifact after building the destination file name if
- * overridden. This method also checks if the classifier is set and adds it
- * to the destination file name if needed.
+ * Copies the Artifact after building the destination file name if overridden. This method also checks if the
+ * classifier is set and adds it to the destination file name if needed.
*
- * @param artifact representing the object to be copied.
- * @param removeVersion specifies if the version should be removed from the file name
- * when copying.
+ * @param artifact representing the object to be copied.
+ * @param removeVersion specifies if the version should be removed from the file name when copying.
* @param prependGroupId specifies if the groupId should be prepend to the file while copying.
* @param useBaseVersion specifies if the baseVersion of the artifact should be used instead of the version.
* @throws MojoExecutionException with a message if an error occurs.
@@ -220,13 +221,11 @@ public class CopyDependenciesMojo
}
/**
- * Copies the Artifact after building the destination file name if
- * overridden. This method also checks if the classifier is set and adds it
- * to the destination file name if needed.
+ * Copies the Artifact after building the destination file name if overridden. This method also checks if the
+ * classifier is set and adds it to the destination file name if needed.
*
- * @param artifact representing the object to be copied.
- * @param removeVersion specifies if the version should be removed from the file name
- * when copying.
+ * @param artifact representing the object to be copied.
+ * @param removeVersion specifies if the version should be removed from the file name when copying.
* @param prependGroupId specifies if the groupId should be prepend to the file while copying.
* @param useBaseVersion specifies if the baseVersion of the artifact should be used instead of the version.
* @param removeClassifier specifies if the classifier should be removed from the file name when copying.
@@ -239,8 +238,8 @@ public class CopyDependenciesMojo
throws MojoExecutionException
{
- String destFileName = DependencyUtil.getFormattedFileName( artifact, removeVersion, prependGroupId,
- useBaseVersion, removeClassifier );
+ String destFileName = DependencyUtil.getFormattedFileName( artifact, removeVersion, prependGroupId,
+ useBaseVersion, removeClassifier );
File destDir;
destDir = DependencyUtil.getFormattedOutputDirectory( useSubDirectoryPerScope, useSubDirectoryPerType,
@@ -250,9 +249,14 @@ public class CopyDependenciesMojo
copyFile( artifact.getFile(), destFile );
}
-
+
/**
* Copy the pom files associated with the artifacts.
+ *
+ * @param destDir The destination directory {@link File}.
+ * @param artifacts The artifacts {@link Artifact}.
+ * @param removeVersion remove version or not.
+ * @throws MojoExecutionException in case of errors.
*/
public void copyPoms( File destDir, Set<Artifact> artifacts, boolean removeVersion )
throws MojoExecutionException
@@ -260,9 +264,15 @@ public class CopyDependenciesMojo
{
copyPoms( destDir, artifacts, removeVersion, false );
}
-
+
/**
* Copy the pom files associated with the artifacts.
+ *
+ * @param destDir The destination directory {@link File}.
+ * @param artifacts The artifacts {@link Artifact}.
+ * @param removeVersion remove version or not.
+ * @param removeClassifier remove the classifier or not.
+ * @throws MojoExecutionException in case of errors.
*/
public void copyPoms( File destDir, Set<Artifact> artifacts, boolean removeVersion, boolean removeClassifier )
throws MojoExecutionException
@@ -293,7 +303,7 @@ public class CopyDependenciesMojo
coordinate.setArtifactId( artifact.getArtifactId() );
coordinate.setVersion( artifact.getVersion() );
coordinate.setExtension( "pom" );
-
+
Artifact pomArtifact = null;
// Resolve the pom artifact using repos
try
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/UnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/UnpackDependenciesMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/UnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/UnpackDependenciesMojo.java Sat Sep 9 10:35:59 2017
@@ -34,23 +34,22 @@ import org.apache.maven.shared.artifact.
import java.io.File;
/**
- * Goal that unpacks the project dependencies from the repository to a defined
- * location.
+ * Goal that unpacks the project dependencies from the repository to a defined location.
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
* @since 1.0
*/
-@Mojo( name = "unpack-dependencies", requiresDependencyResolution = ResolutionScope.TEST,
- defaultPhase = LifecyclePhase.PROCESS_SOURCES, threadSafe = true )
+//CHECKSTYLE_OFF: LineLength
+@Mojo( name = "unpack-dependencies", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.PROCESS_SOURCES, threadSafe = true )
+//CHECKSTYLE_ON: LineLength
public class UnpackDependenciesMojo
extends AbstractFromDependenciesMojo
{
/**
- * A comma separated list of file patterns to include when unpacking the
- * artifact. i.e. <code>**/*.xml,**/*.properties</code>
- * NOTE: Excludes patterns override the includes.
- * (component code = <code>return isIncluded( name ) AND !isExcluded( name );</code>)
+ * A comma separated list of file patterns to include when unpacking the artifact. i.e.
+ * <code>**/*.xml,**/*.properties</code> NOTE: Excludes patterns override the includes. (component code =
+ * <code>return isIncluded( name ) AND !isExcluded( name );</code>)
*
* @since 2.0
*/
@@ -58,10 +57,9 @@ public class UnpackDependenciesMojo
private String includes;
/**
- * A comma separated list of file patterns to exclude when unpacking the
- * artifact. i.e. <code>**/*.xml,**/*.properties</code>
- * NOTE: Excludes patterns override the includes.
- * (component code = <code>return isIncluded( name ) AND !isExcluded( name );</code>)
+ * A comma separated list of file patterns to exclude when unpacking the artifact. i.e.
+ * <code>**/*.xml,**/*.properties</code> NOTE: Excludes patterns override the includes. (component code =
+ * <code>return isIncluded( name ) AND !isExcluded( name );</code>)
*
* @since 2.0
*/
@@ -70,14 +68,15 @@ public class UnpackDependenciesMojo
/**
* Encoding of artifacts.
+ *
* @since 3.0
*/
@Parameter( property = "mdep.unpack.encoding" )
private String encoding;
/**
- * Main entry into mojo. This method gets the dependencies and iterates
- * through each one passing it to DependencyUtil.unpackFile().
+ * Main entry into mojo. This method gets the dependencies and iterates through each one passing it to
+ * DependencyUtil.unpackFile().
*
* @throws MojoExecutionException with a message if an error occurs.
* @see #getDependencySets(boolean)
@@ -122,8 +121,7 @@ public class UnpackDependenciesMojo
}
/**
- * @param excludes A comma separated list of items to exclude
- * i.e. <code>**\/*.xml, **\/*.properties</code>
+ * @param excludes A comma separated list of items to exclude i.e. <code>**\/*.xml, **\/*.properties</code>
*/
public void setExcludes( String excludes )
{
@@ -139,8 +137,7 @@ public class UnpackDependenciesMojo
}
/**
- * @param includes A comma separated list of items to include
- * i.e. <code>**\/*.xml, **\/*.properties</code>
+ * @param includes A comma separated list of items to include i.e. <code>**\/*.xml, **\/*.properties</code>
*/
public void setIncludes( String includes )
{
@@ -154,7 +151,7 @@ public class UnpackDependenciesMojo
public void setEncoding( String encoding )
{
this.encoding = encoding;
- }
+ }
/**
* @return Returns the encoding.
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java Sat Sep 9 10:35:59 2017
@@ -57,10 +57,8 @@ public abstract class AbstractResolveMoj
/**
* This method resolves the dependency artifacts from the project.
*
- * @param theProject
- * The POM.
+ * @param theProject The POM.
* @return resolved set of dependency artifacts.
- *
* @throws ArtifactResolutionException
* @throws ArtifactNotFoundException
* @throws InvalidDependencyVersionException
@@ -75,8 +73,7 @@ public abstract class AbstractResolveMoj
protected boolean appendOutput;
/**
- * Don't resolve plugins that are in the current reactor.
- * Only works for plugins at the moment.
+ * Don't resolve plugins that are in the current reactor. Only works for plugins at the moment.
*
* @since 2.7
*/
@@ -125,9 +122,10 @@ public abstract class AbstractResolveMoj
final FilterArtifacts filter = new FilterArtifacts();
- filter.addFilter( new org.apache.maven.shared.artifact.filter.collection.ScopeFilter(
- DependencyUtil.cleanToBeTokenizedString( this.includeScope ),
- DependencyUtil.cleanToBeTokenizedString( this.excludeScope ) ) );
+ //CHECKSTYLE_OFF: LineLength
+ filter.addFilter( new org.apache.maven.shared.artifact.filter.collection.ScopeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeScope ),
+ DependencyUtil.cleanToBeTokenizedString( this.excludeScope ) ) );
+ //CHECKSTYLE_ON: LineLength
filter.addFilter( new TypeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeTypes ),
DependencyUtil.cleanToBeTokenizedString( this.excludeTypes ) ) );
@@ -149,7 +147,7 @@ public abstract class AbstractResolveMoj
*
* @param artifact the artifact used to retrieve dependencies
* @return resolved set of dependencies
- * @throws DependencyResolverException
+ * @throws DependencyResolverException in case of error while resolving artifacts.
*/
protected Set<Artifact> resolveArtifactDependencies( final DependableCoordinate artifact )
throws DependencyResolverException
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/CollectDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/CollectDependenciesMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/CollectDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/CollectDependenciesMojo.java Sat Sep 9 10:35:59 2017
@@ -24,22 +24,28 @@ import org.apache.maven.plugins.annotati
import org.apache.maven.plugins.annotations.ResolutionScope;
/**
- * Goal that collects the project dependencies from the repository.
- * This goal requires Maven 3.0 or higher to function because it uses "requiresDependencyCollection".
- * This means that it lists the groupId:artifactId:version information by downloading the pom files
- * without downloading the actual artifacts such as jar files.
+ * <p>
+ * Goal that collects the project dependencies from the repository. This goal requires Maven 3.0 or higher to function
+ * because it uses "requiresDependencyCollection". This means that it lists the groupId:artifactId:version information
+ * by downloading the pom files without downloading the actual artifacts such as jar files.
+ * </p>
+ * <p>
* This is very useful when full dependency resolution might fail due to projects which haven't been built yet.
- * <p/>
+ * </p>
+ * <p>
* It is identical to {@link ResolveDependenciesMojo} except for using the requiresDependencyCollection annotation
* attribute instead of requiresDependencyResolution.
+ * </p>
*
* @author <a href="mailto:epabst@gmail.com">Eric Pabst</a>
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
* @since 3.0
*/
-@Mojo( name = "collect", requiresDependencyCollection = ResolutionScope.TEST,
- defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true )
-public class CollectDependenciesMojo extends ResolveDependenciesMojo
+//CHECKSTYLE_OFF: LineLength
+@Mojo( name = "collect", requiresDependencyCollection = ResolutionScope.TEST, defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true )
+//CHECKSTYLE_ON: LineLength
+public class CollectDependenciesMojo
+ extends ResolveDependenciesMojo
{
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java Sat Sep 9 10:35:59 2017
@@ -30,8 +30,7 @@ import org.apache.maven.shared.artifact.
import java.util.Set;
/**
- * Goal that resolves all project dependencies, including plugins and reports
- * and their dependencies.
+ * Goal that resolves all project dependencies, including plugins and reports and their dependencies.
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
@@ -44,8 +43,7 @@ public class GoOfflineMojo
{
/**
- * Main entry into mojo. Gets the list of dependencies and iterates through
- * displaying the resolved version.
+ * Main entry into mojo. Gets the list of dependencies and iterates through displaying the resolved version.
*
* @throws MojoExecutionException with a message if an error occurs.
*/
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java Sat Sep 9 10:35:59 2017
@@ -30,8 +30,8 @@ import org.apache.maven.shared.dependenc
import org.apache.maven.shared.dependencies.collect.DependencyCollectorException;
/**
- * Goal that resolves all project dependencies and then lists the repositories
- * used by the build and by the transitive dependencies
+ * Goal that resolves all project dependencies and then lists the repositories used by the build and by the transitive
+ * dependencies
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id: GoOfflineMojo.java 728546 2008-12-21 22:56:51Z bentmann $
@@ -59,8 +59,7 @@ public class ListRepositoriesMojo
try
{
CollectorResult collectResult =
- dependencyCollector.collectDependencies( session.getProjectBuildingRequest(),
- getProject().getModel() );
+ dependencyCollector.collectDependencies( session.getProjectBuildingRequest(), getProject().getModel() );
this.getLog().info( "Repositories used by this build:" );
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java Sat Sep 9 10:35:59 2017
@@ -47,15 +47,16 @@ import java.util.jar.JarFile;
import java.util.jar.Manifest;
/**
- * Goal that resolves the project dependencies from the repository.
- * When using this goal while running on Java 9 the module names will be visible as well.
+ * Goal that resolves the project dependencies from the repository. When using this goal while running on Java 9 the
+ * module names will be visible as well.
*
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
* @since 2.0
*/
-@Mojo( name = "resolve", requiresDependencyResolution = ResolutionScope.TEST,
- defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true )
+//CHECKSTYLE_OFF: LineLength
+@Mojo( name = "resolve", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true )
+//CHECKSTYLE_ON: LineLength
public class ResolveDependenciesMojo
extends AbstractResolveMojo
{
@@ -74,8 +75,7 @@ public class ResolveDependenciesMojo
DependencyStatusSets results;
/**
- * Sort the output list of resolved artifacts alphabetically.
- * The default ordering matches the classpath order.
+ * Sort the output list of resolved artifacts alphabetically. The default ordering matches the classpath order.
*
* @since 2.8
*/
@@ -133,7 +133,7 @@ public class ResolveDependenciesMojo
{
return new ResolveFileFilter( new SourcesFileMarkerHandler( this.markersDirectory ) );
}
-
+
public String getOutput( boolean outputAbsoluteArtifactFilename, boolean outputScope, boolean sort )
{
StringBuilder sb = new StringBuilder();
@@ -155,8 +155,8 @@ public class ResolveDependenciesMojo
sb.append( "The following files were skipped:\n" );
Set<Artifact> skippedDependencies = new LinkedHashSet<Artifact>();
skippedDependencies.addAll( results.getSkippedDependencies() );
- sb.append( buildArtifactListOutput( skippedDependencies, outputAbsoluteArtifactFilename,
- outputScope, sort ) );
+ sb.append( buildArtifactListOutput( skippedDependencies, outputAbsoluteArtifactFilename, outputScope,
+ sort ) );
}
if ( results.getUnResolvedDependencies() != null && !results.getUnResolvedDependencies().isEmpty() )
@@ -165,14 +165,14 @@ public class ResolveDependenciesMojo
sb.append( "The following files have NOT been resolved:\n" );
Set<Artifact> unResolvedDependencies = new LinkedHashSet<Artifact>();
unResolvedDependencies.addAll( results.getUnResolvedDependencies() );
- sb.append( buildArtifactListOutput( unResolvedDependencies, outputAbsoluteArtifactFilename,
- outputScope, sort ) );
+ sb.append( buildArtifactListOutput( unResolvedDependencies, outputAbsoluteArtifactFilename, outputScope,
+ sort ) );
}
sb.append( "\n" );
return sb.toString();
}
-
+
private StringBuilder buildArtifactListOutput( Set<Artifact> artifacts, boolean outputAbsoluteArtifactFilename,
boolean outputScope, boolean sort )
{
@@ -181,9 +181,9 @@ public class ResolveDependenciesMojo
for ( Artifact artifact : artifacts )
{
MessageBuilder messageBuilder = MessageUtils.buffer();
-
+
messageBuilder.a( " " );
-
+
if ( outputScope )
{
messageBuilder.a( artifact.toString() );
@@ -192,14 +192,14 @@ public class ResolveDependenciesMojo
{
messageBuilder.a( artifact.getId() );
}
-
+
if ( outputAbsoluteArtifactFilename )
{
try
{
// we want to print the absolute file name here
String artifactFilename = artifact.getFile().getAbsoluteFile().getPath();
-
+
messageBuilder.a( ':' ).a( artifactFilename );
}
catch ( NullPointerException e )
@@ -246,7 +246,7 @@ public class ResolveDependenciesMojo
}
return sb;
}
-
+
private ModuleDescriptor getModuleDescriptor( File artifactFile )
{
ModuleDescriptor moduleDescriptor = null;
@@ -256,30 +256,30 @@ public class ResolveDependenciesMojo
Class<?> moduleFinderClass = Class.forName( "java.lang.module.ModuleFinder" );
java.nio.file.Path path = artifactFile.toPath();
-
+
Method ofMethod = moduleFinderClass.getMethod( "of", java.nio.file.Path[].class );
Object moduleFinderInstance = ofMethod.invoke( null, new Object[] { new java.nio.file.Path[] { path } } );
-
+
Method findAllMethod = moduleFinderClass.getMethod( "findAll" );
@SuppressWarnings( "unchecked" )
Set<Object> moduleReferences = (Set<Object>) findAllMethod.invoke( moduleFinderInstance );
-
+
// moduleReferences can be empty when referring to target/classes without module-info.class
if ( !moduleReferences.isEmpty() )
{
Object moduleReference = moduleReferences.iterator().next();
Method descriptorMethod = moduleReference.getClass().getMethod( "descriptor" );
Object moduleDescriptorInstance = descriptorMethod.invoke( moduleReference );
-
+
Method nameMethod = moduleDescriptorInstance.getClass().getMethod( "name" );
String name = (String) nameMethod.invoke( moduleDescriptorInstance );
-
+
moduleDescriptor = new ModuleDescriptor();
moduleDescriptor.name = name;
-
+
Method isAutomaticMethod = moduleDescriptorInstance.getClass().getMethod( "isAutomatic" );
moduleDescriptor.automatic = (Boolean) isAutomaticMethod.invoke( moduleDescriptorInstance );
-
+
if ( moduleDescriptor.automatic )
{
if ( artifactFile.isFile() )
@@ -288,9 +288,9 @@ public class ResolveDependenciesMojo
try
{
jarFile = new JarFile( artifactFile );
-
+
Manifest manifest = jarFile.getManifest();
-
+
if ( manifest != null
&& manifest.getMainAttributes().getValue( "Automatic-Module-Name" ) != null )
{
@@ -305,7 +305,7 @@ public class ResolveDependenciesMojo
{
// noop
}
- finally
+ finally
{
if ( jarFile != null )
{
@@ -315,7 +315,7 @@ public class ResolveDependenciesMojo
}
catch ( IOException e )
{
- // noop
+ // noop
}
}
}
@@ -354,11 +354,11 @@ public class ResolveDependenciesMojo
}
return moduleDescriptor;
}
-
+
private class ModuleDescriptor
{
String name;
-
+
boolean automatic = true;
String moduleNameSource;
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java Sat Sep 9 10:35:59 2017
@@ -32,8 +32,9 @@ import org.apache.maven.plugins.annotati
* @version $Id$
* @since 2.0-alpha2
*/
-@Mojo( name = "sources", defaultPhase = LifecyclePhase.GENERATE_SOURCES,
- requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
+//CHECKSTYLE_OFF: LineLength
+@Mojo( name = "sources", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
+//CHECKSTYLE_ON: LineLength
public class ResolveDependencySourcesMojo
extends ResolveDependenciesMojo
{
@@ -41,8 +42,7 @@ public class ResolveDependencySourcesMoj
private static final String SOURCE_CLASSIFIER = "sources";
/**
- * Main entry into mojo. Gets the list of dependencies and iterates through
- * resolving the source jars.
+ * Main entry into mojo. Gets the list of dependencies and iterates through resolving the source jars.
*
* @throws MojoExecutionException with a message if an error occurs.
*/
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java Sat Sep 9 10:35:59 2017
@@ -59,8 +59,7 @@ public class ResolvePluginsMojo
private List<ArtifactRepository> remotePluginRepositories;
/**
- * Main entry into mojo. Gets the list of dependencies and iterates through
- * displaying the resolved version.
+ * Main entry into mojo. Gets the list of dependencies and iterates through displaying the resolved version.
*
* @throws MojoExecutionException with a message if an error occurs.
*/
@@ -128,7 +127,7 @@ public class ResolvePluginsMojo
id = artifact.toString();
sb.append( " " + id + ( outputAbsoluteArtifactFilename ? ":" + artifactFilename : "" )
- + "\n" );
+ + "\n" );
}
}
}
@@ -167,8 +166,8 @@ public class ResolvePluginsMojo
* This method resolves the plugin artifacts from the project.
*
* @return set of resolved plugin artifacts.
- * @throws ArtifactFilterException
- * @throws ArtifactResolverException
+ * @throws ArtifactFilterException in case of an error.
+ * @throws ArtifactResolverException in case of an error.
*/
protected Set<Artifact> resolvePluginArtifacts()
throws ArtifactFilterException, ArtifactResolverException
@@ -184,21 +183,21 @@ public class ResolvePluginsMojo
artifacts = filter.filter( artifacts );
Set<Artifact> resolvedArtifacts = new LinkedHashSet<Artifact>( artifacts.size() );
- // final ArtifactFilter filter = getPluginFilter();
+ // final ArtifactFilter filter = getPluginFilter();
for ( final Artifact artifact : new LinkedHashSet<Artifact>( artifacts ) )
{
// if ( !filter.include( artifact ) )
// {
- // final String logStr =
- // String.format( " Plugin SKIPPED: %s", DependencyUtil.getFormattedFileName( artifact, false ) );
+ // final String logStr =
+ // String.format( " Plugin SKIPPED: %s", DependencyUtil.getFormattedFileName( artifact, false ) );
//
- // if ( !silent )
- // {
- // this.getLog().info( logStr );
- // }
+ // if ( !silent )
+ // {
+ // this.getLog().info( logStr );
+ // }
//
- // artifacts.remove( artifact );
- // continue;
+ // artifacts.remove( artifact );
+ // continue;
// }
ProjectBuildingRequest buildingRequest =
@@ -207,7 +206,7 @@ public class ResolvePluginsMojo
buildingRequest.setRemoteRepositories( this.remotePluginRepositories );
// resolve the new artifact
- resolvedArtifacts.add( getArtifactResolver().resolveArtifact( buildingRequest, artifact ) .getArtifact() );
+ resolvedArtifacts.add( getArtifactResolver().resolveArtifact( buildingRequest, artifact ).getArtifact() );
}
return artifacts;
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/AbstractSerializingVisitor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/AbstractSerializingVisitor.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/AbstractSerializingVisitor.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/AbstractSerializingVisitor.java Sat Sep 9 10:35:59 2017
@@ -1,4 +1,4 @@
-package org.apache.maven.plugins.dependency.tree ;
+package org.apache.maven.plugins.dependency.tree;
/*
* Licensed to the Apache Software Foundation (ASF) under one
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/DOTDependencyNodeVisitor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/DOTDependencyNodeVisitor.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/DOTDependencyNodeVisitor.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/DOTDependencyNodeVisitor.java Sat Sep 9 10:35:59 2017
@@ -26,8 +26,7 @@ import java.io.Writer;
import java.util.List;
/**
- * A dependency node visitor that serializes visited nodes to DOT format
- * http://en.wikipedia.org/wiki/DOT_language
+ * A dependency node visitor that serializes visited nodes to DOT format http://en.wikipedia.org/wiki/DOT_language
*
* @author <a href="mailto:pi.songs@gmail.com">Pi Song</a>
* @since 2.1
@@ -47,7 +46,6 @@ public class DOTDependencyNodeVisitor
super( writer );
}
-
/**
* {@inheritDoc}
*/
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/GraphmlDependencyNodeVisitor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/GraphmlDependencyNodeVisitor.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/GraphmlDependencyNodeVisitor.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/GraphmlDependencyNodeVisitor.java Sat Sep 9 10:35:59 2017
@@ -1,4 +1,4 @@
-package org.apache.maven.plugins.dependency.tree ;
+package org.apache.maven.plugins.dependency.tree;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -39,16 +39,14 @@ public class GraphmlDependencyNodeVisito
/**
* Graphml xml file header. Define Schema and root element. We also define 2 key as meta data.
*/
- private static final String GRAPHML_HEADER =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?> "
- + "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" "
- + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- + "xmlns:y=\"http://www.yworks.com/xml/graphml\" "
- + "xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns "
- + "http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\">\n"
- + " <key for=\"node\" id=\"d0\" yfiles.type=\"nodegraphics\"/> \n"
- + " <key for=\"edge\" id=\"d1\" yfiles.type=\"edgegraphics\"/> \n"
- + "<graph id=\"dependencies\" edgedefault=\"directed\">\n";
+ private static final String GRAPHML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> "
+ + "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" "
+ + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xmlns:y=\"http://www.yworks.com/xml/graphml\" "
+ + "xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns "
+ + "http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\">\n"
+ + " <key for=\"node\" id=\"d0\" yfiles.type=\"nodegraphics\"/> \n"
+ + " <key for=\"edge\" id=\"d1\" yfiles.type=\"edgegraphics\"/> \n"
+ + "<graph id=\"dependencies\" edgedefault=\"directed\">\n";
/**
* Graphml xml file footer.
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TGFDependencyNodeVisitor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TGFDependencyNodeVisitor.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TGFDependencyNodeVisitor.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TGFDependencyNodeVisitor.java Sat Sep 9 10:35:59 2017
@@ -1,4 +1,4 @@
-package org.apache.maven.plugins.dependency.tree ;
+package org.apache.maven.plugins.dependency.tree;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -28,7 +28,6 @@ import org.apache.maven.shared.dependenc
/**
* A dependency node visitor that serializes visited nodes to a writer using the TGF format.
- *
* http://en.wikipedia.org/wiki/Trivial_Graph_Format
*
* @author <a href="mailto:jerome.creignou@gmail.com">Jerome Creignou</a>
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/tree/TreeMojo.java Sat Sep 9 10:35:59 2017
@@ -107,8 +107,8 @@ public class TreeMojo
* If specified, this parameter will cause the dependency tree to be written using the specified format. Currently
* supported format are: <code>text</code>, <code>dot</code>, <code>graphml</code> and <code>tgf</code>.
* <p/>
- * These formats can be plotted to image files. An example of how to plot a dot file using
- * pygraphviz can be found <a href="http://networkx.lanl.gov/pygraphviz/tutorial.html#layout-and-drawing">here</a>.
+ * These formats can be plotted to image files. An example of how to plot a dot file using pygraphviz can be found
+ * <a href="http://networkx.lanl.gov/pygraphviz/tutorial.html#layout-and-drawing">here</a>.
*
* @since 2.2
*/
@@ -116,8 +116,8 @@ public class TreeMojo
private String outputType;
/**
- * The scope to filter by when resolving the dependency tree, or <code>null</code> to include dependencies from
- * all scopes. Note that this feature does not currently work due to MSHARED-4
+ * The scope to filter by when resolving the dependency tree, or <code>null</code> to include dependencies from all
+ * scopes. Note that this feature does not currently work due to MSHARED-4
*
* @see <a href="https://issues.apache.org/jira/browse/MSHARED-4">MSHARED-4</a>
* @since 2.0-alpha-5
@@ -137,8 +137,8 @@ public class TreeMojo
/**
* The token set name to use when outputting the dependency tree. Possible values are <code>whitespace</code>,
- * <code>standard</code> or <code>extended</code>, which use whitespace, standard (ie ASCII) or extended
- * character sets respectively.
+ * <code>standard</code> or <code>extended</code>, which use whitespace, standard (ie ASCII) or extended character
+ * sets respectively.
*
* @since 2.0-alpha-6
*/
@@ -155,8 +155,10 @@ public class TreeMojo
*
* where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern
* segment is treated as an implicit wildcard.
- * <p>For example, <code>org.apache.*</code> will match all artifacts whose group id starts with
- * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts.</p>
+ * <p>
+ * For example, <code>org.apache.*</code> will match all artifacts whose group id starts with
+ * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts.
+ * </p>
*
* @see StrictPatternIncludesArtifactFilter
* @since 2.0-alpha-6
@@ -174,8 +176,10 @@ public class TreeMojo
*
* where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern
* segment is treated as an implicit wildcard.
- * <p>For example, <code>org.apache.*</code> will match all artifacts whose group id starts with
- * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts.</p>
+ * <p>
+ * For example, <code>org.apache.*</code> will match all artifacts whose group id starts with
+ * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts.
+ * </p>
*
* @see StrictPatternExcludesArtifactFilter
* @since 2.0-alpha-6
@@ -232,12 +236,12 @@ public class TreeMojo
// have already been resolved.
getLog().info( "Verbose not supported since maven-dependency-plugin 3.0" );
}
-
+
ProjectBuildingRequest buildingRequest =
new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
-
+
buildingRequest.setProject( project );
-
+
// non-verbose mode use dependency graph component, which gives consistent results with Maven version
// running
rootNode = dependencyGraphBuilder.buildDependencyGraph( buildingRequest, artifactFilter, reactorProjects );
@@ -440,9 +444,8 @@ public class TreeMojo
return filters.isEmpty() ? null : new AndDependencyNodeFilter( filters );
}
- //following is required because the version handling in maven code
- //doesn't work properly. I ripped it out of the enforcer rules.
-
+ // following is required because the version handling in maven code
+ // doesn't work properly. I ripped it out of the enforcer rules.
/**
* Copied from Artifact.VersionRange. This is tweaked to handle singular ranges properly. Currently the default
@@ -450,7 +453,7 @@ public class TreeMojo
* "[2.0.4,)"
*
* @param allowedRange range of allowed versions.
- * @param theVersion the version to be checked.
+ * @param theVersion the version to be checked.
* @return true if the version is contained by the range.
*/
public static boolean containsVersion( VersionRange allowedRange, ArtifactVersion theVersion )
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencySilentLog.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencySilentLog.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencySilentLog.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencySilentLog.java Sat Sep 9 10:35:59 2017
@@ -353,7 +353,7 @@ public class DependencySilentLog
{
// nop
}
-
+
/**
* @return <code>null</code>
* @see org.codehaus.plexus.logging.Logger#getName()
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyStatusSets.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyStatusSets.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyStatusSets.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyStatusSets.java Sat Sep 9 10:35:59 2017
@@ -66,8 +66,7 @@ public class DependencyStatusSets
}
/**
- * @param resolvedDependencies
- * The resolvedDependencies to set.
+ * @param resolvedDependencies The resolvedDependencies to set.
*/
public void setResolvedDependencies( Set<Artifact> resolvedDependencies )
{
@@ -90,8 +89,7 @@ public class DependencyStatusSets
}
/**
- * @param skippedDependencies
- * The skippedDependencies to set.
+ * @param skippedDependencies The skippedDependencies to set.
*/
public void setSkippedDependencies( Set<Artifact> skippedDependencies )
{
@@ -114,8 +112,7 @@ public class DependencyStatusSets
}
/**
- * @param unResolvedDependencies
- * The unResolvedDependencies to set.
+ * @param unResolvedDependencies The unResolvedDependencies to set.
*/
public void setUnResolvedDependencies( Set<Artifact> unResolvedDependencies )
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyUtil.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyUtil.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyUtil.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/DependencyUtil.java Sat Sep 9 10:35:59 2017
@@ -55,41 +55,30 @@ public final class DependencyUtil
}
/**
- * Builds the file name. If removeVersion is set, then the file name must be
- * reconstructed from the groupId (if <b>prependGroupId</b> is true) artifactId,
- * Classifier (if used) and Type.
- * Otherwise, this method returns the artifact file name.
- *
- * @param artifact
- * File to be formatted.
- * @param removeVersion
- * Specifies if the version should be removed from the file name.
- * @param prependGroupId
- * Specifies if the groupId should be prepended to the file name.
- * @return Formatted file name in the format
- * [groupId].artifactId-[version]-[classifier].[type]
+ * Builds the file name. If removeVersion is set, then the file name must be reconstructed from the groupId (if
+ * <b>prependGroupId</b> is true) artifactId, Classifier (if used) and Type. Otherwise, this method returns the
+ * artifact file name.
+ *
+ * @param artifact File to be formatted.
+ * @param removeVersion Specifies if the version should be removed from the file name.
+ * @param prependGroupId Specifies if the groupId should be prepended to the file name.
+ * @return Formatted file name in the format [groupId].artifactId-[version]-[classifier].[type]
*/
public static String getFormattedFileName( Artifact artifact, boolean removeVersion, boolean prependGroupId )
- {
+ {
return getFormattedFileName( artifact, removeVersion, prependGroupId, false );
}
/**
- * Builds the file name. If removeVersion is set, then the file name must be
- * reconstructed from the groupId (if <b>prependGroupId</b> is true) artifactId,
- * Classifier (if used) and Type.
- * Otherwise, this method returns the artifact file name.
- *
- * @param artifact
- * File to be formatted.
- * @param removeVersion
- * Specifies if the version should be removed from the file name.
- * @param prependGroupId
- * Specifies if the groupId should be prepended to the file name.
- * @param useBaseVersion
- * Specifies if the baseVersion of the artifact should be used instead of the version.
- * @return Formatted file name in the format
- * [groupId].artifactId-[version]-[classifier].[type]
+ * Builds the file name. If removeVersion is set, then the file name must be reconstructed from the groupId (if
+ * <b>prependGroupId</b> is true) artifactId, Classifier (if used) and Type. Otherwise, this method returns the
+ * artifact file name.
+ *
+ * @param artifact File to be formatted.
+ * @param removeVersion Specifies if the version should be removed from the file name.
+ * @param prependGroupId Specifies if the groupId should be prepended to the file name.
+ * @param useBaseVersion Specifies if the baseVersion of the artifact should be used instead of the version.
+ * @return Formatted file name in the format [groupId].artifactId-[version]-[classifier].[type]
*/
public static String getFormattedFileName( Artifact artifact, boolean removeVersion, boolean prependGroupId,
boolean useBaseVersion )
@@ -98,34 +87,27 @@ public final class DependencyUtil
}
/**
- * Builds the file name. If removeVersion is set, then the file name must be
- * reconstructed from the groupId (if <b>prependGroupId</b> is true) artifactId,
- * Classifier (if used) and Type.
- * Otherwise, this method returns the artifact file name.
- *
- * @param artifact
- * File to be formatted.
- * @param removeVersion
- * Specifies if the version should be removed from the file name.
- * @param prependGroupId
- * Specifies if the groupId should be prepended to the file name.
- * @param useBaseVersion
- * Specifies if the baseVersion of the artifact should be used instead of the version.
- * @param removeClassifier
- * Specifies if the classifier of the artifact should be remved from the file name.
- * @return Formatted file name in the format
- * [groupId].artifactId-[version]-[classifier].[type]
+ * Builds the file name. If removeVersion is set, then the file name must be reconstructed from the groupId (if
+ * <b>prependGroupId</b> is true) artifactId, Classifier (if used) and Type. Otherwise, this method returns the
+ * artifact file name.
+ *
+ * @param artifact File to be formatted.
+ * @param removeVersion Specifies if the version should be removed from the file name.
+ * @param prependGroupId Specifies if the groupId should be prepended to the file name.
+ * @param useBaseVersion Specifies if the baseVersion of the artifact should be used instead of the version.
+ * @param removeClassifier Specifies if the classifier of the artifact should be remved from the file name.
+ * @return Formatted file name in the format [groupId].artifactId-[version]-[classifier].[type]
*/
- public static String getFormattedFileName( Artifact artifact, boolean removeVersion, boolean prependGroupId,
- boolean useBaseVersion, boolean removeClassifier )
+ public static String getFormattedFileName( Artifact artifact, boolean removeVersion, boolean prependGroupId,
+ boolean useBaseVersion, boolean removeClassifier )
{
StringBuilder destFileName = new StringBuilder();
-
+
if ( prependGroupId )
{
destFileName.append( artifact.getGroupId() ).append( "." );
}
-
+
String versionString;
if ( !removeVersion )
{
@@ -152,13 +134,14 @@ public final class DependencyUtil
destFileName.append( artifact.getArtifactId() ).append( versionString );
destFileName.append( classifierString ).append( "." );
destFileName.append( artifact.getArtifactHandler().getExtension() );
-
+
return destFileName.toString();
}
-
+
/**
* Formats the outputDirectory based on type.
*
+ * @param useSubdirsPerScope if a new sub directory should be used for each scope.
* @param useSubdirsPerType if a new sub directory should be used for each type.
* @param useSubdirPerArtifact if a new sub directory should be used for each artifact.
* @param useRepositoryLayout if dependencies must be moved into a Maven repository layout, if set, other settings
@@ -236,6 +219,8 @@ public final class DependencyUtil
*
* @param string the string to write
* @param file the file to write to
+ * @param append append to existing file or not.
+ * @param log where to send the logging output.
* @throws IOException if an I/O error occurs
*/
public static synchronized void write( String string, File file, boolean append, Log log )
@@ -264,6 +249,7 @@ public final class DependencyUtil
* Writes the specified string to the log at info level.
*
* @param string the string to write
+ * @param log where to log information.
* @throws IOException if an I/O error occurs
*/
public static synchronized void log( String string, Log log )
@@ -297,7 +283,7 @@ public final class DependencyUtil
String ret = "";
if ( !StringUtils.isEmpty( str ) )
{
- // remove initial and ending spaces, plus all spaces next to commas
+ // remove initial and ending spaces, plus all spaces next to commas
ret = str.trim().replaceAll( "[\\s]*,[\\s]*", "," );
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/DestFileFilter.java Sat Sep 9 10:35:59 2017
@@ -87,9 +87,8 @@ public class DestFileFilter
/*
* (non-Javadoc)
- *
* @see org.apache.mojo.dependency.utils.filters.ArtifactsFilter#filter(java.util.Set,
- * org.apache.maven.plugin.logging.Log)
+ * org.apache.maven.plugin.logging.Log)
*/
@Override
public Set<Artifact> filter( Set<Artifact> artifacts )
@@ -116,8 +115,7 @@ public class DestFileFilter
}
/**
- * @param overWriteReleases
- * The overWriteReleases to set.
+ * @param overWriteReleases The overWriteReleases to set.
*/
public void setOverWriteReleases( boolean overWriteReleases )
{
@@ -133,8 +131,7 @@ public class DestFileFilter
}
/**
- * @param overWriteSnapshots
- * The overWriteSnapshots to set.
+ * @param overWriteSnapshots The overWriteSnapshots to set.
*/
public void setOverWriteSnapshots( boolean overWriteSnapshots )
{
@@ -150,8 +147,7 @@ public class DestFileFilter
}
/**
- * @param overWriteIfNewer
- * The overWriteIfNewer to set.
+ * @param overWriteIfNewer The overWriteIfNewer to set.
*/
public void setOverWriteIfNewer( boolean overWriteIfNewer )
{
@@ -167,8 +163,7 @@ public class DestFileFilter
}
/**
- * @param outputFileDirectory
- * The outputFileDirectory to set.
+ * @param outputFileDirectory The outputFileDirectory to set.
*/
public void setOutputFileDirectory( File outputFileDirectory )
{
@@ -184,8 +179,7 @@ public class DestFileFilter
}
/**
- * @param removeVersion
- * The removeVersion to set.
+ * @param removeVersion The removeVersion to set.
*/
public void setRemoveVersion( boolean removeVersion )
{
@@ -201,8 +195,7 @@ public class DestFileFilter
}
/**
- * @param removeClassifier
- * The removeClassifier to set.
+ * @param removeClassifier The removeClassifier to set.
*/
public void setRemoveClassifier( boolean removeClassifier )
{
@@ -218,8 +211,7 @@ public class DestFileFilter
}
/**
- * @param useSubDirectoryPerArtifact
- * The useSubDirectoryPerArtifact to set.
+ * @param useSubDirectoryPerArtifact The useSubDirectoryPerArtifact to set.
*/
public void setUseSubDirectoryPerArtifact( boolean useSubDirectoryPerArtifact )
{
@@ -235,8 +227,7 @@ public class DestFileFilter
}
/**
- * @param useSubDirectoryPerType
- * The useSubDirectoryPerType to set.
+ * @param useSubDirectoryPerType The useSubDirectoryPerType to set.
*/
public void setUseSubDirectoryPerType( boolean useSubDirectoryPerType )
{
@@ -244,7 +235,6 @@ public class DestFileFilter
}
/**
- *
* @return Returns the useRepositoryLayout
*/
public boolean isUseRepositoryLayout()
@@ -253,9 +243,7 @@ public class DestFileFilter
}
/**
- *
- * @param useRepositoryLayout
- * the useRepositoryLayout to set
+ * @param useRepositoryLayout the useRepositoryLayout to set
*/
public void setUseRepositoryLayout( boolean useRepositoryLayout )
{
@@ -267,8 +255,7 @@ public class DestFileFilter
{
Artifact artifact = item.getArtifact();
- boolean overWrite =
- ( artifact.isSnapshot() && this.overWriteSnapshots )
+ boolean overWrite = ( artifact.isSnapshot() && this.overWriteSnapshots )
|| ( !artifact.isSnapshot() && this.overWriteReleases );
File destFolder = item.getOutputDirectory();
@@ -283,9 +270,8 @@ public class DestFileFilter
File destFile;
if ( StringUtils.isEmpty( item.getDestFileName() ) )
{
- String formattedFileName =
- DependencyUtil.getFormattedFileName( artifact, removeVersion, prependGroupId,
- useBaseVersion, removeClassifier );
+ String formattedFileName = DependencyUtil.getFormattedFileName( artifact, removeVersion, prependGroupId,
+ useBaseVersion, removeClassifier );
destFile = new File( destFolder, formattedFileName );
}
else
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/MarkerFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/MarkerFileFilter.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/MarkerFileFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/filters/MarkerFileFilter.java Sat Sep 9 10:35:59 2017
@@ -47,7 +47,7 @@ public class MarkerFileFilter
protected final MarkerHandler handler;
public MarkerFileFilter( boolean overWriteReleases, boolean overWriteSnapshots, boolean overWriteIfNewer,
- MarkerHandler handler )
+ MarkerHandler handler )
{
this.overWriteReleases = overWriteReleases;
this.overWriteSnapshots = overWriteSnapshots;
@@ -57,9 +57,8 @@ public class MarkerFileFilter
/*
* (non-Javadoc)
- *
* @see org.apache.mojo.dependency.utils.filters.ArtifactsFilter#filter(java.util.Set,
- * org.apache.maven.plugin.logging.Log)
+ * org.apache.maven.plugin.logging.Log)
*/
@Override
public Set<Artifact> filter( Set<Artifact> artifacts )
@@ -79,7 +78,7 @@ public class MarkerFileFilter
@Override
public boolean isArtifactIncluded( ArtifactItem item )
- throws ArtifactFilterException
+ throws ArtifactFilterException
{
Artifact artifact = item.getArtifact();
@@ -107,8 +106,7 @@ public class MarkerFileFilter
}
/**
- * @param overWriteReleases
- * The overWriteReleases to set.
+ * @param overWriteReleases The overWriteReleases to set.
*/
public void setOverWriteReleases( boolean overWriteReleases )
{
@@ -124,8 +122,7 @@ public class MarkerFileFilter
}
/**
- * @param overWriteSnapshots
- * The overWriteSnapshots to set.
+ * @param overWriteSnapshots The overWriteSnapshots to set.
*/
public void setOverWriteSnapshots( boolean overWriteSnapshots )
{
@@ -141,8 +138,7 @@ public class MarkerFileFilter
}
/**
- * @param overWriteIfNewer
- * The overWriteIfNewer to set.
+ * @param overWriteIfNewer The overWriteIfNewer to set.
*/
public void setOverWriteIfNewer( boolean overWriteIfNewer )
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/DefaultFileMarkerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/DefaultFileMarkerHandler.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/DefaultFileMarkerHandler.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/DefaultFileMarkerHandler.java Sat Sep 9 10:35:59 2017
@@ -58,16 +58,13 @@ public class DefaultFileMarkerHandler
}
/**
- * Tests whether the file or directory denoted by this abstract pathname
- * exists.
+ * Tests whether the file or directory denoted by this abstract pathname exists.
*
- * @return <code>true</code> if and only if the file or directory denoted
- * by this abstract pathname exists; <code>false</code> otherwise
- *
- * @throws SecurityException
- * If a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
- * method denies read access to the file or directory
+ * @return <code>true</code> if and only if the file or directory denoted by this abstract pathname exists;
+ * <code>false</code> otherwise
+ * @throws SecurityException If a security manager exists and its <code>{@link
+ * java.lang.SecurityManager#checkRead(java.lang.String)}</code> method denies read access to the file or
+ * directory
*/
@Override
public boolean isMarkerSet()
@@ -132,7 +129,7 @@ public class DefaultFileMarkerHandler
if ( !marker.setLastModified( ts ) )
{
throw new MojoExecutionException( "Unable to update last modified timestamp on marker file "
- + marker.getAbsolutePath() );
+ + marker.getAbsolutePath() );
}
}
@@ -143,17 +140,13 @@ public class DefaultFileMarkerHandler
}
/**
- * Deletes the file or directory denoted by this abstract pathname. If this
- * pathname denotes a directory, then the directory must be empty in order
- * to be deleted.
- *
- * @return <code>true</code> if and only if the file or directory is
- * successfully deleted; <code>false</code> otherwise
+ * Deletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the
+ * directory must be empty in order to be deleted.
*
- * @throws SecurityException
- * If a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkDelete}</code>
- * method denies delete access to the file
+ * @return <code>true</code> if and only if the file or directory is successfully deleted; <code>false</code>
+ * otherwise
+ * @throws SecurityException If a security manager exists and its <code>{@link
+ * java.lang.SecurityManager#checkDelete}</code> method denies delete access to the file
*/
@Override
public boolean clearMarker()
@@ -172,8 +165,7 @@ public class DefaultFileMarkerHandler
}
/**
- * @param artifact
- * The artifact to set.
+ * @param artifact The artifact to set.
*/
@Override
public void setArtifact( Artifact artifact )
@@ -190,8 +182,7 @@ public class DefaultFileMarkerHandler
}
/**
- * @param markerFilesDirectory
- * The markerFilesDirectory to set.
+ * @param markerFilesDirectory The markerFilesDirectory to set.
*/
public void setMarkerFilesDirectory( File markerFilesDirectory )
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/SourcesFileMarkerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/SourcesFileMarkerHandler.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/SourcesFileMarkerHandler.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/SourcesFileMarkerHandler.java Sat Sep 9 10:35:59 2017
@@ -60,8 +60,7 @@ public class SourcesFileMarkerHandler
/**
* Get MarkerFile, exposed for unit testing purposes
*
- * @param res
- * resolved or not.
+ * @param res resolved or not.
* @return marker file for this artifact.
*/
protected File getMarkerFile( boolean res )
@@ -80,16 +79,13 @@ public class SourcesFileMarkerHandler
}
/**
- * Tests whether the file or directory denoted by this abstract pathname
- * exists.
+ * Tests whether the file or directory denoted by this abstract pathname exists.
*
- * @return <code>true</code> if and only if the file or directory denoted
- * by this abstract pathname exists; <code>false</code> otherwise
- *
- * @throws MojoExecutionException
- * If a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
- * method denies read access to the file or directory
+ * @return <code>true</code> if and only if the file or directory denoted by this abstract pathname exists;
+ * <code>false</code> otherwise
+ * @throws MojoExecutionException If a security manager exists and its <code>{@link
+ * java.lang.SecurityManager#checkRead(java.lang.String)}</code> method denies read access to the file or
+ * directory
*/
@Override
public boolean isMarkerSet()
@@ -164,17 +160,13 @@ public class SourcesFileMarkerHandler
}
/**
- * Deletes the file or directory denoted by this abstract pathname. If this
- * pathname denotes a directory, then the directory must be empty in order
- * to be deleted.
- *
- * @return <code>true</code> if and only if the file or directory is
- * successfully deleted; <code>false</code> otherwise
+ * Deletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the
+ * directory must be empty in order to be deleted.
*
- * @throws SecurityException
- * If a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkDelete}</code>
- * method denies delete access to the file
+ * @return <code>true</code> if and only if the file or directory is successfully deleted; <code>false</code>
+ * otherwise
+ * @throws SecurityException If a security manager exists and its <code>{@link
+ * java.lang.SecurityManager#checkDelete}</code> method denies delete access to the file
*/
@Override
public boolean clearMarker()
@@ -196,8 +188,7 @@ public class SourcesFileMarkerHandler
}
/**
- * @param isResolved
- * The resolved to set.
+ * @param isResolved The resolved to set.
*/
public void setResolved( boolean isResolved )
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/markers/UnpackFileMarkerHandler.java Sat Sep 9 10:35:59 2017
@@ -48,10 +48,9 @@ public class UnpackFileMarkerHandler
protected File getMarkerFile()
{
/**
- * Build a hash of all include/exclude strings, to determine
- * if an artifactItem has been unpacked using the include/exclude
- * parameters, this will allow an artifact to be included multiple
- * times with different include/exclude parameters
+ * Build a hash of all include/exclude strings, to determine if an artifactItem has been unpacked using the
+ * include/exclude parameters, this will allow an artifact to be included multiple times with different
+ * include/exclude parameters
*/
File markerFile;
if ( this.artifactItem == null || ( StringUtils.isEmpty( this.artifactItem.getIncludes() )
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java Sat Sep 9 10:35:59 2017
@@ -38,15 +38,15 @@ public class ClassifierTypeTranslator
implements ArtifactTranslator
{
private ArtifactHandlerManager artifactHandlerManager;
+
private String classifier;
private String type;
/**
- *
- * @param artifactHanderManager TODO
- * @param theClassifier
- * @param theType
+ * @param artifactHanderManager {@link ArtifactHandlerManager}.
+ * @param theClassifier The classifier to use.
+ * @param theType The type.
*/
public ClassifierTypeTranslator( ArtifactHandlerManager artifactHanderManager, String theClassifier,
String theType )
@@ -58,9 +58,8 @@ public class ClassifierTypeTranslator
/*
* (non-Javadoc)
- *
* @see org.apache.mojo.dependency.utils.translators.ArtifactTranslator#translate(java.util.Set,
- * org.apache.maven.plugin.logging.Log)
+ * org.apache.maven.plugin.logging.Log)
*/
@Override
public Set<ArtifactCoordinate> translate( Set<Artifact> artifacts, Log log )
@@ -113,21 +112,21 @@ public class ClassifierTypeTranslator
coordinate.setClassifier( useClassifier );
coordinate.setExtension( extension );
-// // Create a new artifact
-// Artifact newArtifact = factory.createArtifactWithClassifier( artifact.getGroupId(), artifact
-// .getArtifactId(), artifact.getVersion(), useType, useClassifier );
-//
-// // note the new artifacts will always have the scope set to null. We
-// // should
-// // reset it here so that it will pass other filters if needed
-// newArtifact.setScope( artifact.getScope() );
-//
-// if ( Artifact.SCOPE_SYSTEM.equals( newArtifact.getScope() ) )
-// {
-// File baseDir = repositoryManager.getLocalRepositoryBasedir( buildingRequest );
-// String path = repositoryManager.getPathForLocalArtifact( buildingRequest, newArtifact );
-// newArtifact.setFile( new File( baseDir, path ) );
-// }
+ // // Create a new artifact
+ // Artifact newArtifact = factory.createArtifactWithClassifier( artifact.getGroupId(), artifact
+ // .getArtifactId(), artifact.getVersion(), useType, useClassifier );
+ //
+ // // note the new artifacts will always have the scope set to null. We
+ // // should
+ // // reset it here so that it will pass other filters if needed
+ // newArtifact.setScope( artifact.getScope() );
+ //
+ // if ( Artifact.SCOPE_SYSTEM.equals( newArtifact.getScope() ) )
+ // {
+ // File baseDir = repositoryManager.getLocalRepositoryBasedir( buildingRequest );
+ // String path = repositoryManager.getPathForLocalArtifact( buildingRequest, newArtifact );
+ // newArtifact.setFile( new File( baseDir, path ) );
+ // }
results.add( coordinate );
}
@@ -144,8 +143,7 @@ public class ClassifierTypeTranslator
}
/**
- * @param theType
- * The type to set.
+ * @param theType The type to set.
*/
public void setType( String theType )
{
@@ -161,8 +159,7 @@ public class ClassifierTypeTranslator
}
/**
- * @param theClassifier
- * The classifier to set.
+ * @param theClassifier The classifier to set.
*/
public void setClassifier( String theClassifier )
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugins/dependency/AbstractDependencyMojoTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugins/dependency/AbstractDependencyMojoTestCase.java?rev=1807877&r1=1807876&r2=1807877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugins/dependency/AbstractDependencyMojoTestCase.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugins/dependency/AbstractDependencyMojoTestCase.java Sat Sep 9 10:35:59 2017
@@ -39,7 +39,7 @@ public abstract class AbstractDependency
{
super();
}
-
+
protected void setUp( String testDirStr, boolean createFiles )
throws Exception
{
@@ -51,9 +51,8 @@ public abstract class AbstractDependency
{
// required for mojo lookups to work
super.setUp();
- testDir =
- new File( getBasedir(), "target" + File.separatorChar + "unit-tests" + File.separatorChar + testDirStr
- + File.separatorChar );
+ testDir = new File( getBasedir(), "target" + File.separatorChar + "unit-tests" + File.separatorChar + testDirStr
+ + File.separatorChar );
DependencyTestUtils.removeDirectory( testDir );
assertFalse( testDir.exists() );
@@ -75,10 +74,10 @@ public abstract class AbstractDependency
fail( "Trying to remove directory:" + testDir + "\r\n" + e.toString() );
}
assertFalse( testDir.exists() );
-
+
testDir = null;
}
-
+
stubFactory = null;
}