You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/10/04 06:11:01 UTC
svn commit: r452716 [1/2] - in
/maven/plugins/trunk/maven-dependency-plugin/src:
main/java/org/apache/maven/plugin/dependency/
main/java/org/apache/maven/plugin/dependency/fromConfiguration/
main/java/org/apache/maven/plugin/dependency/resolvers/ main/...
Author: brianf
Date: Tue Oct 3 21:11:00 2006
New Revision: 452716
URL: http://svn.apache.org/viewvc?view=rev&rev=452716
Log:
fixed formating and imports
Modified:
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/SilentLog.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactsFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TypeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/DefaultFileMarkerHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/MarkerHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/SourcesFileMarkerHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/resolvers/ArtifactsResolver.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/resolvers/DefaultArtifactsResolver.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/stubs/DependencyProjectStub.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/ArtifactStubFactory.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/DependencyTestUtils.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestFilterArtifacts.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestDefaultMarkerFileHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestSourcesMarkerFileHandler.java
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java Tue Oct 3 21:11:00 2006
@@ -18,33 +18,42 @@
import java.io.File;
/**
- * Abstract Parent class used by mojos that get Artifact information from the project dependencies.
+ * Abstract Parent class used by mojos that get Artifact information from the
+ * project dependencies.
+ *
* @author brianf
- *
+ *
*/
public abstract class AbstractFromDependenciesMojo
extends AbstractDependencyFilterMojo
{
-
+
/**
* Default location used for mojo unless overridden in ArtifactItem
- * @parameter expression="${outputDirectory}" default-value="${project.build.directory}/dependency"
+ *
+ * @parameter expression="${outputDirectory}"
+ * default-value="${project.build.directory}/dependency"
* @required
*/
- protected File outputDirectory;
-
+ protected File outputDirectory;
+
/**
- * Place each type of file in a separate subdirectory. (example /outputDirectory/jars /outputDirectory/wars etc)
+ * Place each type of file in a separate subdirectory. (example
+ * /outputDirectory/jars /outputDirectory/wars etc)
+ *
* @parameter expression="${useSubDirectoryPerType}" default-value="false"
* @optional
*/
protected boolean useSubDirectoryPerType;
/**
- * Place each file in a separate subdirectory. (example /outputDirectory/junit-junit-3.8.1)
- * @parameter expression="${useSubDirectoryPerArtifact}" default-value="false"
+ * Place each file in a separate subdirectory. (example
+ * /outputDirectory/junit-junit-3.8.1)
+ *
+ * @parameter expression="${useSubDirectoryPerArtifact}"
+ * default-value="false"
* @optional
*/
protected boolean useSubDirectoryPerArtifact;
- }
+}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java Tue Oct 3 21:11:00 2006
@@ -17,10 +17,9 @@
import org.apache.maven.project.MavenProjectBuilder;
-
/**
* @author brianf
- *
+ *
*/
public abstract class AbstractResolveMojo
extends AbstractDependencyFilterMojo
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java Tue Oct 3 21:11:00 2006
@@ -21,14 +21,14 @@
import java.util.Set;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+import org.apache.maven.plugin.logging.Log;
/**
- * 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.
+ *
* @goal copy-dependencies
* @requiresDependencyResolution compile
* @phase process-sources
@@ -40,17 +40,19 @@
/**
* Strip artifact version during copy
- * @parameter expression="${stripVersion}" default-value="false"
+ *
+ * @parameter expression="${stripVersion}" default-value="false"
* @parameter
*/
protected boolean stripVersion = false;
/**
- * 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.
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
* @see #getDependencies
* @see #copyArtifact(Artifact, boolean)
*/
@@ -66,17 +68,19 @@
}
/**
- * 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.
- *
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
+ * 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.
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
+ *
* @see DependencyUtil#copyFile(File, File, Log)
* @see DependencyUtil#getFormattedFileName(Artifact, boolean)
*/
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java Tue Oct 3 21:11:00 2006
@@ -1,5 +1,17 @@
package org.apache.maven.plugin.dependency;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -17,18 +29,6 @@
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/**
* Remove the project dependencies from the local repository, and optionally
* re-resolve them.
@@ -37,14 +37,14 @@
*
* @goal purge-local-repository
* @aggregator
- *
+ *
*/
public class PurgeLocalRepositoryMojo
extends AbstractMojo
{
public static final String FILE_FUZZINESS = "file";
-
+
public static final String VERSION_FUZZINESS = "version";
public static final String ARTIFACT_ID_FUZZINESS = "artifactId";
@@ -52,7 +52,8 @@
public static final String GROUP_ID_FUZZINESS = "groupId";
/**
- * The projects in the current build. Each of these is subject to refreshing.
+ * The projects in the current build. Each of these is subject to
+ * refreshing.
*
* @parameter default-value="${reactorProjects}"
* @required
@@ -67,11 +68,12 @@
* @parameter
*/
private List excludes;
-
+
/**
- * Comma-separated list of groupId:artifactId entries, which should be used to exclude artifacts
- * from deletion/refresh. This is a command-line alternative to the <code>excludes</code>
- * parameter, since List parameters are not currently compatible with CLI specification.
+ * Comma-separated list of groupId:artifactId entries, which should be used
+ * to exclude artifacts from deletion/refresh. This is a command-line
+ * alternative to the <code>excludes</code> parameter, since List
+ * parameters are not currently compatible with CLI specification.
*
* @parameter expression="${exclude}"
*/
@@ -79,8 +81,8 @@
/**
* Whether to re-resolve the artifacts once they have been deleted from the
- * local repository. If you are running this mojo from the command-line,
- * you may want to disable this. By default, artifacts will be re-resolved.
+ * local repository. If you are running this mojo from the command-line, you
+ * may want to disable this. By default, artifacts will be re-resolved.
*
* @parameter expression="${reResolve}" default-value="true"
*/
@@ -111,14 +113,16 @@
private ArtifactMetadataSource source;
/**
- * Determines how liberally the plugin will delete an artifact from the local repository.
- * Values are:
- * <br/>
+ * Determines how liberally the plugin will delete an artifact from the
+ * local repository. Values are: <br/>
* <ul>
- * <li><b>file</b> <i>(default)</i> - Eliminate only the artifact's file.</li>
- * <li><b>version</b> - Eliminate all files associated with the artifact's version.</li>
- * <li><b>artifactId</b> - Eliminate all files associated with the artifact's artifactId.</li>
- * <li><b>groupId</b> - Eliminate all files associated with the artifact's groupId.</li>
+ * <li><b>file</b> <i>(default)</i> - Eliminate only the artifact's file.</li>
+ * <li><b>version</b> - Eliminate all files associated with the artifact's
+ * version.</li>
+ * <li><b>artifactId</b> - Eliminate all files associated with the
+ * artifact's artifactId.</li>
+ * <li><b>groupId</b> - Eliminate all files associated with the artifact's
+ * groupId.</li>
* </ul>
*
* @parameter expression="${resolutionFuzziness}" default-value="file"
@@ -126,7 +130,8 @@
private String resolutionFuzziness;
/**
- * Whether this mojo should act on all transitive dependencies. Default value is true.
+ * Whether this mojo should act on all transitive dependencies. Default
+ * value is true.
*
* @parameter expression="${actTransitively}" default-value="true"
*/
@@ -134,6 +139,7 @@
/**
* Used to construct artifacts for deletion/resolution...
+ *
* @component
*/
private ArtifactFactory factory;
@@ -149,7 +155,7 @@
throws MojoExecutionException, MojoFailureException
{
List exclusionPatterns = buildExclusionPatternsList();
-
+
for ( Iterator it = projects.iterator(); it.hasNext(); )
{
MavenProject project = (MavenProject) it.next();
@@ -175,29 +181,29 @@
private List buildExclusionPatternsList()
{
List patterns = new ArrayList();
-
+
if ( exclude != null )
{
String[] elements = exclude.split( " ?, ?" );
-
+
patterns.addAll( Arrays.asList( elements ) );
}
else if ( excludes != null && !excludes.isEmpty() )
{
patterns.addAll( excludes );
}
-
+
return patterns;
}
private Map createArtifactMap( MavenProject project )
{
Map artifactMap = Collections.EMPTY_MAP;
-
+
List dependencies = project.getDependencies();
-
+
List remoteRepositories = Collections.EMPTY_LIST;
-
+
Set dependencyArtifacts = new HashSet();
for ( Iterator it = dependencies.iterator(); it.hasNext(); )
@@ -205,20 +211,20 @@
Dependency dependency = (Dependency) it.next();
VersionRange vr = VersionRange.createFromVersion( dependency.getVersion() );
-
+
Artifact artifact = factory.createDependencyArtifact( dependency.getGroupId(), dependency.getArtifactId(),
vr, dependency.getType(), dependency.getClassifier(),
dependency.getScope() );
dependencyArtifacts.add( artifact );
}
-
+
if ( actTransitively )
{
try
{
- ArtifactResolutionResult result = resolver.resolveTransitively( dependencyArtifacts, project.getArtifact(), remoteRepositories,
- localRepository, source );
-
+ ArtifactResolutionResult result = resolver.resolveTransitively( dependencyArtifacts, project
+ .getArtifact(), remoteRepositories, localRepository, source );
+
artifactMap = ArtifactUtils.artifactMapByVersionlessId( result.getArtifacts() );
}
catch ( ArtifactResolutionException e )
@@ -236,7 +242,7 @@
for ( Iterator it = dependencyArtifacts.iterator(); it.hasNext(); )
{
Artifact artifact = (Artifact) it.next();
-
+
try
{
resolver.resolve( artifact, remoteRepositories, localRepository );
@@ -253,7 +259,7 @@
}
}
}
-
+
return artifactMap;
}
@@ -269,7 +275,7 @@
throws ArtifactResolutionException, MojoFailureException
{
Map deps = createArtifactMap( project );
-
+
if ( deps.isEmpty() )
{
getLog().info( "Nothing to do for project: " + project.getId() );
@@ -283,26 +289,26 @@
String excludedKey = (String) it.next();
verbose( "Excluding: " + excludedKey + " from refresh operation for project: " + project.getId() );
-
+
deps.remove( excludedKey );
}
}
-
+
verbose( "Processing dependencies for project: " + project.getId() );
-
+
List missingArtifacts = new ArrayList();
for ( Iterator it = deps.entrySet().iterator(); it.hasNext(); )
{
Map.Entry entry = (Map.Entry) it.next();
Artifact artifact = (Artifact) entry.getValue();
-
+
verbose( "Processing artifact: " + artifact.getId() );
File deleteTarget = findDeleteTarget( artifact );
verbose( "Deleting: " + deleteTarget );
-
+
if ( deleteTarget.isDirectory() )
{
try
@@ -311,20 +317,21 @@
}
catch ( IOException e )
{
- throw new MojoFailureException( this, "Cannot delete dependency from the local repository: " + artifact.getId(), "Failed to delete: " + deleteTarget );
+ throw new MojoFailureException( this, "Cannot delete dependency from the local repository: "
+ + artifact.getId(), "Failed to delete: " + deleteTarget );
}
}
else
{
deleteTarget.delete();
}
-
+
if ( reResolve )
{
verbose( "Re-resolving." );
-
+
artifact.setResolved( false );
-
+
try
{
resolver.resolveAlways( artifact, project.getRemoteArtifactRepositories(), localRepository );
@@ -361,42 +368,46 @@
private File findDeleteTarget( Artifact artifact )
{
File deleteTarget = artifact.getFile();
-
+
if ( GROUP_ID_FUZZINESS.equals( resolutionFuzziness ) )
{
// get the artifactId dir.
deleteTarget = deleteTarget.getParentFile().getParentFile();
-
+
// get the first groupId dir.
deleteTarget = deleteTarget.getParentFile();
-
+
String[] path = localRepository.pathOf( artifact ).split( "\\/" );
-
- // subtract the artifact filename, version dir, artifactId dir, and the first groupId
+
+ // subtract the artifact filename, version dir, artifactId dir, and
+ // the first groupId
// dir, since we've accounted for those above.
int groupParts = path.length - 4;
-
+
File parent = deleteTarget.getParentFile();
int count = 0;
- while( count++ < groupParts )
+ while ( count++ < groupParts )
{
- // prune empty dirs back to the beginning of the groupId, if possible.
-
- // if the parent dir only has the one child file, then it's okay to prune.
+ // prune empty dirs back to the beginning of the groupId, if
+ // possible.
+
+ // if the parent dir only has the one child file, then it's okay
+ // to prune.
if ( parent.list().length < 2 )
{
deleteTarget = parent;
-
+
// check the parent of this newly checked dir
parent = deleteTarget.getParentFile();
}
else
{
- // if there are more files than the one that we're interested in killing, stop.
+ // if there are more files than the one that we're
+ // interested in killing, stop.
break;
}
}
-
+
}
else if ( ARTIFACT_ID_FUZZINESS.equals( resolutionFuzziness ) )
{
@@ -409,7 +420,7 @@
deleteTarget = deleteTarget.getParentFile();
}
// else it's file fuzziness.
-
+
return deleteTarget;
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java Tue Oct 3 21:11:00 2006
@@ -22,13 +22,14 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
/**
- * 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.
+ *
* @goal unpack-dependencies
* @requiresDependencyResolution compile
* @phase process-sources
@@ -38,17 +39,16 @@
extends AbstractFromDependenciesMojo
{
-
-
/**
- * 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.
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
* @see #getDependencies
- * @see DependencyUtil#unpackFile(Artifact, File, File, ArchiverManager, Log)
+ * @see DependencyUtil#unpackFile(Artifact, File, File, ArchiverManager,
+ * Log)
*/
public void execute()
throws MojoExecutionException
@@ -72,8 +72,8 @@
overWrite = this.overWriteReleases;
}
- DependencyUtil.unpackFile( artifact, destDir, this.markersDirectory, this.archiverManager, this
- .getLog(), overWrite );
+ DependencyUtil.unpackFile( artifact, destDir, this.markersDirectory, this.archiverManager, this.getLog(),
+ overWrite );
}
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java Tue Oct 3 21:11:00 2006
@@ -1,4 +1,3 @@
-
/*
* Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
*
@@ -29,10 +28,12 @@
import org.apache.maven.plugin.dependency.AbstractDependencyMojo;
/**
- * Abstract Parent class used by mojos that get Artifact information from the plugin configuration as an ArrayList of ArtifactItems
+ * Abstract Parent class used by mojos that get Artifact information from the
+ * plugin configuration as an ArrayList of ArtifactItems
+ *
* @see ArtifactItem
* @author brianf
- *
+ *
*/
public abstract class AbstractFromConfigurationMojo
extends AbstractDependencyMojo
@@ -40,40 +41,46 @@
/**
* Default location used for mojo unless overridden in ArtifactItem
- * @parameter expression="${outputDirectory}" default-value="${project.build.directory}/dependency"
+ *
+ * @parameter expression="${outputDirectory}"
+ * default-value="${project.build.directory}/dependency"
* @required
*/
protected File outputDirectory;
/**
* Overwrite release artifacts
+ *
* @parameter expression="${overWriteReleases}" default-value="false"
*/
protected boolean overWriteReleases;
/**
* Overwrite snapshot artifacts
+ *
* @parameter expression="${overWriteSnapshots}" default-value="true"
*/
protected boolean overWriteSnapshots;
-
+
/**
- * Collection of ArtifactItems to work on. (ArtifactItem contains groupId, artifactId, version, type, location, destFile, markerFile and overwrite.)
+ * Collection of ArtifactItems to work on. (ArtifactItem contains groupId,
+ * artifactId, version, type, location, destFile, markerFile and overwrite.)
* See "How To Use" and "Javadoc" for details.
+ *
* @parameter
* @required
*/
private ArrayList artifactItems;
-
/**
- * Preprocesses the list of ArtifactItems. This method defaults the outputDirectory if not set
- * and creates the output Directory if it doesn't exist.
-
+ * Preprocesses the list of ArtifactItems. This method defaults the
+ * outputDirectory if not set and creates the output Directory if it doesn't
+ * exist.
+ *
* @return An ArrayList of preprocessed ArtifactItems
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
*
* @see ArtifactItem
*/
@@ -116,16 +123,18 @@
}
/**
- * Resolves the Artifact from the remote repository if nessessary. If no version is specified, it will
- * be retrieved from the dependency list or from the DependencyManagement section of the pom.
- *
- * @param artifactItem
- * containing information about artifact from plugin configuration.
- * @return Artifact
- * object representing the specified file.
+ * Resolves the Artifact from the remote repository if nessessary. If no
+ * version is specified, it will be retrieved from the dependency list or
+ * from the DependencyManagement section of the pom.
+ *
+ * @param artifactItem
+ * containing information about artifact from plugin
+ * configuration.
+ * @return Artifact object representing the specified file.
*
- * @throws MojoExecutionException
- * with a message if the version can't be found in DependencyManagement.
+ * @throws MojoExecutionException
+ * with a message if the version can't be found in
+ * DependencyManagement.
*/
protected Artifact getArtifact( ArtifactItem artifactItem )
throws MojoExecutionException
@@ -139,12 +148,13 @@
if ( artifactItem.getVersion() == null )
{
throw new MojoExecutionException( "Unable to find artifact version of " + artifactItem.getGroupId()
- + ":" + artifactItem.getArtifactId() + " in either dependency list or in project's dependency management." );
+ + ":" + artifactItem.getArtifactId()
+ + " in either dependency list or in project's dependency management." );
}
}
- //use classifer if set.
+ // use classifer if set.
String classifier = artifactItem.getClassifier();
if ( classifier == null || classifier.equals( "" ) )
@@ -176,13 +186,17 @@
}
/**
- * Tries to find missing version from dependancy list and dependency management.
- * If found, the artifact is updated with the correct version.
- * @param artifact representing configured file.
+ * Tries to find missing version from dependancy list and dependency
+ * management. If found, the artifact is updated with the correct version.
+ *
+ * @param artifact
+ * representing configured file.
*/
private void fillMissingArtifactVersion( ArtifactItem artifact )
{
- this.getLog().debug( "Attempting to find missing version in " + artifact.getGroupId() + ":" + artifact.getArtifactId() );
+ this.getLog().debug(
+ "Attempting to find missing version in " + artifact.getGroupId() + ":"
+ + artifact.getArtifactId() );
List list = this.project.getDependencies();
@@ -197,11 +211,11 @@
this.getLog().debug( "Found missing version: " + dependency.getVersion() + " in dependency list." );
artifact.setVersion( dependency.getVersion() );
-
+
return;
}
}
-
+
list = this.project.getDependencyManagement().getDependencies();
for ( int i = 0; i < list.size(); ++i )
@@ -212,11 +226,12 @@
&& dependency.getArtifactId().equals( artifact.getArtifactId() )
&& dependency.getType().equals( artifact.getType() ) )
{
- this.getLog().debug( "Found missing version: " + dependency.getVersion() + " in dependency management list" );
+ this.getLog().debug(
+ "Found missing version: " + dependency.getVersion()
+ + " in dependency management list" );
artifact.setVersion( dependency.getVersion() );
}
}
}
}
-
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java Tue Oct 3 21:11:00 2006
@@ -20,13 +20,16 @@
import org.apache.maven.artifact.Artifact;
/**
- * ArtifactItem represents information specified in the plugin configuration section for each artifact.
+ * ArtifactItem represents information specified in the plugin configuration
+ * section for each artifact.
+ *
* @author brianf
*/
public class ArtifactItem
{
/**
* Group Id of Artifact
+ *
* @parameter
* @required
*/
@@ -34,6 +37,7 @@
/**
* Name of Artifact
+ *
* @parameter
* @required
*/
@@ -41,12 +45,14 @@
/**
* Version of Artifact
+ *
* @parameter
*/
private String version = null;
/**
* Type of Artifact (War,Jar,etc)
+ *
* @parameter
* @required
*/
@@ -54,18 +60,21 @@
/**
* Classifier for Artifact (tests,sources,etc)
+ *
* @parameter
*/
private String classifier;
/**
* Location to use for this Artifact. Overrides default location.
+ *
* @parameter
*/
private File outputDirectory;
/**
* Provides ability to change destination file name
+ *
* @parameter
*/
private String destFileName;
@@ -94,7 +103,8 @@
}
/**
- * @param artifactId The artifactId to set.
+ * @param artifactId
+ * The artifactId to set.
*/
public void setArtifactId( String artifact )
{
@@ -110,7 +120,8 @@
}
/**
- * @param groupId The groupId to set.
+ * @param groupId
+ * The groupId to set.
*/
public void setGroupId( String groupId )
{
@@ -126,7 +137,8 @@
}
/**
- * @param type The type to set.
+ * @param type
+ * The type to set.
*/
public void setType( String type )
{
@@ -142,7 +154,8 @@
}
/**
- * @param version The version to set.
+ * @param version
+ * The version to set.
*/
public void setVersion( String version )
{
@@ -158,7 +171,8 @@
}
/**
- * @param classifier Classifier.
+ * @param classifier
+ * Classifier.
*/
public void setClassifier( String classifier )
{
@@ -179,7 +193,8 @@
}
/**
- * @param location The location to set.
+ * @param location
+ * The location to set.
*/
public void setOutputDirectory( File outputDirectory )
{
@@ -195,7 +210,8 @@
}
/**
- * @param destFileName The destFileName to set.
+ * @param destFileName
+ * The destFileName to set.
*/
public void setDestFileName( String destFileName )
{
@@ -211,7 +227,8 @@
}
/**
- * @param doOverWrite The doOverWrite to set.
+ * @param doOverWrite
+ * The doOverWrite to set.
*/
public void setDoOverWrite( boolean doOverWrite )
{
@@ -227,7 +244,8 @@
}
/**
- * @param overWriteSnapshots The overWriteSnapshots to set.
+ * @param overWriteSnapshots
+ * The overWriteSnapshots to set.
*/
public void setOverWrite( String overWrite )
{
@@ -243,7 +261,8 @@
}
/**
- * @param artifact The artifact to set.
+ * @param artifact
+ * The artifact to set.
*/
public void setArtifact( Artifact artifact )
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java Tue Oct 3 21:11:00 2006
@@ -23,12 +23,14 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+import org.apache.maven.plugin.logging.Log;
/**
- * Goal that copies a list of artifacts from the repository to defined locations.
- *
+ * Goal that copies a list of artifacts from the repository to defined
+ * locations.
+ *
* @goal copy
- *
+ *
* @phase process-sources
* @author brianf
*/
@@ -38,17 +40,18 @@
/**
* Strip artifact version during copy
- * @parameter expression="${stripVersion}" default-value="false"
+ *
+ * @parameter expression="${stripVersion}" default-value="false"
* @parameter
*/
private boolean stripVersion = false;
/**
- * Main entry into mojo. This method gets the ArtifactItems and iterates through each one passing
- * it to copyArtifact.
-
- * @throws MojoExecutionException
- * with a message if an error occurs.
+ * Main entry into mojo. This method gets the ArtifactItems and iterates
+ * through each one passing it to copyArtifact.
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
*
* @see ArtifactItem
* @see #getArtifactItems
@@ -67,13 +70,16 @@
}
/**
- * Resolves the artifact from the repository and copies it to the specified location.
- * @param artifactItem
- * containing the information about the Artifact to copy.
- * @param removeVersion
- * specifies if the version should be removed from the file name when copying.
- * @throws MojoExecutionException
- * with a message if an error occurs.
+ * Resolves the artifact from the repository and copies it to the specified
+ * location.
+ *
+ * @param artifactItem
+ * containing the information about the Artifact to copy.
+ * @param removeVersion
+ * specifies if the version should be removed from the file name
+ * when copying.
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
*
* @see DependencyUtil#copyFile(File, File, Log)
* @see DependencyUtil#getFormattedFileName(Artifact, boolean)
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java Tue Oct 3 21:11:00 2006
@@ -22,13 +22,14 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
/**
- * Goal that retrieves a list of artifacts from the repository and unpacks them in a defined location.
- *
+ * Goal that retrieves a list of artifacts from the repository and unpacks them
+ * in a defined location.
+ *
* @goal unpack
* @phase process-sources
* @author brianf
@@ -39,17 +40,18 @@
/**
* Directory to store flag files after unpack
- * @parameter expression="${project.build.directory}/dependency-maven-plugin-markers"
+ *
+ * @parameter expression="${project.build.directory}/dependency-maven-plugin-markers"
*/
private File markersDirectory;
/**
- * Main entry into mojo. This method gets the ArtifactItems and iterates through each one passing
- * it to unpackArtifact.
+ * Main entry into mojo. This method gets the ArtifactItems and iterates
+ * through each one passing it to unpackArtifact.
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
* @see ArtifactItem
* @see #getArtifactItems
* @see #unpackArtifact(ArtifactItem)
@@ -68,14 +70,16 @@
/**
* This method gets the Artifact object and calls DependencyUtil.unpackFile.
- * @param artifactItem
- * containing the information about the Artifact to unpack.
- *
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
+ *
+ * @param artifactItem
+ * containing the information about the Artifact to unpack.
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
+ *
* @see #getArtifact
- * @see DependencyUtil#unpackFile(Artifact, File, File, ArchiverManager, Log)
+ * @see DependencyUtil#unpackFile(Artifact, File, File, ArchiverManager,
+ * Log)
*/
private void unpackArtifact( ArtifactItem artifactItem )
throws MojoExecutionException
@@ -84,7 +88,7 @@
File location = artifactItem.getOutputDirectory();
- DependencyUtil.unpackFile( artifact, location, this.markersDirectory, this.archiverManager,
- this.getLog(), artifactItem.isDoOverWrite() );
+ DependencyUtil.unpackFile( artifact, location, this.markersDirectory, this.archiverManager, this.getLog(),
+ artifactItem.isDoOverWrite() );
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java Tue Oct 3 21:11:00 2006
@@ -25,8 +25,9 @@
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
/**
- * 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.
+ *
* @goal go-offline
* @execute goal=resolve-plugins
* @requiresDependencyResolution test
@@ -36,13 +37,13 @@
extends AbstractResolveMojo
{
-
/**
- * 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.
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
*/
public void execute()
throws MojoExecutionException
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java Tue Oct 3 21:11:00 2006
@@ -22,7 +22,7 @@
/**
* Goal that resolves the project dependencies from the repository.
- *
+ *
* @goal resolve
* @requiresDependencyResolution test
* @phase generate-sources
@@ -31,26 +31,27 @@
public class ResolveDependenciesMojo
extends AbstractResolveMojo
{
-
+
/**
* Only used to store results for integration test validation
*/
DependencyStatusSets results;
-
+
/**
- * 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.
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
*/
public void execute()
throws MojoExecutionException
{
- //get sets of dependencies
+ // get sets of dependencies
results = this.getDependencySets();
-
- results.logStatus(getLog(), outputArtifactFilename);
+
+ results.logStatus( getLog(), outputArtifactFilename );
}
/**
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java Tue Oct 3 21:11:00 2006
@@ -26,7 +26,7 @@
/**
* Goal that resolves the project source dependencies from the repository.
- *
+ *
* @goal sources
* @phase generate-sources
* @requiresDependencyResolution test
@@ -40,67 +40,71 @@
private static final String SOURCE_CLASSIFIER = "sources";
-
/**
* If the plugin should exclude Transitive dependencies.
+ *
* @parameter expression="${excludeTransitive}" default-value="false"
*/
private boolean excludeTransitive;
/**
- * The mojo compares artifact groupIds against this string using string.startsWith to see
- * if they should be resolved.
+ * The mojo compares artifact groupIds against this string using
+ * string.startsWith to see if they should be resolved.
+ *
* @parameter expression="${groupId}" default-value=""
*/
private String groupId;
-
+
/**
- * Directory to store flag files
- * @parameter expression="${dependency.MarkersDirectory}" default-value="${project.build.directory}/dependency-maven-plugin-markers"
+ * Directory to store flag files
+ *
+ * @parameter expression="${dependency.MarkersDirectory}"
+ * default-value="${project.build.directory}/dependency-maven-plugin-markers"
* @required
*/
private File markersDirectory;
-
+
/**
* Use Marker Files
- * @parameter expression="${dependency.useMarkers}" default-value="false"
+ *
+ * @parameter expression="${dependency.useMarkers}" default-value="false"
*/
private boolean useMarkers;
-
+
/**
- * 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.
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
*/
public void execute()
throws MojoExecutionException
{
// Loop through all artifacts
Set artifacts;
- if (!excludeTransitive)
+ if ( !excludeTransitive )
{
- artifacts = project.getArtifacts();
+ artifacts = project.getArtifacts();
}
else
{
artifacts = project.getDependencyArtifacts();
}
-
- if (groupId != null && !"".equals(groupId))
+
+ if ( groupId != null && !"".equals( groupId ) )
{
Iterator iter = artifacts.iterator();
- while(iter.hasNext())
+ while ( iter.hasNext() )
{
Artifact artifact = (Artifact) iter.next();
- if (!artifact.getGroupId().startsWith(groupId))
+ if ( !artifact.getGroupId().startsWith( groupId ) )
{
iter.remove();
}
}
}
-
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java Tue Oct 3 21:11:00 2006
@@ -24,14 +24,14 @@
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.apache.maven.plugin.dependency.AbstractResolveMojo;
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.artifact.InvalidDependencyVersionException;
/**
* Goal that resolves all project plugins and reports and their dependencies.
- *
+ *
* @goal resolve-plugins
* @phase generate-sources
* @author brianf
@@ -40,7 +40,6 @@
extends AbstractResolveMojo
{
-
/**
* Remote repositories which will be searched for plugins.
*
@@ -52,24 +51,26 @@
/**
* If we should exclude transitive dependencies
+ *
* @parameter expression="${excludeTransitive}" default-value="false"
*/
private boolean excludeTransitive;
/**
- * 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.
*
- * @throws MojoExecutionException
- * with a message if an error occurs.
- *
*/
public void execute()
throws MojoExecutionException
{
try
{
- Set plugins = DependencyUtil.resolvePluginArtifacts( project, factory, local,
- remotePluginRepositories, resolver );
+ Set plugins = DependencyUtil.resolvePluginArtifacts( project, factory, local, remotePluginRepositories,
+ resolver );
for ( Iterator i = plugins.iterator(); i.hasNext(); )
{
Artifact plugin = (Artifact) i.next();
@@ -79,9 +80,9 @@
}
if ( !excludeTransitive )
{
- Set transitiveDependencies = DependencyUtil
- .resolveArtifactDependencies( plugin, factory, local,
- remoteRepos, resolver, mavenProjectBuilder );
+ Set transitiveDependencies = DependencyUtil.resolveArtifactDependencies( plugin, factory, local,
+ remoteRepos, resolver,
+ mavenProjectBuilder );
if ( !silent )
{
for ( Iterator transIter = transitiveDependencies.iterator(); transIter.hasNext(); )
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java Tue Oct 3 21:11:00 2006
@@ -28,7 +28,7 @@
/**
* @author brianf
- *
+ *
*/
public class DependencyStatusSets
{
@@ -60,7 +60,8 @@
}
/**
- * @param resolvedDependencies The resolvedDependencies to set.
+ * @param resolvedDependencies
+ * The resolvedDependencies to set.
*/
public void setResolvedDependencies( Set resolvedDependencies )
{
@@ -76,7 +77,8 @@
}
/**
- * @param skippedDependencies The skippedDependencies to set.
+ * @param skippedDependencies
+ * The skippedDependencies to set.
*/
public void setSkippedDependencies( Set skippedDependencies )
{
@@ -92,7 +94,8 @@
}
/**
- * @param unResolvedDependencies The unResolvedDependencies to set.
+ * @param unResolvedDependencies
+ * The unResolvedDependencies to set.
*/
public void setUnResolvedDependencies( Set unResolvedDependencies )
{
@@ -109,24 +112,24 @@
}
else
{
- SortedSet sortedResolvedDependencies = new TreeSet();
- sortedResolvedDependencies.addAll(resolvedDependencies);
+ SortedSet sortedResolvedDependencies = new TreeSet();
+ sortedResolvedDependencies.addAll( resolvedDependencies );
for ( Iterator i = sortedResolvedDependencies.iterator(); i.hasNext(); )
{
Artifact artifact = (Artifact) i.next();
String artifactFilename = null;
- if (outputArtifactFilename)
+ if ( outputArtifactFilename )
{
try
- {
+ {
artifact.getFile().getAbsoluteFile();
}
- catch (NullPointerException e)
+ catch ( NullPointerException e )
{
- //ignore the null pointer, we'll output a null string
+ // ignore the null pointer, we'll output a null string
}
}
- log.info( " " + artifact.getId() + (outputArtifactFilename ? ":" + artifactFilename : ""));
+ log.info( " " + artifact.getId() + ( outputArtifactFilename ? ":" + artifactFilename : "" ) );
}
}
@@ -135,7 +138,7 @@
log.info( "" );
log.info( "The following files where skipped: " );
SortedSet sortedSkippedDependencies = new TreeSet();
- sortedSkippedDependencies.addAll(this.skippedDependencies);
+ sortedSkippedDependencies.addAll( this.skippedDependencies );
for ( Iterator i = sortedSkippedDependencies.iterator(); i.hasNext(); )
{
log.info( " " + ( (Artifact) i.next() ).getId() );
@@ -147,7 +150,7 @@
{
log.info( "The following files have NOT been resolved: " );
SortedSet sortedUnResolvedDependencies = new TreeSet();
- sortedUnResolvedDependencies.addAll(this.unResolvedDependencies);
+ sortedUnResolvedDependencies.addAll( this.unResolvedDependencies );
for ( Iterator i = sortedUnResolvedDependencies.iterator(); i.hasNext(); )
{
log.info( " " + ( (Artifact) i.next() ).getId() );
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java Tue Oct 3 21:11:00 2006
@@ -29,25 +29,26 @@
/**
* Utility class with static helper methods
+ *
* @author brianf
- *
+ *
*/
public class DependencyUtil
{
/**
* Does the actual copy of the file and logging.
*
- * @param artifact
- * represents the file to copy.
- * @param destFile
- * file name of destination file.
- * @param log
- * to use for output.
+ * @param artifact
+ * represents the file to copy.
+ * @param destFile
+ * file name of destination file.
+ * @param log
+ * to use for output.
* @param overWriteSnapshots
- * force Over Writing of the file
- *
- * @throws MojoExecutionException
- * with a message if an error occurs.
+ * force Over Writing of the file
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
*/
public static boolean copyFile( File artifact, File destFile, Log log, boolean overWrite )
throws MojoExecutionException
@@ -75,13 +76,13 @@
}
/**
- * Unpacks the archive file, checking for a marker file to see if it should unpack again. Creates the marker
- * file after unpacking.
- *
+ * Unpacks the archive file, checking for a marker file to see if it should
+ * unpack again. Creates the marker file after unpacking.
+ *
* @param Artifact
- * File to be unpacked.
+ * File to be unpacked.
* @param unpackDirectory
- * Location where to put the unpacked files.
+ * Location where to put the unpacked files.
*/
public static void unpackFile( Artifact artifact, File unpackDirectory, File markersDirectory,
ArchiverManager archiverManager, Log log, boolean overWrite )
@@ -99,7 +100,7 @@
unpack( artifact.getFile(), unpackDirectory, archiverManager, log );
- //create marker file
+ // create marker file
markerFile.getParentFile().mkdirs();
markerFile.createNewFile();
}
@@ -116,11 +117,11 @@
/**
* Unpacks the archive file.
- *
+ *
* @param file
- * File to be unpacked.
+ * File to be unpacked.
* @param location
- * Location where to put the unpacked files.
+ * Location where to put the unpacked files.
*/
private static void unpack( File file, File location, ArchiverManager archiverManager, Log log )
throws MojoExecutionException
@@ -153,16 +154,16 @@
}
/**
- * Builds the file name. If removeVersion is set, then the file name must be reconstructed
- * from the artifactId, Classifier (if used) and Type. Otherwise, this method returns the
- * artifact file name.
+ * Builds the file name. If removeVersion is set, then the file name must be
+ * reconstructed from the artifactId, Classifier (if used) and Type.
+ * Otherwise, this method returns the artifact file name.
*
* @param artifact
- * File to be formatted.
+ * File to be formatted.
* @param removeVersion
- * Specifies if the version should be removed from the file name.
- * @return
- * Formatted file name in the format artifactId-[classifier-][version].[type]
+ * Specifies if the version should be removed from the file name.
+ * @return Formatted file name in the format
+ * artifactId-[classifier-][version].[type]
*/
public static String getFormattedFileName( Artifact artifact, boolean removeVersion )
{
@@ -174,10 +175,10 @@
{
destFileName = file.getName();
}
- //so it can be used offline
+ // so it can be used offline
else
{
- if ( StringUtils.isNotEmpty(artifact.getClassifier()))
+ if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
{
destFileName = artifact.getArtifactId() + "-" + artifact.getClassifier() + "-"
+ artifact.getVersion() + "." + artifact.getType();
@@ -206,15 +207,15 @@
/**
* Formats the outputDirectory based on type.
*
- * @param useSubdirsPerType
- * if a new sub directory should be used for each type.
- * @param useSubdirsPerArtifact
- * if a new sub directory should be used for each artifact.
+ * @param useSubdirsPerType
+ * if a new sub directory should be used for each type.
+ * @param useSubdirsPerArtifact
+ * if a new sub directory should be used for each artifact.
* @param outputDirectory
- * base outputDirectory.
+ * base outputDirectory.
* @param artifact
- * information about the artifact.
- *
+ * information about the artifact.
+ *
* @return a formatted File object to use for output.
*/
public static File getFormattedOutputDirectory( boolean useSubdirsPerType, boolean useSubdirPerArtifact,
@@ -222,7 +223,7 @@
{
File result = null;
- //get id but convert the chars so it's safe as a folder name.
+ // get id but convert the chars so it's safe as a folder name.
String artifactId = artifact.getId().replace( ':', '-' );
if ( !useSubdirsPerType )
{
@@ -259,11 +260,11 @@
* Log the results
*
* @param resolvedArtifacts
- * set of artifacts that where resolved.
+ * set of artifacts that where resolved.
* @param missingArtifacts
- * set of artifacts that where not resolved.
- * @param existingArtifacts
- * set of artifacts that already existed.
+ * set of artifacts that where not resolved.
+ * @param existingArtifacts
+ * set of artifacts that already existed.
*/
private static void logResults( Set resolvedArtifacts, Set missingArtifacts, HashSet existingArtifacts,
boolean silent, Log log )
@@ -314,16 +315,16 @@
* This method resolves the plugin artifacts from the project.
*
* @param project
- * The POM.
+ * The POM.
* @param artifactFactory
- * component to build artifact objects.
+ * component to build artifact objects.
* @param localRepository
- * where to resolve artifacts.
+ * where to resolve artifacts.
* @param remotePluginRepositories
- * list of remote repositories used to resolve plugins.
+ * list of remote repositories used to resolve plugins.
* @param artifactResolver
- * component used to resolve artifacts.
- *
+ * component used to resolve artifacts.
+ *
* @return set of resolved plugin artifacts.
*
* @throws ArtifactResolutionException
@@ -351,23 +352,23 @@
}
/**
- * This method resolves the dependency artifacts from the project.
+ * This method resolves the dependency artifacts from the project.
+ *
* @param project
- * The POM.
+ * The POM.
* @param artifactFactory
- * component to build artifact objects.
+ * component to build artifact objects.
* @param localRepository
- * where to resolve artifacts.
+ * where to resolve artifacts.
* @param remoteArtifactRepositories
- * list of remote repositories used to resolve artifacts.
+ * list of remote repositories used to resolve artifacts.
* @param artifactResolver
- * component used to resolve artifacts.
- * @return
- * resolved set of dependency artifacts.
- *
+ * component used to resolve artifacts.
+ * @return resolved set of dependency artifacts.
+ *
* @throws ArtifactResolutionException
* @throws ArtifactNotFoundException
- * @throws InvalidDependencyVersionException
+ * @throws InvalidDependencyVersionException
*/
public static Set resolveDependencyArtifacts( MavenProject project, ArtifactFactory artifactFactory,
ArtifactRepository localRepository, List remoteArtifactRepositories,
@@ -388,19 +389,20 @@
/**
* This method resolves all transitive dependencies of an artifact.
+ *
* @param artifact
- * the artifact used to retrieve dependencies
+ * the artifact used to retrieve dependencies
* @param artifactFactory
- * component to build artifact objects.
+ * component to build artifact objects.
* @param localRepository
- * where to resolve artifacts.
+ * where to resolve artifacts.
* @param remoteArtifactRepositories
- * list of remote repositories used to resolve artifacts.
+ * list of remote repositories used to resolve artifacts.
* @param artifactResolver
- * component used to resolve artifacts.
+ * component used to resolve artifacts.
* @param mavenProjectBuilder
- * component used to build a pom artifact.
- *
+ * component used to build a pom artifact.
+ *
* @return resolved set of dependencies
*
* @throws ArtifactResolutionException
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/SilentLog.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/SilentLog.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/SilentLog.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/SilentLog.java Tue Oct 3 21:11:00 2006
@@ -12,7 +12,7 @@
}
public void debug( CharSequence content )
- {
+ {
}
public void debug( CharSequence content, Throwable error )
@@ -72,5 +72,5 @@
public void error( Throwable error )
{
- }
+ }
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactsFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactsFilter.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactsFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactsFilter.java Tue Oct 3 21:11:00 2006
@@ -25,10 +25,11 @@
/**
* @author brianf
- *
+ *
*/
public interface ArtifactsFilter
{
- public Set filter (Set artifacts , Log log) throws MojoExecutionException;
-
+ public Set filter( Set artifacts, Log log )
+ throws MojoExecutionException;
+
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java Tue Oct 3 21:11:00 2006
@@ -22,85 +22,90 @@
import java.util.Iterator;
import java.util.Set;
-import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
/**
* @author brianf
- *
+ *
*/
public class FilterArtifacts
{
- private ArrayList filters = new ArrayList();
-
- public FilterArtifacts()
- {
- filters = new ArrayList();
- }
-
- /**
- * Removes all of the elements from this list. The list will
- * be empty after this call returns.
- */
- public void clearFilters()
- {
- filters.clear();
- }
-
- /**
- * Appends the specified element to the end of this list.
- *
- * @param o element to be appended to this list.
- * @return <tt>true</tt> (as per the general contract of Collection.add).
- */
- public void addFilter(ArtifactsFilter filter)
- {
- filters.add(filter);
- }
-
- /**
- * Inserts the specified element at the specified position in this
- * list. Shifts the element currently at that position (if any) and
- * any subsequent elements to the right (adds one to their indices).
- *
- * @param index index at which the specified element is to be inserted.
- * @param element element to be inserted.
- * @throws IndexOutOfBoundsException if index is out of range
- * <tt>(index < 0 || index > size())</tt>.
- */
- public void addFilter(int index, ArtifactsFilter filter)
- {
- filters.add(index,filter);
- }
-
- public Set filter(Set artifacts, Log log) throws MojoExecutionException
- {
- //apply filters
- Iterator filterIterator = filters.iterator();
- while ( filterIterator.hasNext() )
- {
- //log(artifacts,log);
- ArtifactsFilter filter = (ArtifactsFilter) filterIterator.next();
- artifacts = filter.filter( artifacts, log );
- }
-
- return artifacts;
- }
-
-/**
- * @return Returns the filters.
- */
-public ArrayList getFilters()
-{
- return this.filters;
-}
+ private ArrayList filters = new ArrayList();
-/**
- * @param filters The filters to set.
- */
-public void setFilters( ArrayList filters )
-{
- this.filters = filters;
-}
+ public FilterArtifacts()
+ {
+ filters = new ArrayList();
+ }
+
+ /**
+ * Removes all of the elements from this list. The list will be empty after
+ * this call returns.
+ */
+ public void clearFilters()
+ {
+ filters.clear();
+ }
+
+ /**
+ * Appends the specified element to the end of this list.
+ *
+ * @param o
+ * element to be appended to this list.
+ * @return <tt>true</tt> (as per the general contract of Collection.add).
+ */
+ public void addFilter( ArtifactsFilter filter )
+ {
+ filters.add( filter );
+ }
+
+ /**
+ * Inserts the specified element at the specified position in this list.
+ * Shifts the element currently at that position (if any) and any subsequent
+ * elements to the right (adds one to their indices).
+ *
+ * @param index
+ * index at which the specified element is to be inserted.
+ * @param element
+ * element to be inserted.
+ * @throws IndexOutOfBoundsException
+ * if index is out of range
+ * <tt>(index < 0 || index > size())</tt>.
+ */
+ public void addFilter( int index, ArtifactsFilter filter )
+ {
+ filters.add( index, filter );
+ }
+
+ public Set filter( Set artifacts, Log log )
+ throws MojoExecutionException
+ {
+ // apply filters
+ Iterator filterIterator = filters.iterator();
+ while ( filterIterator.hasNext() )
+ {
+ // log(artifacts,log);
+ ArtifactsFilter filter = (ArtifactsFilter) filterIterator.next();
+ artifacts = filter.filter( artifacts, log );
+ }
+
+ return artifacts;
+ }
+
+ /**
+ * @return Returns the filters.
+ */
+ public ArrayList getFilters()
+ {
+ return this.filters;
+ }
+
+ /**
+ * @param filters
+ * The filters to set.
+ */
+ public void setFilters( ArrayList filters )
+ {
+ this.filters = filters;
+ }
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java Tue Oct 3 21:11:00 2006
@@ -25,13 +25,13 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler;
import org.apache.maven.plugin.dependency.utils.markers.MarkerHandler;
+import org.apache.maven.plugin.logging.Log;
/**
* @author brianf
- *
+ *
*/
public class MarkerFileFilter
implements ArtifactsFilter
@@ -40,12 +40,13 @@
boolean overWriteReleases;
boolean overWriteSnapshots;
-
+
boolean overWriteIfNewer;
File markerFileDirectory;
- public MarkerFileFilter( boolean overWriteReleases, boolean overWriteSnapshots, boolean overWriteIfNewer, File markerFileDirectory )
+ public MarkerFileFilter( boolean overWriteReleases, boolean overWriteSnapshots, boolean overWriteIfNewer,
+ File markerFileDirectory )
{
this.overWriteReleases = overWriteReleases;
this.overWriteSnapshots = overWriteSnapshots;
@@ -53,8 +54,11 @@
this.markerFileDirectory = markerFileDirectory;
}
- /* (non-Javadoc)
- * @see org.apache.mojo.dependency.utils.filters.ArtifactsFilter#filter(java.util.Set, org.apache.maven.plugin.logging.Log)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.mojo.dependency.utils.filters.ArtifactsFilter#filter(java.util.Set,
+ * org.apache.maven.plugin.logging.Log)
*/
public Set filter( Set artifacts, Log log )
throws MojoExecutionException
@@ -64,7 +68,7 @@
boolean overWrite = false;
Iterator iter = artifacts.iterator();
- //log.debug("Artifacts:"+ artifacts.size());
+ // log.debug("Artifacts:"+ artifacts.size());
while ( iter.hasNext() )
{
Artifact artifact = (Artifact) iter.next();
@@ -75,7 +79,7 @@
}
MarkerHandler marker = new DefaultFileMarkerHandler( artifact, markerFileDirectory );
- if ( overWrite || (!marker.isMarkerSet() || (overWriteIfNewer && marker.isMarkerOlder(artifact))) )
+ if ( overWrite || ( !marker.isMarkerSet() || ( overWriteIfNewer && marker.isMarkerOlder( artifact ) ) ) )
{
result.add( artifact );
}
@@ -92,7 +96,8 @@
}
/**
- * @param overWriteReleases The overWriteReleases to set.
+ * @param overWriteReleases
+ * The overWriteReleases to set.
*/
public void setOverWriteReleases( boolean overWriteReleases )
{
@@ -108,7 +113,8 @@
}
/**
- * @param overWriteSnapshots The overWriteSnapshots to set.
+ * @param overWriteSnapshots
+ * The overWriteSnapshots to set.
*/
public void setOverWriteSnapshots( boolean overWriteSnapshots )
{
@@ -124,7 +130,8 @@
}
/**
- * @param markerFileDirectory The markerFileDirectory to set.
+ * @param markerFileDirectory
+ * The markerFileDirectory to set.
*/
public void setMarkerFileDirectory( File markerFileDirectory )
{
@@ -140,7 +147,8 @@
}
/**
- * @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/plugin/dependency/utils/filters/ScopeFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java Tue Oct 3 21:11:00 2006
@@ -56,15 +56,13 @@
if ( StringUtils.isNotEmpty( includeScope ) )
{
- if (!Artifact.SCOPE_COMPILE.equals(includeScope)&&
- !Artifact.SCOPE_TEST.equals(includeScope)&&
- !Artifact.SCOPE_PROVIDED.equals(includeScope)&&
- !Artifact.SCOPE_RUNTIME.equals(includeScope)&&
- !Artifact.SCOPE_SYSTEM.equals(includeScope))
+ if ( !Artifact.SCOPE_COMPILE.equals( includeScope ) && !Artifact.SCOPE_TEST.equals( includeScope )
+ && !Artifact.SCOPE_PROVIDED.equals( includeScope ) && !Artifact.SCOPE_RUNTIME.equals( includeScope )
+ && !Artifact.SCOPE_SYSTEM.equals( includeScope ) )
{
- throw new MojoExecutionException("Invalid Scope in includeScope: "+ includeScope);
+ throw new MojoExecutionException( "Invalid Scope in includeScope: " + includeScope );
}
-
+
results = new HashSet();
if ( Artifact.SCOPE_PROVIDED.equals( includeScope ) || Artifact.SCOPE_SYSTEM.equals( includeScope ) )
@@ -88,13 +86,11 @@
}
else if ( StringUtils.isNotEmpty( excludeScope ) )
{
- if (!Artifact.SCOPE_COMPILE.equals(excludeScope)&&
- !Artifact.SCOPE_TEST.equals(excludeScope)&&
- !Artifact.SCOPE_PROVIDED.equals(excludeScope)&&
- !Artifact.SCOPE_RUNTIME.equals(excludeScope)&&
- !Artifact.SCOPE_SYSTEM.equals(excludeScope))
+ if ( !Artifact.SCOPE_COMPILE.equals( excludeScope ) && !Artifact.SCOPE_TEST.equals( excludeScope )
+ && !Artifact.SCOPE_PROVIDED.equals( excludeScope ) && !Artifact.SCOPE_RUNTIME.equals( excludeScope )
+ && !Artifact.SCOPE_SYSTEM.equals( excludeScope ) )
{
- throw new MojoExecutionException("Invalid Scope in excludeScope: "+ excludeScope);
+ throw new MojoExecutionException( "Invalid Scope in excludeScope: " + excludeScope );
}
results = new HashSet();
// plexus ScopeArtifactFilter doesn't handle the provided scope so
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.java?view=diff&rev=452716&r1=452715&r2=452716
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.java Tue Oct 3 21:11:00 2006
@@ -30,9 +30,8 @@
private boolean excludeTransitive;
private Set directDependencies;
-
- public TransitivityFilter( Set directDependencies, boolean excludeTransitive)
+ public TransitivityFilter( Set directDependencies, boolean excludeTransitive )
{
this.excludeTransitive = excludeTransitive;
this.directDependencies = directDependencies;
@@ -40,14 +39,14 @@
public Set filter( Set artifacts, Log log )
{
- //why not just take the directDependencies here?
- //because if this filter is run after some other process, the
- //set of artifacts may not be the same as the directDependencies.
+ // why not just take the directDependencies here?
+ // because if this filter is run after some other process, the
+ // set of artifacts may not be the same as the directDependencies.
Set result = artifacts;
if ( excludeTransitive )
{
- log.debug("Excluding Transitive Dependencies.");
+ log.debug( "Excluding Transitive Dependencies." );
result = new HashSet();
Iterator iterator = artifacts.iterator();
while ( iterator.hasNext() )
@@ -56,23 +55,25 @@
if ( artifactIsADirectDependency( artifact ) )
{
result.add( artifact );
- log.debug("Added: "+artifact);
+ log.debug( "Added: " + artifact );
}
}
- log.debug("Added "+ result.size());
+ log.debug( "Added " + result.size() );
}
else
{
- log.debug("Including Transitive Dependencies.");
+ log.debug( "Including Transitive Dependencies." );
}
return result;
}
/**
- * Compares the artifact to the list of dependencies to see if it is directly included by this project
+ * Compares the artifact to the list of dependencies to see if it is
+ * directly included by this project
+ *
* @param artifact
- * representing the item to compare.
+ * representing the item to compare.
* @return true if artifact is a direct dependency
*/
public boolean artifactIsADirectDependency( Artifact artifact )
@@ -101,7 +102,8 @@
}
/**
- * @param excludeTransitive The excludeTransitive to set.
+ * @param excludeTransitive
+ * The excludeTransitive to set.
*/
public void setExcludeTransitive( boolean excludeTransitive )
{