You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2013/08/27 20:25:11 UTC
svn commit: r1517906 [9/24] - in /maven/plugins/trunk:
maven-acr-plugin/src/main/java/org/apache/maven/plugin/acr/
maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/
maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/
maven-antru...
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?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- 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 Aug 27 18:25:03 2013
@@ -52,7 +52,7 @@ import java.util.Set;
/**
* Remove the project dependencies from the local repository, and optionally re-resolve them.
- *
+ *
* @author jdcasey
* @version $Id$
* @since 2.0
@@ -81,7 +81,7 @@ public class PurgeLocalRepositoryMojo
* repository. Note that using this parameter will deactivate the normal process for purging the current project
* dependency tree. If this parameter is used, only the included artifacts will be purged. The manualIncludes
* parameter should not be used in combination with the includes/excludes parameters.
- *
+ *
* @since 2.6
*/
@Parameter
@@ -91,7 +91,7 @@ public class PurgeLocalRepositoryMojo
* Comma-separated list of groupId:artifactId entries, which should be used to manually include artifacts for
* deletion. This is a command-line alternative to the <code>manualIncludes</code> parameter, since List parameters
* are not currently compatible with CLI specification.
- *
+ *
* @since 2.6
*/
@Parameter( property = "manualInclude" )
@@ -99,7 +99,7 @@ public class PurgeLocalRepositoryMojo
/**
* The list of dependencies in the form of groupId:artifactId which should BE deleted/refreshed.
- *
+ *
* @since 2.6
*/
@Parameter
@@ -109,7 +109,7 @@ public class PurgeLocalRepositoryMojo
* Comma-separated list of groupId:artifactId entries, which should be used to include artifacts for
* deletion/refresh. This is a command-line alternative to the <code>includes</code> parameter, since List
* parameters are not currently compatible with CLI specification.
- *
+ *
* @since 2.6
*/
@Parameter( property = "include" )
@@ -192,7 +192,7 @@ public class PurgeLocalRepositoryMojo
/**
* Whether to purge only snapshot artifacts.
- *
+ *
* @since 2.4
*/
@Parameter( property = "snapshotsOnly", defaultValue = "false" )
@@ -219,9 +219,9 @@ public class PurgeLocalRepositoryMojo
/**
* Default constructor
- *
+ *
* @param directDependencyArtifacts Set of Artifact objects which represent the direct dependencies of the
- * project
+ * project
*/
public DirectDependencyFilter( Artifact projectArtifact, Set<Artifact> directDependencyArtifacts )
{
@@ -365,7 +365,7 @@ public class PurgeLocalRepositoryMojo
/**
* Purge/Delete artifacts from the local repository according to the given patterns.
- *
+ *
* @param inclusionPatterns
* @throws MojoExecutionException
*/
@@ -404,7 +404,7 @@ public class PurgeLocalRepositoryMojo
/**
* Convert a groupId:artifactId:version to a file system path
- *
+ *
* @param gav, the groupId:artifactId:version string
* @return
*/
@@ -421,7 +421,7 @@ public class PurgeLocalRepositoryMojo
for ( int i = 1; i < pathComponents.length; ++i )
{
- path.append( "/" ).append( pathComponents[i] );
+ path.append("/").append(pathComponents[i]);
}
return path.toString();
@@ -430,9 +430,9 @@ public class PurgeLocalRepositoryMojo
/**
* Create the includes exclude filter to use when resolving and purging dependencies Also excludes any "system"
* scope dependencies
- *
+ *
* @param dependencyArtifacts The dependency artifacts to use as a reference if we're excluding transitive
- * dependencies
+ * dependencies
* @return
*/
private ArtifactFilter createPurgeArtifactsFilter( Set<Artifact> dependencyArtifacts )
@@ -476,7 +476,7 @@ public class PurgeLocalRepositoryMojo
/**
* Convert comma separated list of includes to List object
- *
+ *
* @param include
* @return the includes list
*/
@@ -502,7 +502,8 @@ public class PurgeLocalRepositoryMojo
resolver.resolveTransitively( artifacts, project.getArtifact(), localRepository, remoteRepositories,
metadataSource, filter );
- @SuppressWarnings( "unchecked" ) Set<Artifact> resolvedArtifacts = result.getArtifacts();
+ @SuppressWarnings( "unchecked" )
+ Set<Artifact> resolvedArtifacts = result.getArtifacts();
return resolvedArtifacts;
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AbstractAnalyzeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AbstractAnalyzeMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AbstractAnalyzeMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AbstractAnalyzeMojo.java Tue Aug 27 18:25:03 2013
@@ -70,7 +70,7 @@ public abstract class AbstractAnalyzeMoj
/**
* Specify the project dependency analyzer to use (plexus component role-hint).
* By default, <a href="/shared/maven-dependency-analyzer/">maven-dependency-analyzer</a> is used.
- * <p/>
+ *
* To use this, you must declare a dependency for this plugin that contains the code for the
* analyzer. The analyzer must have a declared Plexus role name, and you specify the role name
* here.
@@ -141,7 +141,7 @@ public abstract class AbstractAnalyzeMoj
/**
* Force dependencies as used, to override incomplete result caused by bytecode-level analysis.
* Dependency format is <code>groupId:artifactId</code>.
- *
+ *
* @since 2.6
*/
@Parameter
@@ -378,10 +378,7 @@ public abstract class AbstractAnalyzeMoj
// called because artifact will set the version to -SNAPSHOT only if I do this. MNG-2961
artifact.isSnapshot();
- buf.append( scriptableFlag ).append( ":" ).append( pomFile ).append( ":" ).append(
- artifact.getDependencyConflictId() ).append( ":" ).append( artifact.getClassifier() ).append(
- ":" ).append( artifact.getBaseVersion() ).append( ":" ).append( artifact.getScope() ).append(
- "\n" );
+ buf.append(scriptableFlag).append(":").append(pomFile).append(":").append(artifact.getDependencyConflictId()).append(":").append(artifact.getClassifier()).append(":").append(artifact.getBaseVersion()).append(":").append(artifact.getScope()).append("\n");
}
getLog().info( "\n" + buf );
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeDuplicateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeDuplicateMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeDuplicateMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeDuplicateMojo.java Tue Aug 27 18:25:03 2013
@@ -118,7 +118,7 @@ public class AnalyzeDuplicateMojo
{
String dup = it.next();
- sb.append( "\to " ).append( dup );
+ sb.append("\to ").append(dup);
if ( it.hasNext() )
{
sb.append( "\n" );
@@ -138,7 +138,7 @@ public class AnalyzeDuplicateMojo
{
String dup = it.next();
- sb.append( "\to " ).append( dup );
+ sb.append("\to ").append(dup);
if ( it.hasNext() )
{
sb.append( "\n" );
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeReportMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeReportMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeReportMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/analyze/AnalyzeReportMojo.java Tue Aug 27 18:25:03 2013
@@ -80,7 +80,6 @@ public class AnalyzeReportMojo
/**
* Ignore Runtime/Provided/Test/System scopes for unused dependency analysis
- *
* @since 2.2
*/
@Parameter( property = "ignoreNonCompile", defaultValue = "false" )
@@ -89,7 +88,7 @@ public class AnalyzeReportMojo
/**
* Force dependencies as used, to override incomplete result caused by bytecode-level analysis.
* Dependency format is <code>groupId:artifactId</code>.
- *
+ *
* @since 2.6
*/
@Parameter
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/AbstractDependencyFilterMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/AbstractDependencyFilterMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/AbstractDependencyFilterMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/AbstractDependencyFilterMojo.java Tue Aug 27 18:25:03 2013
@@ -122,7 +122,7 @@ public abstract class AbstractDependency
* <li><code>provided</code> scope just gives provided dependencies,</li>
* <li><code>system</code> scope just gives system dependencies.</li>
* </ul>
- *
+ *
* @since 2.0
*/
@Parameter( property = "includeScope", defaultValue = "" )
@@ -225,7 +225,7 @@ public abstract class AbstractDependency
/**
* Return an {@link ArtifactsFilter} indicating which artifacts must be filtered out.
- *
+ *
* @return an {@link ArtifactsFilter} indicating which artifacts must be filtered out.
*/
protected abstract ArtifactsFilter getMarkedArtifactFilter();
@@ -371,7 +371,6 @@ public abstract class AbstractDependency
}
}
}
-
/**
* Transform artifacts
*
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/BuildClasspathMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/BuildClasspathMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/BuildClasspathMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/BuildClasspathMojo.java Tue Aug 27 18:25:03 2013
@@ -72,7 +72,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).
@@ -95,7 +95,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].
*/
@@ -157,7 +157,6 @@ public class BuildClasspathMojo
/**
* 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" )
@@ -231,7 +230,7 @@ public class BuildClasspathMojo
while ( i.hasNext() )
{
sb.append( isPathSepSet ? this.pathSeparator : File.pathSeparator );
- appendArtifactPath( i.next(), sb );
+ appendArtifactPath(i.next(), sb );
}
}
@@ -314,9 +313,7 @@ public class BuildClasspathMojo
// TODO: add param for prepending groupId and version.
sb.append( prefix );
sb.append( File.separator );
- sb.append(
- DependencyUtil.getFormattedFileName( art, this.stripVersion, this.prependGroupId, this.useBaseVersion,
- this.stripClassifier ) );
+ sb.append( DependencyUtil.getFormattedFileName( art, this.stripVersion, this.prependGroupId, this.useBaseVersion, this.stripClassifier ) );
}
}
@@ -332,7 +329,7 @@ public class BuildClasspathMojo
try
{
String oldCp = readClasspathFile();
- return ( cpString.equals( oldCp ) || ( cpString != null && cpString.equals( oldCp ) ) );
+ return (cpString.equals(oldCp) || ( cpString != null && cpString.equals( oldCp ) ) );
}
catch ( Exception ex )
{
@@ -376,7 +373,7 @@ public class BuildClasspathMojo
/**
* Reads into a string the file specified by the mojo param 'outputFile'. Assumes, the instance variable
* 'outputFile' is not null.
- *
+ *
* @return the string contained in the classpathFile, if exists, or null otherwise.
* @throws MojoExecutionException
*/
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/DOTDependencyNodeVisitor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/DOTDependencyNodeVisitor.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/DOTDependencyNodeVisitor.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/DOTDependencyNodeVisitor.java Tue Aug 27 18:25:03 2013
@@ -64,7 +64,7 @@ public class DOTDependencyNodeVisitor
for ( DependencyNode child : children )
{
- writer.println( "\t\"" + node.toNodeString() + "\" -> \"" + child.toNodeString() + "\" ; " );
+ writer.println("\t\"" + node.toNodeString() + "\" -> \"" + child.toNodeString() + "\" ; ");
}
return true;
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/tree/TreeMojo.java Tue Aug 27 18:25:03 2013
@@ -153,16 +153,16 @@ public class TreeMojo
/**
* A comma-separated list of artifacts to filter the serialized dependency tree by, or <code>null</code> not to
* filter the dependency tree. The filter syntax is:
- * <p/>
+ *
* <pre>
* [groupId]:[artifactId]:[type]:[version]
* </pre>
- * <p/>
+ *
* 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>
- *
+ *
* @see StrictPatternIncludesArtifactFilter
* @since 2.0-alpha-6
*/
@@ -172,11 +172,11 @@ public class TreeMojo
/**
* A comma-separated list of artifacts to filter from the serialized dependency tree, or <code>null</code> not to
* filter any artifacts from the dependency tree. The filter syntax is:
- * <p/>
+ *
* <pre>
* [groupId]:[artifactId]:[type]:[version]
* </pre>
- * <p/>
+ *
* 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
@@ -243,8 +243,10 @@ public class TreeMojo
if ( verbose )
{
// verbose mode force Maven 2 dependency tree component use
- dependencyTreeString = serializeVerboseDependencyTree(
- dependencyTreeBuilder.buildDependencyTree( project, localRepository, artifactFilter ) );
+ dependencyTreeString =
+ serializeVerboseDependencyTree( dependencyTreeBuilder.buildDependencyTree( project,
+ localRepository,
+ artifactFilter ) );
}
else
{
@@ -383,14 +385,12 @@ public class TreeMojo
org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor visitor =
new org.apache.maven.shared.dependency.tree.traversal.SerializingDependencyNodeVisitor( writer,
- toTreeTokens(
- tokens ) );
+ toTreeTokens( tokens ) );
// TODO: remove the need for this when the serializer can calculate last nodes from visitor calls only
visitor = new org.apache.maven.shared.dependency.tree.traversal.BuildingDependencyNodeVisitor( visitor );
- org.apache.maven.shared.dependency.tree.filter.DependencyNodeFilter filter =
- createVerboseDependencyNodeFilter();
+ org.apache.maven.shared.dependency.tree.filter.DependencyNodeFilter filter = createVerboseDependencyNodeFilter();
if ( filter != null )
{
@@ -402,10 +402,10 @@ public class TreeMojo
rootNode.accept( firstPassVisitor );
org.apache.maven.shared.dependency.tree.filter.DependencyNodeFilter secondPassFilter =
- new org.apache.maven.shared.dependency.tree.filter.AncestorOrSelfDependencyNodeFilter(
- collectingVisitor.getNodes() );
- visitor = new org.apache.maven.shared.dependency.tree.traversal.FilteringDependencyNodeVisitor( visitor,
- secondPassFilter );
+ new org.apache.maven.shared.dependency.tree.filter.AncestorOrSelfDependencyNodeFilter( collectingVisitor.getNodes() );
+ visitor =
+ new org.apache.maven.shared.dependency.tree.traversal.FilteringDependencyNodeVisitor( visitor,
+ secondPassFilter );
}
rootNode.accept( visitor );
@@ -548,8 +548,8 @@ public class TreeMojo
getLog().debug( "+ Filtering dependency tree by artifact include patterns: " + patterns );
ArtifactFilter artifactFilter = new StrictPatternIncludesArtifactFilter( patterns );
- filters.add(
- new org.apache.maven.shared.dependency.tree.filter.ArtifactDependencyNodeFilter( artifactFilter ) );
+ filters.add( new org.apache.maven.shared.dependency.tree.filter.ArtifactDependencyNodeFilter(
+ artifactFilter ) );
}
// filter excludes
@@ -560,13 +560,12 @@ public class TreeMojo
getLog().debug( "+ Filtering dependency tree by artifact exclude patterns: " + patterns );
ArtifactFilter artifactFilter = new StrictPatternExcludesArtifactFilter( patterns );
- filters.add(
- new org.apache.maven.shared.dependency.tree.filter.ArtifactDependencyNodeFilter( artifactFilter ) );
+ filters.add( new org.apache.maven.shared.dependency.tree.filter.ArtifactDependencyNodeFilter(
+ artifactFilter ) );
}
- return filters.isEmpty()
- ? null
- : new org.apache.maven.shared.dependency.tree.filter.AndDependencyNodeFilter( filters );
+ return filters.isEmpty() ? null
+ : new org.apache.maven.shared.dependency.tree.filter.AndDependencyNodeFilter( filters );
}
//following is required because the version handling in maven code
@@ -587,7 +586,8 @@ public class TreeMojo
ArtifactVersion recommendedVersion = allowedRange.getRecommendedVersion();
if ( recommendedVersion == null )
{
- @SuppressWarnings( "unchecked" ) List<Restriction> restrictions = allowedRange.getRestrictions();
+ @SuppressWarnings( "unchecked" )
+ List<Restriction> restrictions = allowedRange.getRestrictions();
for ( Restriction restriction : restrictions )
{
if ( restriction.containsVersion( theVersion ) )
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?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- 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 Aug 27 18:25:03 2013
@@ -32,7 +32,7 @@ import org.codehaus.plexus.util.StringUt
/**
* Utility class with static helper methods
- *
+ *
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
* @version $Id$
*/
@@ -42,8 +42,8 @@ public final class DependencyUtil
/**
* 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.
+ *
+ * @param artifact 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-[version]-[classifier].[type]
* @see {@link #getFormattedFileName(Artifact, boolean, boolean)}.
@@ -58,15 +58,18 @@ public final class DependencyUtil
* 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 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 );
}
@@ -75,11 +78,15 @@ public final class DependencyUtil
* 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 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]
*/
@@ -94,25 +101,30 @@ public final class DependencyUtil
* 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.
+ *
+ * @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 )
{
@@ -139,20 +151,20 @@ 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 useSubdirsPerType if a new sub directory should be used for each type.
+ *
+ * @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
- * will be ignored.
- * @param removeVersion if the version must not be mentioned in the filename
- * @param outputDirectory base outputDirectory.
- * @param artifact information about the artifact.
+ * @param useRepositoryLayout if dependencies must be moved into a Maven repository layout, if set, other settings
+ * will be ignored.
+ * @param removeVersion if the version must not be mentioned in the filename
+ * @param outputDirectory base outputDirectory.
+ * @param artifact information about the artifact.
* @return a formatted File object to use for output.
*/
public static File getFormattedOutputDirectory( boolean useSubdirsPerScope, boolean useSubdirsPerType,
@@ -220,9 +232,9 @@ public final class DependencyUtil
/**
* Writes the specified string to the specified file.
- *
+ *
* @param string the string to write
- * @param file the file to write to
+ * @param file the file to write to
* @throws IOException if an I/O error occurs
*/
public static synchronized void write( String string, File file, boolean append, Log log )
@@ -246,7 +258,7 @@ public final class DependencyUtil
/**
* Writes the specified string to the log at info level.
- *
+ *
* @param string the string to write
* @throws IOException if an I/O error occurs
*/
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java Tue Aug 27 18:25:03 2013
@@ -53,7 +53,7 @@ public class DestFileFilter
private boolean useRepositoryLayout;
private boolean removeVersion;
-
+
private boolean removeClassifier;
private File outputFileDirectory;
@@ -98,7 +98,7 @@ public class DestFileFilter
{
Set<Artifact> artifacts_ = artifacts;
Set<Artifact> result = new HashSet<Artifact>();
-
+
for ( Artifact artifact : artifacts_ )
{
if ( isArtifactIncluded( new ArtifactItem( artifact ) ) )
@@ -118,7 +118,8 @@ public class DestFileFilter
}
/**
- * @param overWriteReleases The overWriteReleases to set.
+ * @param overWriteReleases
+ * The overWriteReleases to set.
*/
public void setOverWriteReleases( boolean overWriteReleases )
{
@@ -134,7 +135,8 @@ public class DestFileFilter
}
/**
- * @param overWriteSnapshots The overWriteSnapshots to set.
+ * @param overWriteSnapshots
+ * The overWriteSnapshots to set.
*/
public void setOverWriteSnapshots( boolean overWriteSnapshots )
{
@@ -150,7 +152,8 @@ public class DestFileFilter
}
/**
- * @param overWriteIfNewer The overWriteIfNewer to set.
+ * @param overWriteIfNewer
+ * The overWriteIfNewer to set.
*/
public void setOverWriteIfNewer( boolean overWriteIfNewer )
{
@@ -166,7 +169,8 @@ public class DestFileFilter
}
/**
- * @param outputFileDirectory The outputFileDirectory to set.
+ * @param outputFileDirectory
+ * The outputFileDirectory to set.
*/
public void setOutputFileDirectory( File outputFileDirectory )
{
@@ -182,13 +186,14 @@ public class DestFileFilter
}
/**
- * @param removeVersion The removeVersion to set.
+ * @param removeVersion
+ * The removeVersion to set.
*/
public void setRemoveVersion( boolean removeVersion )
{
this.removeVersion = removeVersion;
}
-
+
/**
* @return Returns the removeClassifier.
*/
@@ -198,7 +203,8 @@ public class DestFileFilter
}
/**
- * @param removeClassifier The removeClassifier to set.
+ * @param removeClassifier
+ * The removeClassifier to set.
*/
public void setRemoveClassifier( boolean removeClassifier )
{
@@ -214,7 +220,8 @@ public class DestFileFilter
}
/**
- * @param useSubDirectoryPerArtifact The useSubDirectoryPerArtifact to set.
+ * @param useSubDirectoryPerArtifact
+ * The useSubDirectoryPerArtifact to set.
*/
public void setUseSubDirectoryPerArtifact( boolean useSubDirectoryPerArtifact )
{
@@ -230,7 +237,8 @@ public class DestFileFilter
}
/**
- * @param useSubDirectoryPerType The useSubDirectoryPerType to set.
+ * @param useSubDirectoryPerType
+ * The useSubDirectoryPerType to set.
*/
public void setUseSubDirectoryPerType( boolean useSubDirectoryPerType )
{
@@ -238,6 +246,7 @@ public class DestFileFilter
}
/**
+ *
* @return Returns the useRepositoryLayout
*/
public boolean isUseRepositoryLayout()
@@ -246,7 +255,9 @@ public class DestFileFilter
}
/**
- * @param useRepositoryLayout the useRepositoryLayout to set
+ *
+ * @param useRepositoryLayout
+ * the useRepositoryLayout to set
*/
public void setUseRepositoryLayout( boolean useRepositoryLayout )
{
@@ -257,16 +268,17 @@ public class DestFileFilter
{
Artifact artifact = item.getArtifact();
- boolean overWrite = ( artifact.isSnapshot() && this.overWriteSnapshots ) || ( !artifact.isSnapshot()
- && this.overWriteReleases );
+ boolean overWrite =
+ ( artifact.isSnapshot() && this.overWriteSnapshots )
+ || ( !artifact.isSnapshot() && this.overWriteReleases );
File destFolder = item.getOutputDirectory();
if ( destFolder == null )
{
- destFolder = DependencyUtil.getFormattedOutputDirectory( useSubDirectoryPerScope, useSubDirectoryPerType,
- useSubDirectoryPerArtifact, useRepositoryLayout,
- removeVersion, this.outputFileDirectory,
- artifact );
+ destFolder =
+ DependencyUtil.getFormattedOutputDirectory( useSubDirectoryPerScope, useSubDirectoryPerType,
+ useSubDirectoryPerArtifact, useRepositoryLayout,
+ removeVersion, this.outputFileDirectory, artifact );
}
File destFile;
@@ -279,7 +291,7 @@ public class DestFileFilter
destFile = new File( destFolder, item.getDestFileName() );
}
- return overWrite || !destFile.exists() || ( overWriteIfNewer
- && artifact.getFile().lastModified() > destFile.lastModified() );
+ return overWrite || !destFile.exists()
+ || ( overWriteIfNewer && artifact.getFile().lastModified() > destFile.lastModified() );
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java Tue Aug 27 18:25:03 2013
@@ -86,9 +86,8 @@ public class ClassifierTypeTranslator
}
// Create a new artifact
- Artifact newArtifact =
- factory.createArtifactWithClassifier( artifact.getGroupId(), artifact.getArtifactId(),
- artifact.getVersion(), useType, useClassifier );
+ 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
@@ -110,7 +109,8 @@ public class ClassifierTypeTranslator
}
/**
- * @param theType The type to set.
+ * @param theType
+ * The type to set.
*/
public void setType( String theType )
{
@@ -126,7 +126,8 @@ 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/plugin/dependency/TestGetMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java Tue Aug 27 18:25:03 2013
@@ -46,17 +46,20 @@ public class TestGetMojo
mojo = (GetMojo) lookupMojo( "get", testPom );
assertNotNull( mojo );
- setVariableValueToObject( mojo, "localRepository", new StubArtifactRepository( testDir.getAbsolutePath() )
- {
+ setVariableValueToObject( mojo, "localRepository", new StubArtifactRepository( testDir.getAbsolutePath() ){
@Override
public String pathOf( Artifact artifact )
{
StringBuilder pathOf = new StringBuilder();
- pathOf.append( artifact.getGroupId() ).append( '_' ).append( artifact.getArtifactId() ).append(
- '-' ).append( artifact.getVersion() );
+ pathOf.append( artifact.getGroupId() )
+ .append( '_' )
+ .append( artifact.getArtifactId() )
+ .append( '-' )
+ .append( artifact.getVersion() );
if ( artifact.getClassifier() != null )
{
- pathOf.append( '-' ).append( artifact.getClassifier() );
+ pathOf.append( '-' )
+ .append( artifact.getClassifier() );
}
pathOf.append( '.' ).append( artifact.getArtifactHandler().getExtension() );
return pathOf.toString();
@@ -66,7 +69,7 @@ public class TestGetMojo
/**
* Test transitive parameter
- *
+ *
* @throws Exception
*/
public void testTransitive()
@@ -85,10 +88,10 @@ public class TestGetMojo
setVariableValueToObject( mojo, "transitive", Boolean.FALSE );
mojo.execute();
}
-
+
/**
* Test destination parameter
- *
+ *
* @throws Exception
*/
public void testDestination()
@@ -116,11 +119,12 @@ public class TestGetMojo
mojo.execute();
assertTrue( new File( output, "org.apache.maven_maven-model-2.0.9.jar" ).exists() );
}
-
+
+
/**
* Test remote repositories parameter
- *
+ *
* @throws Exception
*/
public void testRemoteRepositories()
@@ -137,7 +141,7 @@ public class TestGetMojo
/**
* Test parsing of the remote repositories parameter
- *
+ *
* @throws Exception
*/
public void testParseRepository()
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java Tue Aug 27 18:25:03 2013
@@ -158,14 +158,15 @@ public class TestSkip
private void doConfigTest( String mojoName, String configFile )
throws Exception
{
- File testPom = new File( getBasedir(), "target/test-classes/unit/skip-test/" + configFile );
+ File testPom =
+ new File( getBasedir(), "target/test-classes/unit/skip-test/" + configFile );
Mojo mojo = lookupMojo( mojoName, testPom );
assertNotNull( mojo );
CapturingLog log = new CapturingLog();
mojo.setLog( log );
mojo.execute();
- assertTrue( log.getContent().contains( "Skipping plugin execution" ) );
+ assertTrue(log.getContent().contains("Skipping plugin execution"));
}
class CapturingLog
@@ -173,89 +174,67 @@ public class TestSkip
{
StringBuilder sb = new StringBuilder();
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void debug( CharSequence content )
{
print( "debug", content );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void debug( CharSequence content, Throwable error )
{
print( "debug", content, error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void debug( Throwable error )
{
print( "debug", error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void info( CharSequence content )
{
print( "info", content );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void info( CharSequence content, Throwable error )
{
print( "info", content, error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void info( Throwable error )
{
print( "info", error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void warn( CharSequence content )
{
print( "warn", content );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void warn( CharSequence content, Throwable error )
{
print( "warn", content, error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void warn( Throwable error )
{
print( "warn", error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void error( CharSequence content )
{
System.err.println( "[error] " + content.toString() );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void error( CharSequence content, Throwable error )
{
StringWriter sWriter = new StringWriter();
@@ -314,7 +293,7 @@ public class TestSkip
private void print( String prefix, CharSequence content )
{
- sb.append( "[" ).append( prefix ).append( "] " ).append( content.toString() ).append( "\n" );
+ sb.append("[").append(prefix).append("] ").append(content.toString()).append( "\n" );
}
private void print( String prefix, Throwable error )
@@ -324,7 +303,7 @@ public class TestSkip
error.printStackTrace( pWriter );
- sb.append( "[" ).append( prefix ).append( "] " ).append( sWriter.toString() ).append( "\n" );
+ sb.append("[").append(prefix).append("] ").append(sWriter.toString()).append( "\n" );
}
private void print( String prefix, CharSequence content, Throwable error )
@@ -334,8 +313,8 @@ public class TestSkip
error.printStackTrace( pWriter );
- sb.append( "[" ).append( prefix ).append( "] " ).append( content.toString() ).append( "\n\n" ).append(
- sWriter.toString() ).append( "\n" );
+ sb.append("[").append(prefix).append("] ").append(content.toString()).append( "\n\n" )
+ .append( sWriter.toString() ).append( "\n" );
}
protected String getContent()
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDepMgt.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDepMgt.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDepMgt.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDepMgt.java Tue Aug 27 18:25:03 2013
@@ -53,9 +53,7 @@ public class TestAnalyzeDepMgt
Artifact exclusionArtifact;
DependencyManagement depMgt;
-
DependencyManagement depMgtNoExclusions;
-
protected void setUp()
throws Exception
{
@@ -68,6 +66,7 @@ public class TestAnalyzeDepMgt
Set<Artifact> allArtifacts = stubFactory.getMixedArtifacts();
Set<Artifact> directArtifacts = stubFactory.getClassifiedArtifacts();
+
exclusionArtifact = stubFactory.getReleaseArtifact();
directArtifacts.add( exclusionArtifact );
ex = new Exclusion();
@@ -88,6 +87,7 @@ public class TestAnalyzeDepMgt
depMgt = new DependencyManagement();
depMgt.setDependencies( list );
+
project.setArtifacts( allArtifacts );
project.setDependencyArtifacts( directArtifacts );
@@ -107,8 +107,8 @@ public class TestAnalyzeDepMgt
// version isn't used in the key, it can be different
dep.setVersion( "1.1" );
- Artifact artifact =
- stubFactory.createArtifact( "group", "artifact", "1.0", Artifact.SCOPE_COMPILE, "type", "class" );
+ Artifact artifact = stubFactory.createArtifact( "group", "artifact", "1.0", Artifact.SCOPE_COMPILE, "type",
+ "class" );
// basic case ok
assertEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
@@ -156,7 +156,7 @@ public class TestAnalyzeDepMgt
list.add( ex );
Map<String, Exclusion> map = mojo.addExclusions( list );
- assertEquals( 1, map.size() );
+ assertEquals( 1,map.size() );
assertTrue( map.containsKey( mojo.getExclusionKey( ex ) ) );
assertSame( ex, map.get( mojo.getExclusionKey( ex ) ) );
}
@@ -173,7 +173,7 @@ public class TestAnalyzeDepMgt
assertEquals( 1, l.size() );
- assertEquals( mojo.getExclusionKey( ex ), mojo.getExclusionKey( l.get( 0 ) ) );
+ assertEquals( mojo.getExclusionKey( ex ), mojo.getExclusionKey(l.get( 0 )) );
}
public void testGetMismatch()
@@ -191,8 +191,7 @@ public class TestAnalyzeDepMgt
assertSame( exclusion, results.get( stubFactory.getReleaseArtifact() ) );
}
- public void testMojo()
- throws IOException
+ public void testMojo() throws IOException
{
mojo.setIgnoreDirect( false );
try
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDuplicateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDuplicateMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDuplicateMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/analyze/TestAnalyzeDuplicateMojo.java Tue Aug 27 18:25:03 2013
@@ -37,31 +37,33 @@ public class TestAnalyzeDuplicateMojo
public void testDuplicate()
throws Exception
{
- File testPom = new File( getBasedir(), "target/test-classes/unit/duplicate-dependencies/plugin-config.xml" );
+ File testPom =
+ new File( getBasedir(), "target/test-classes/unit/duplicate-dependencies/plugin-config.xml" );
AnalyzeDuplicateMojo mojo = (AnalyzeDuplicateMojo) lookupMojo( "analyze-duplicate", testPom );
assertNotNull( mojo );
DuplicateLog log = new DuplicateLog();
mojo.setLog( log );
mojo.execute();
- assertTrue( log.getContent().contains(
- "List of duplicate dependencies defined in <dependencies/> in " + "your pom.xml" ) );
- assertTrue( log.getContent().contains( "junit:junit:jar" ) );
+ assertTrue(log.getContent().contains("List of duplicate dependencies defined in <dependencies/> in "
+ + "your pom.xml"));
+ assertTrue(log.getContent().contains("junit:junit:jar"));
}
public void testDuplicate2()
throws Exception
{
- File testPom = new File( getBasedir(), "target/test-classes/unit/duplicate-dependencies/plugin-config2.xml" );
+ File testPom =
+ new File( getBasedir(), "target/test-classes/unit/duplicate-dependencies/plugin-config2.xml" );
AnalyzeDuplicateMojo mojo = (AnalyzeDuplicateMojo) lookupMojo( "analyze-duplicate", testPom );
assertNotNull( mojo );
DuplicateLog log = new DuplicateLog();
mojo.setLog( log );
mojo.execute();
- assertTrue( log.getContent().contains(
- "List of duplicate dependencies defined in <dependencyManagement/> in " + "your pom.xml" ) );
- assertTrue( log.getContent().contains( "junit:junit:jar" ) );
+ assertTrue(log.getContent().contains("List of duplicate dependencies defined in <dependencyManagement/> in "
+ + "your pom.xml"));
+ assertTrue(log.getContent().contains("junit:junit:jar"));
}
class DuplicateLog
@@ -69,89 +71,67 @@ public class TestAnalyzeDuplicateMojo
{
StringBuilder sb = new StringBuilder();
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void debug( CharSequence content )
{
print( "debug", content );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void debug( CharSequence content, Throwable error )
{
print( "debug", content, error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void debug( Throwable error )
{
print( "debug", error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void info( CharSequence content )
{
print( "info", content );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void info( CharSequence content, Throwable error )
{
print( "info", content, error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void info( Throwable error )
{
print( "info", error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void warn( CharSequence content )
{
print( "warn", content );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void warn( CharSequence content, Throwable error )
{
print( "warn", content, error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void warn( Throwable error )
{
print( "warn", error );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void error( CharSequence content )
{
System.err.println( "[error] " + content.toString() );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void error( CharSequence content, Throwable error )
{
StringWriter sWriter = new StringWriter();
@@ -210,7 +190,7 @@ public class TestAnalyzeDuplicateMojo
private void print( String prefix, CharSequence content )
{
- sb.append( "[" ).append( prefix ).append( "] " ).append( content.toString() ).append( "\n" );
+ sb.append("[").append(prefix).append("] ").append(content.toString()).append( "\n" );
}
private void print( String prefix, Throwable error )
@@ -220,7 +200,7 @@ public class TestAnalyzeDuplicateMojo
error.printStackTrace( pWriter );
- sb.append( "[" ).append( prefix ).append( "] " ).append( sWriter.toString() ).append( "\n" );
+ sb.append("[").append(prefix).append("] ").append(sWriter.toString()).append( "\n" );
}
private void print( String prefix, CharSequence content, Throwable error )
@@ -230,8 +210,8 @@ public class TestAnalyzeDuplicateMojo
error.printStackTrace( pWriter );
- sb.append( "[" ).append( prefix ).append( "] " ).append( content.toString() ).append( "\n\n" ).append(
- sWriter.toString() ).append( "\n" );
+ sb.append("[").append(prefix).append("] ").append(content.toString()).append( "\n\n" )
+ .append( sWriter.toString() ).append( "\n" );
}
protected String getContent()
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java Tue Aug 27 18:25:03 2013
@@ -70,8 +70,7 @@ public class TestCopyMojo
public ArtifactItem getSingleArtifactItem( boolean removeVersion, boolean useBaseVersion )
throws MojoExecutionException
{
- List<ArtifactItem> list = mojo.getProcessedArtifactItems(
- new ProcessArtifactItemsRequest( removeVersion, false, useBaseVersion, false ) );
+ List<ArtifactItem> list = mojo.getProcessedArtifactItems(new ProcessArtifactItemsRequest( removeVersion, false, useBaseVersion, false ));
return list.get( 0 );
}
@@ -133,7 +132,7 @@ public class TestCopyMojo
assertFilesExist( list, true );
}
-
+
public void testCopyFileWithBaseVersion()
throws Exception
{
@@ -144,16 +143,16 @@ public class TestCopyMojo
item.setGroupId( "groupId" );
item.setVersion( "1.0-20130210.213424-191" );
item.setBaseVersion( "1.0-SNAPSHOT" );
- list.add( item );
+ list.add(item);
mojo.setArtifactItems( list );
- mojo.setUseBaseVersion( true );
+ mojo.setUseBaseVersion(true);
mojo.execute();
assertFilesExist( list, true );
}
-
+
public void testSkip()
throws Exception
{
@@ -220,22 +219,21 @@ public class TestCopyMojo
}
public void testCopyStripClassifierSetInMojo()
- throws Exception
- {
- List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
- ArtifactItem item = list.get( 0 );
- item.setOutputDirectory( new File( mojo.getOutputDirectory(), "testOverride" ) );
- mojo.setStripClassifier( true );
-
- mojo.setArtifactItems( list );
+ throws Exception
+ {
+ List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
+ ArtifactItem item = list.get( 0 );
+ item.setOutputDirectory( new File( mojo.getOutputDirectory(), "testOverride" ) );
+ mojo.setStripClassifier( true );
- mojo.execute();
- assertEquals( DependencyUtil.getFormattedFileName( item.getArtifact(), false, false, false, true ),
- item.getDestFileName() );
+ mojo.setArtifactItems( list );
- assertFilesExist( list, true );
- }
+ mojo.execute();
+ assertEquals( DependencyUtil.getFormattedFileName( item.getArtifact(), false, false, false, true ), item.getDestFileName() );
+ assertFilesExist( list, true );
+ }
+
public void testNonClassifierStrip()
throws Exception
{
@@ -711,7 +709,7 @@ public class TestCopyMojo
assertTrue( time < copiedFile.lastModified() );
}
-
+
public void testCopyFileWithOverideLocalRepo()
throws Exception
{
@@ -719,17 +717,17 @@ public class TestCopyMojo
mojo.setArtifactItems( list );
mojo.setLocal( new StubArtifactRepository( this.testDir.getAbsolutePath() ) );
-
- File execLocalRepo = new File( this.testDir.getAbsolutePath(), "executionLocalRepo" );
+
+ File execLocalRepo = new File( this.testDir.getAbsolutePath(), "executionLocalRepo" );
assertFalse( execLocalRepo.exists() );
-
+
mojo.setLocalRepositoryDirectory( execLocalRepo );
-
- assertEquals( execLocalRepo.getAbsolutePath(), mojo.getLocal().getBasedir() );
+
+ assertEquals( execLocalRepo.getAbsolutePath(), mojo.getLocal().getBasedir() );
mojo.execute();
assertFilesExist( list, true );
-
- }
+
+ }
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java Tue Aug 27 18:25:03 2013
@@ -69,8 +69,8 @@ public class TestUnpackMojo
stubFactory.setUnpackableFile( mojo.getArchiverManager() );
// i'm using one file repeatedly to archive so I can test the name
// programmatically.
- stubFactory.setSrcFile( new File(
- getBasedir() + File.separatorChar + "target/test-classes/unit/unpack-dependencies-test/test.txt" ) );
+ stubFactory.setSrcFile( new File( getBasedir() + File.separatorChar
+ + "target/test-classes/unit/unpack-dependencies-test/test.txt" ) );
mojo.setFactory( DependencyTestUtils.getArtifactFactory() );
mojo.setResolver( new StubArtifactResolver( stubFactory, false, false ) );
@@ -142,7 +142,7 @@ public class TestUnpackMojo
assertMarkerFiles( list, true );
}
-
+
public void testSkip()
throws Exception
{
@@ -499,7 +499,7 @@ public class TestUnpackMojo
throws Exception
{
final long now = System.currentTimeMillis();
-
+
setSilent( mojo, false );
stubFactory.setCreateFiles( true );
Artifact artifact = stubFactory.getSnapshotArtifact();
@@ -537,17 +537,16 @@ public class TestUnpackMojo
displayFile( "marker ", marker );
System.out.println( "marker.lastModified() = " + marker.lastModified() );
System.out.println( "unpackedFile.lastModified() = " + unpackedFile.lastModified() );
- assertTrue(
- "unpackedFile '" + unpackedFile + "' lastModified() == " + marker.lastModified() + ": should be different",
- marker.lastModified() != unpackedFile.lastModified() );
+ assertTrue( "unpackedFile '" + unpackedFile + "' lastModified() == " + marker.lastModified() + ": should be different",
+ marker.lastModified() != unpackedFile.lastModified() );
}
private void displayFile( String description, File file )
{
System.out.println( description + ' ' + DateFormatUtils.ISO_DATETIME_FORMAT.format( file.lastModified() ) + ' '
- + file.getPath().substring( getBasedir().length() ) );
+ + file.getPath().substring( getBasedir().length() ) );
}
-
+
public void assertUnpacked( ArtifactItem item, boolean overWrite )
throws Exception
{
@@ -575,8 +574,9 @@ public class TestUnpackMojo
public File getUnpackedFile( ArtifactItem item )
{
- File unpackedFile = new File( item.getOutputDirectory(),
- DependencyArtifactStubFactory.getUnpackableFileName( item.getArtifact() ) );
+ File unpackedFile =
+ new File( item.getOutputDirectory(),
+ DependencyArtifactStubFactory.getUnpackableFileName( item.getArtifact() ) );
assertTrue( unpackedFile.exists() );
return unpackedFile;
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestBuildClasspathMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestBuildClasspathMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestBuildClasspathMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestBuildClasspathMojo.java Tue Aug 27 18:25:03 2013
@@ -84,8 +84,8 @@ public class TestBuildClasspathMojo
assertNotNull( file );
assertTrue( file.length() > 0 );
- assertTrue( file.contains( File.pathSeparator ) );
- assertTrue( file.contains( File.separator ) );
+ assertTrue(file.contains(File.pathSeparator));
+ assertTrue(file.contains(File.separator));
String fileSep = "#####";
String pathSep = "%%%%%";
@@ -98,10 +98,10 @@ public class TestBuildClasspathMojo
assertNotNull( file );
assertTrue( file.length() > 0 );
- assertFalse( file.contains( File.pathSeparator ) );
- assertFalse( file.contains( File.separator ) );
- assertTrue( file.contains( fileSep ) );
- assertTrue( file.contains( pathSep ) );
+ assertFalse(file.contains(File.pathSeparator));
+ assertFalse(file.contains(File.separator));
+ assertTrue(file.contains(fileSep));
+ assertTrue(file.contains(pathSep));
String propertyValue = project.getProperties().getProperty( "outputProperty" );
assertNull( propertyValue );
@@ -112,8 +112,7 @@ public class TestBuildClasspathMojo
}
- public void testPath()
- throws Exception
+ public void testPath() throws Exception
{
File testPom = new File( getBasedir(), "target/test-classes/unit/build-classpath-test/plugin-config.xml" );
BuildClasspathMojo mojo = (BuildClasspathMojo) lookupMojo( "build-classpath", testPom );
@@ -126,6 +125,7 @@ public class TestBuildClasspathMojo
Artifact artifact = stubFactory.getReleaseArtifact();
+
StringBuilder sb = new StringBuilder();
mojo.setPrefix( null );
mojo.setStripVersion( false );
@@ -146,31 +146,29 @@ public class TestBuildClasspathMojo
sb.setLength( 0 );
mojo.setPrependGroupId( true );
mojo.appendArtifactPath( artifact, sb );
- assertEquals( "If prefix is null, prependGroupId has no impact ",
- "%M2_REPO%" + File.separator + DependencyUtil.getFormattedFileName( artifact, false, false ),
- sb.toString() );
-
+ assertEquals("If prefix is null, prependGroupId has no impact ", "%M2_REPO%"+File.separator
+ + DependencyUtil.getFormattedFileName( artifact, false, false ), sb.toString());
+
mojo.setLocalRepoProperty( "" );
mojo.setPrefix( "prefix" );
sb.setLength( 0 );
mojo.setPrependGroupId( true );
mojo.appendArtifactPath( artifact, sb );
- assertEquals( "prefix" + File.separator + DependencyUtil.getFormattedFileName( artifact, false, true ),
- sb.toString() );
+ assertEquals("prefix"+File.separator+DependencyUtil.getFormattedFileName( artifact, false, true ),
+ sb.toString());
mojo.setPrependGroupId( false );
-
+
mojo.setLocalRepoProperty( "" );
mojo.setPrefix( "prefix" );
sb.setLength( 0 );
mojo.appendArtifactPath( artifact, sb );
- assertEquals( "prefix" + File.separator + artifact.getFile().getName(), sb.toString() );
-
+ assertEquals("prefix"+File.separator+artifact.getFile().getName(),sb.toString());
+
mojo.setPrefix( "prefix" );
mojo.setStripVersion( true );
sb.setLength( 0 );
mojo.appendArtifactPath( artifact, sb );
- assertEquals( "prefix" + File.separator + DependencyUtil.getFormattedFileName( artifact, true ),
- sb.toString() );
-
+ assertEquals( "prefix" + File.separator + DependencyUtil.getFormattedFileName( artifact, true ), sb.toString() );
+
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestUnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestUnpackDependenciesMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestUnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestUnpackDependenciesMojo.java Tue Aug 27 18:25:03 2013
@@ -126,9 +126,8 @@ public class TestUnpackDependenciesMojo
throws Exception
{
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(artifact);
}
}
@@ -137,9 +136,8 @@ public class TestUnpackDependenciesMojo
{
mojo.excludeTransitive = true;
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getDependencyArtifacts() )
- {
- assertUnpacked( artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getDependencyArtifacts()) {
+ assertUnpacked(artifact);
}
}
@@ -151,9 +149,8 @@ public class TestUnpackDependenciesMojo
mojo.excludeTypes = "jar";
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( !artifact.getType().equalsIgnoreCase( "jar" ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(!artifact.getType().equalsIgnoreCase("jar"), artifact);
}
}
@@ -167,9 +164,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( !artifact.getScope().equals( "provided" ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(!artifact.getScope().equals("provided"), artifact);
}
}
@@ -184,9 +180,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( !artifact.getScope().equals( "system" ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(!artifact.getScope().equals("system"), artifact);
}
}
@@ -200,9 +195,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.excludeScope );
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( !saf.include( artifact ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(!saf.include(artifact), artifact);
}
}
@@ -234,9 +228,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.excludeScope );
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( !saf.include( artifact ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(!saf.include(artifact), artifact);
}
}
@@ -280,9 +273,8 @@ public class TestUnpackDependenciesMojo
mojo.useSubDirectoryPerType = true;
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(artifact);
}
}
@@ -292,9 +284,8 @@ public class TestUnpackDependenciesMojo
mojo.useSubDirectoryPerArtifact = true;
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(artifact);
}
}
@@ -307,9 +298,8 @@ public class TestUnpackDependenciesMojo
mojo.useSubDirectoryPerType = true;
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(artifact);
}
}
@@ -320,9 +310,8 @@ public class TestUnpackDependenciesMojo
mojo.stripVersion = true;
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(artifact);
}
}
@@ -336,9 +325,8 @@ public class TestUnpackDependenciesMojo
mojo.stripVersion = true;
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(artifact);
}
}
@@ -351,9 +339,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( saf.include( artifact ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(saf.include(artifact), artifact);
}
}
@@ -367,9 +354,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( saf.include( artifact ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(saf.include(artifact), artifact);
}
}
@@ -382,9 +368,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( saf.include( artifact ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(saf.include(artifact), artifact);
}
}
@@ -396,9 +381,8 @@ public class TestUnpackDependenciesMojo
mojo.includeScope = "provided";
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(Artifact.SCOPE_PROVIDED.equals(artifact.getScope()), artifact);
}
}
@@ -411,9 +395,8 @@ public class TestUnpackDependenciesMojo
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(Artifact.SCOPE_SYSTEM.equals(artifact.getScope()), artifact);
}
}
@@ -457,9 +440,8 @@ public class TestUnpackDependenciesMojo
// test - get all direct dependencies and verify that they exist if they
// do not have a classifier of "one"
// then delete the file and at the end, verify the folder is empty.
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( !artifact.getArtifactId().equals( "one" ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(!artifact.getArtifactId().equals("one"), artifact);
}
}
@@ -471,9 +453,8 @@ public class TestUnpackDependenciesMojo
mojo.excludeGroupIds = "one";
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
- assertUnpacked( !artifact.getGroupId().equals( "one" ), artifact );
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
+ assertUnpacked(!artifact.getGroupId().equals("one"), artifact);
}
}
@@ -538,24 +519,21 @@ public class TestUnpackDependenciesMojo
mojo.execute();
- for ( Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts() )
- {
+ for (Artifact artifact : (Iterable<Artifact>) mojo.getProject().getArtifacts()) {
String useClassifier = artifact.getClassifier();
String useType = artifact.getType();
- if ( StringUtils.isNotEmpty( testClassifier ) )
- {
+ if (StringUtils.isNotEmpty(testClassifier)) {
useClassifier = testClassifier;
// type is only used if classifier is used.
- if ( StringUtils.isNotEmpty( testType ) )
- {
+ if (StringUtils.isNotEmpty(testType)) {
useType = testType;
}
}
Artifact unpacked =
- stubFactory.createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
- Artifact.SCOPE_COMPILE, useType, useClassifier );
- assertUnpacked( unpacked );
+ stubFactory.createArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
+ Artifact.SCOPE_COMPILE, useType, useClassifier);
+ assertUnpacked(unpacked);
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java Tue Aug 27 18:25:03 2013
@@ -91,8 +91,8 @@ public abstract class AbstractDependency
{
if ( !installed )
{
- System.out.println(
- "*** Running test builds; output will be directed to: " + BUILD_OUTPUT_DIRECTORY + "\n" );
+ System.out
+ .println( "*** Running test builds; output will be directed to: " + BUILD_OUTPUT_DIRECTORY + "\n" );
}
super.setUp();
@@ -111,11 +111,9 @@ public abstract class AbstractDependency
{
String path = System.getProperty( "java.library.path" );
String[] paths = StringUtils.split( path, System.getProperty( "path.separator" ) );
- for ( String pt : paths )
- {
- if ( new File( pt, "mvn" ).exists() )
- {
- System.setProperty( "maven.home", new File( pt ).getAbsoluteFile().getParent() );
+ for (String pt : paths) {
+ if (new File(pt, "mvn").exists()) {
+ System.setProperty("maven.home", new File(pt).getAbsoluteFile().getParent());
break;
}
@@ -130,11 +128,11 @@ public abstract class AbstractDependency
{
PluginTestTool pluginTestTool = (PluginTestTool) lookup( PluginTestTool.ROLE, "default" );
- localRepositoryDirectory = pluginTestTool.preparePluginForUnitTestingWithMavenBuilds( PomFile, "test",
- localRepositoryDirectory );
+ localRepositoryDirectory = pluginTestTool
+ .preparePluginForUnitTestingWithMavenBuilds( PomFile, "test", localRepositoryDirectory );
- System.out.println(
- "*** Installed test-version of the Dependency plugin to: " + localRepositoryDirectory + "\n" );
+ System.out.println( "*** Installed test-version of the Dependency plugin to: "
+ + localRepositoryDirectory + "\n" );
installed = true;
}
@@ -172,10 +170,10 @@ public abstract class AbstractDependency
/**
* Execute the plugin with no properties
- *
+ *
* @param projectName project directory
- * @param goalList comma separated list of goals to
- * execute
+ * @param goalList comma separated list of goals to
+ * execute
* @throws Exception any exception generated during test
*/
protected void testProject( String projectName, String goalList )
@@ -187,11 +185,11 @@ public abstract class AbstractDependency
/**
* Execute the plugin.
- *
+ *
* @param projectName project directory
- * @param properties additional properties
- * @param goalList comma separated list of goals to
- * execute
+ * @param properties additional properties
+ * @param goalList comma separated list of goals to
+ * execute
* @throws Exception any exception generated during test
*/
protected void testProject( String projectName, Properties properties, String goalList )
@@ -280,17 +278,16 @@ public abstract class AbstractDependency
try
{
-
+
buildLogUrl = buildLog.toURI().toURL().toExternalForm();
}
catch ( MalformedURLException e )
{
}
- throw new ExecutionFailedException(
- "Failed to execute build.\nPOM: " + pom + "\nGoals: " + StringUtils.join( goals.iterator(), ", " )
- + "\nExit Code: " + result.getExitCode() + "\nError: " + result.getExecutionException()
- + "\nBuild Log: " + buildLogUrl + "\n", result );
+ throw new ExecutionFailedException( "Failed to execute build.\nPOM: " + pom + "\nGoals: "
+ + StringUtils.join( goals.iterator(), ", " ) + "\nExit Code: " + result.getExitCode() + "\nError: "
+ + result.getExecutionException() + "\nBuild Log: " + buildLogUrl + "\n", result );
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubUnpackFileMarkerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubUnpackFileMarkerHandler.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubUnpackFileMarkerHandler.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubUnpackFileMarkerHandler.java Tue Aug 27 18:25:03 2013
@@ -26,40 +26,39 @@ import org.apache.maven.plugin.dependenc
import org.codehaus.plexus.util.StringUtils;
public class StubUnpackFileMarkerHandler
- extends UnpackFileMarkerHandler
+ extends UnpackFileMarkerHandler
{
- public StubUnpackFileMarkerHandler( ArtifactItem artifactItem, File markerFilesDirectory )
+ public StubUnpackFileMarkerHandler( ArtifactItem artifactItem, File markerFilesDirectory )
{
super( artifactItem, markerFilesDirectory );
}
-
- protected File getMarkerFile()
+
+ protected File getMarkerFile()
{
- File markerFile;
- if ( this.artifactItem == null || ( StringUtils.isEmpty( this.artifactItem.getIncludes() )
- && StringUtils.isEmpty( this.artifactItem.getExcludes() ) ) )
- {
- markerFile =
- new StubMarkerFile( this.markerFilesDirectory, this.artifact.getId().replace( ':', '-' ) + ".marker" );
- }
- else
- {
- int includeExcludeHash = 0;
-
- if ( StringUtils.isNotEmpty( this.artifactItem.getIncludes() ) )
- {
- includeExcludeHash += this.artifactItem.getIncludes().hashCode();
- }
-
- if ( StringUtils.isNotEmpty( this.artifactItem.getExcludes() ) )
- {
- includeExcludeHash += this.artifactItem.getExcludes().hashCode();
- }
-
- markerFile = new StubMarkerFile( this.markerFilesDirectory,
- this.artifact.getId().replace( ':', '-' ) + includeExcludeHash );
- }
-
- return markerFile;
+ File markerFile;
+ if ( this.artifactItem == null
+ || ( StringUtils.isEmpty( this.artifactItem.getIncludes() )
+ && StringUtils.isEmpty( this.artifactItem.getExcludes() ) ) )
+ {
+ markerFile = new StubMarkerFile( this.markerFilesDirectory, this.artifact.getId().replace( ':', '-' ) + ".marker" );
+ }
+ else
+ {
+ int includeExcludeHash = 0;
+
+ if ( StringUtils.isNotEmpty( this.artifactItem.getIncludes() ) )
+ {
+ includeExcludeHash += this.artifactItem.getIncludes().hashCode();
+ }
+
+ if ( StringUtils.isNotEmpty( this.artifactItem.getExcludes() ) )
+ {
+ includeExcludeHash += this.artifactItem.getExcludes().hashCode();
+ }
+
+ markerFile = new StubMarkerFile( this.markerFilesDirectory, this.artifact.getId().replace( ':', '-' ) + includeExcludeHash );
+ }
+
+ return markerFile;
}
}