mirror of https://github.com/apache/maven.git
updated parent pom and fixed little errors reported by Checkstyle
This commit is contained in:
parent
ac9d11c620
commit
623d54f199
|
@ -24,6 +24,9 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class DefaultStatefulSingleton
|
||||
implements StatefulSingleton
|
||||
{
|
||||
|
|
|
@ -22,6 +22,9 @@ package org.apache.maven.coreit.component;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface StatefulSingleton
|
||||
{
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.apache.maven.plugin.coreit;
|
|||
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -111,7 +110,7 @@ public class CheckThreadSafetyMojo
|
|||
{
|
||||
// wait for start
|
||||
}
|
||||
for ( int j = 0; j < 10000; j++ )
|
||||
for ( int j = 0; j < 10 * 1000; j++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
@ -33,7 +34,6 @@ import org.apache.maven.plugin.MojoFailureException;
|
|||
import java.io.File;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
|
@ -114,6 +114,9 @@ public class InstallArtifactsMojo
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static class FlatRepositoryLayout
|
||||
implements ArtifactRepositoryLayout
|
||||
{
|
||||
|
|
|
@ -128,7 +128,8 @@ public class ResolveTransitiveMojo
|
|||
|
||||
if ( thread.error != null )
|
||||
{
|
||||
throw new MojoExecutionException( "Failed to resolve artifacts: " + thread.error.getMessage(), thread.error );
|
||||
throw new MojoExecutionException( "Failed to resolve artifacts: " + thread.error.getMessage(),
|
||||
thread.error );
|
||||
}
|
||||
|
||||
if ( propertiesFile != null )
|
||||
|
@ -187,7 +188,8 @@ public class ResolveTransitiveMojo
|
|||
dependency.getVersion(), dependency.getType(),
|
||||
dependency.getClassifier() );
|
||||
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Resolving " + ResolveTransitiveMojo.this.getId( artifact ) );
|
||||
getLog().info( "[MAVEN-CORE-IT-LOG] Resolving "
|
||||
+ ResolveTransitiveMojo.this.getId( artifact ) );
|
||||
|
||||
artifacts.add( artifact );
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.apache.maven.plugin.coreit;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@ public class CatchMojo
|
|||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,8 @@ public class AggregateTestMojo
|
|||
|
||||
writeArtifacts( filter( projectArtifacts, project ), project.getArtifacts() );
|
||||
|
||||
// NOTE: We can't make any assumptions about the class path but as a minimum it must not cause an exception
|
||||
// NOTE: We can't make any assumptions about the class path but as a minimum it must not cause an
|
||||
// exception
|
||||
project.getTestClasspathElements();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -295,6 +295,7 @@ public abstract class AbstractDependencyMojo
|
|||
|
||||
for ( int i = 0; i < digest.length; i++ )
|
||||
{
|
||||
@SuppressWarnings( "checkstyle:magicnumber" )
|
||||
int b = digest[i] & 0xFF;
|
||||
|
||||
if ( b < 0x10 )
|
||||
|
|
|
@ -94,7 +94,8 @@ public class AggregateTestMojo
|
|||
|
||||
writeArtifacts( filter( projectArtifacts, project ), project.getArtifacts() );
|
||||
writeClassPath( filter( testClassPath, project ), project.getTestClasspathElements() );
|
||||
writeClassPathChecksums( filter( testClassPathChecksums, project ), project.getTestClasspathElements() );
|
||||
writeClassPathChecksums( filter( testClassPathChecksums, project ),
|
||||
project.getTestClasspathElements() );
|
||||
}
|
||||
}
|
||||
catch ( DependencyResolutionRequiredException e )
|
||||
|
|
|
@ -143,7 +143,8 @@ public class ResolveOneDependencyMojo
|
|||
}
|
||||
|
||||
Set depArtifacts = new HashSet();
|
||||
Artifact artifact = artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, type, classifier );
|
||||
Artifact artifact =
|
||||
artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, type, classifier );
|
||||
depArtifacts.add( artifact );
|
||||
|
||||
ScopeArtifactFilter scopeFilter = new ScopeArtifactFilter( scope );
|
||||
|
|
|
@ -31,7 +31,8 @@ public class MojoFailureExceptionMojo
|
|||
{
|
||||
/**
|
||||
* Message used in {@link MojoFailureException#MojoFailureException(String)}, unless longMessage
|
||||
* is supplied; then, this becomes the short message in {@link MojoFailureException#MojoFailureException(Object, String, String)}.
|
||||
* is supplied; then, this becomes the short message in
|
||||
* {@link MojoFailureException#MojoFailureException(Object, String, String)}.
|
||||
*
|
||||
* @parameter property="error.message" default-value="Planned MojoExecutionException."
|
||||
* @required
|
||||
|
|
|
@ -19,12 +19,14 @@ package org.apache.maven.plugin.coreit;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.artifact.*;
|
||||
import org.apache.maven.artifact.factory.*;
|
||||
import org.apache.maven.artifact.resolver.*;
|
||||
import org.apache.maven.artifact.repository.*;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.factory.ArtifactFactory;
|
||||
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolver;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ import org.apache.maven.project.MavenProject;
|
|||
import org.apache.maven.project.interpolation.ModelInterpolationException;
|
||||
import org.apache.maven.project.interpolation.ModelInterpolator;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @goal path-interpolation
|
||||
* @phase validate
|
||||
|
@ -44,9 +46,11 @@ public class PathInterpolationMojo
|
|||
{
|
||||
try
|
||||
{
|
||||
Properties props = project.getProperties();
|
||||
|
||||
modelInterpolator.interpolate( project.getOriginalModel(),
|
||||
project.getBasedir(),
|
||||
new DefaultProjectBuilderConfiguration().setExecutionProperties( project.getProperties() ),
|
||||
new DefaultProjectBuilderConfiguration().setExecutionProperties( props ),
|
||||
true );
|
||||
}
|
||||
catch ( ModelInterpolationException e )
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.apache.maven.plugin.MojoExecutionException;
|
|||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Mojo which touches a file without requiring a project.
|
||||
|
|
|
@ -45,7 +45,8 @@ public class VelocityMojo
|
|||
try
|
||||
{
|
||||
// velocityComponent engine should not be null
|
||||
// this is the real test to check that we got the right Initializable interface in both Plexus and the component
|
||||
// this is the real test to check that we got the right Initializable interface in both Plexus and the
|
||||
// component
|
||||
/*
|
||||
* NOTE: There's a bug in the plexus-velocity:1.1.7 component that fails to transform "/template.vm" into
|
||||
* a proper resource name before searching the context class loader so we avoid the leading slash here.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
package org.apache.maven.its.plugins.plexuslifecycle;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
package org.apache.maven.its.plugins.plexuslifecycle;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
package org.apache.maven.its.plugins.plexuslifecycle;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
|
|
@ -23,6 +23,9 @@ import java.io.IOException;
|
|||
|
||||
import org.codehaus.plexus.util.xml.pull.XmlSerializer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Xpp3Dom
|
||||
{
|
||||
|
||||
|
|
|
@ -23,6 +23,9 @@ import java.io.IOException;
|
|||
import java.io.OutputStream;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class MXSerializer
|
||||
implements XmlSerializer
|
||||
{
|
||||
|
|
|
@ -23,6 +23,9 @@ import java.io.IOException;
|
|||
import java.io.OutputStream;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface XmlSerializer
|
||||
{
|
||||
|
||||
|
|
|
@ -47,7 +47,9 @@ public class PluginParamInterpolationMojo
|
|||
|
||||
if ( !myDirectory.equals( value ) )
|
||||
{
|
||||
throw new MojoExecutionException( "Directory supplied: " + myDirectory + " is not the same as the project build directory: " + project.getBuild().getDirectory() + " + '/foo'" );
|
||||
throw new MojoExecutionException( "Directory supplied: " + myDirectory
|
||||
+ " is not the same as the project build directory: " + project.getBuild().getDirectory()
|
||||
+ " + '/foo'" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,8 @@ public class PropertyInterpolationMojo
|
|||
|
||||
if ( !value.equals( targetValue ) )
|
||||
{
|
||||
throw new MojoExecutionException( "Property value of 'myDirectory': " + value + " should equal the 'foo' subpath of the project build directory: " + targetValue );
|
||||
throw new MojoExecutionException( "Property value of 'myDirectory': " + value
|
||||
+ " should equal the 'foo' subpath of the project build directory: " + targetValue );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,8 @@ public class CoreItMojo
|
|||
}
|
||||
else
|
||||
{
|
||||
getLog().warn( "[MAVEN-CORE-IT-LOG] Toolchain #" + selected + " can't be selected, found only " + tcs.length );
|
||||
getLog().warn( "[MAVEN-CORE-IT-LOG] Toolchain #" + selected + " can't be selected, found only "
|
||||
+ tcs.length );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class CopyPomMojo
|
|||
FileOutputStream out = new FileOutputStream( dest );
|
||||
|
||||
int read = -1;
|
||||
byte[] buf = new byte[4096];
|
||||
byte[] buf = new byte[4 * 1024];
|
||||
while ( ( read = in.read( buf ) ) > -1 )
|
||||
{
|
||||
out.write( buf, 0, read );
|
||||
|
|
|
@ -98,7 +98,8 @@ public class CoreItTouchMojo
|
|||
{
|
||||
if ( fail )
|
||||
{
|
||||
throw new MojoExecutionException( "Failing per \'fail\' parameter (specified in pom or system properties)" );
|
||||
throw new MojoExecutionException( "Failing per \'fail\' parameter"
|
||||
+ " (specified in pom or system properties)" );
|
||||
}
|
||||
|
||||
File outDir = new File( outputDirectory );
|
||||
|
|
|
@ -52,7 +52,8 @@ public class UsesPropertiesMojo
|
|||
file.getParentFile().mkdirs();
|
||||
FileOutputStream fos = new FileOutputStream( file );
|
||||
|
||||
properties.store( fos, "# Properties generated by the execution of a mojo that uses interpolated POM values for configuration." );
|
||||
properties.store( fos, "# Properties generated by the execution of a mojo that uses"
|
||||
+ " interpolated POM values for configuration." );
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
|
|
|
@ -88,7 +88,7 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
}
|
||||
catch ( InvalidVersionSpecificationException e )
|
||||
{
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRangeStr ).initCause( e );
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRangeStr, e );
|
||||
}
|
||||
|
||||
ArtifactVersion version = getMavenVersion();
|
||||
|
@ -179,7 +179,7 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
}
|
||||
catch ( InvalidVersionSpecificationException e )
|
||||
{
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRangeStr ).initCause( e );
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRangeStr, e );
|
||||
}
|
||||
|
||||
ArtifactVersion version = getMavenVersion();
|
||||
|
@ -256,7 +256,7 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
}
|
||||
catch ( InvalidVersionSpecificationException e )
|
||||
{
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRange ).initCause( e );
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRange, e );
|
||||
}
|
||||
|
||||
ArtifactVersion version = getJavaVersion();
|
||||
|
@ -283,7 +283,7 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
}
|
||||
catch ( InvalidVersionSpecificationException e )
|
||||
{
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRange ).initCause( e );
|
||||
throw (RuntimeException) new IllegalArgumentException( "Invalid version range: " + versionRange, e );
|
||||
}
|
||||
|
||||
ArtifactVersion version = getMavenVersion();
|
||||
|
@ -304,9 +304,10 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
private class UnsupportedJavaVersionException
|
||||
extends RuntimeException
|
||||
{
|
||||
|
||||
@SuppressWarnings( "checkstyle:visibilitymodifier" )
|
||||
public ArtifactVersion javaVersion;
|
||||
|
||||
@SuppressWarnings( "checkstyle:visibilitymodifier" )
|
||||
public VersionRange supportedRange;
|
||||
|
||||
public UnsupportedJavaVersionException( ArtifactVersion javaVersion, VersionRange supportedRange )
|
||||
|
@ -320,9 +321,10 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
private class UnsupportedMavenVersionException
|
||||
extends RuntimeException
|
||||
{
|
||||
|
||||
@SuppressWarnings( "checkstyle:visibilitymodifier" )
|
||||
public ArtifactVersion mavenVersion;
|
||||
|
||||
@SuppressWarnings( "checkstyle:visibilitymodifier" )
|
||||
public VersionRange supportedRange;
|
||||
|
||||
public UnsupportedMavenVersionException( ArtifactVersion mavenVersion, VersionRange supportedRange )
|
||||
|
@ -444,7 +446,8 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
else
|
||||
{
|
||||
//
|
||||
// Make is easier to run ITs from m2e in Maven IT mode without having to set any additional properties.
|
||||
// Make is easier to run ITs from m2e in Maven IT mode without having to set any additional
|
||||
// properties.
|
||||
//
|
||||
settingsFile = new File( "target/test-classes", settingsFile.getPath() );
|
||||
}
|
||||
|
@ -479,25 +482,25 @@ public abstract class AbstractMavenIntegrationTestCase
|
|||
return verifier;
|
||||
}
|
||||
|
||||
static public void assertCanonicalFileEquals( String message, File expected, File actual )
|
||||
public static void assertCanonicalFileEquals( String message, File expected, File actual )
|
||||
throws IOException
|
||||
{
|
||||
assertEquals( message, expected.getCanonicalFile(), actual.getCanonicalFile() );
|
||||
}
|
||||
|
||||
static public void assertCanonicalFileEquals( File expected, File actual )
|
||||
public static void assertCanonicalFileEquals( File expected, File actual )
|
||||
throws IOException
|
||||
{
|
||||
assertCanonicalFileEquals( null, expected, actual );
|
||||
}
|
||||
|
||||
static public void assertCanonicalFileEquals( String message, String expected, String actual )
|
||||
public static void assertCanonicalFileEquals( String message, String expected, String actual )
|
||||
throws IOException
|
||||
{
|
||||
assertCanonicalFileEquals( message, new File( expected ), new File( actual ) );
|
||||
}
|
||||
|
||||
static public void assertCanonicalFileEquals( String expected, String actual )
|
||||
public static void assertCanonicalFileEquals( String expected, String actual )
|
||||
throws IOException
|
||||
{
|
||||
assertCanonicalFileEquals( null, new File( expected ), new File( actual ) );
|
||||
|
|
34
its/pom.xml
34
its/pom.xml
|
@ -25,7 +25,7 @@ under the License.
|
|||
<parent>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<version>22</version>
|
||||
<version>26</version>
|
||||
<relativePath>../pom/maven/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -62,6 +62,7 @@ under the License.
|
|||
<properties>
|
||||
<maven.site.path>core-its</maven.site.path>
|
||||
<maven.site.cache>${user.home}/maven-sites</maven.site.cache>
|
||||
<rat.ignoreErrors>true</rat.ignoreErrors>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
@ -79,37 +80,6 @@ under the License.
|
|||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.3</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.13</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-scm-publish-plugin</artifactId>
|
||||
<version>1.0</version>
|
||||
<configuration>
|
||||
<checkoutDirectory>${maven.site.cache}/${maven.site.path}</checkoutDirectory>
|
||||
<tryUpdate>true</tryUpdate>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>apache.snapshots</id>
|
||||
|
|
Loading…
Reference in New Issue