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 [22/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-antr...
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java Tue Aug 27 18:25:03 2013
@@ -128,8 +128,7 @@ import java.util.TreeMap;
// @requiresDependencyResolution test
@Mojo( name = "process", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true )
public class ProcessRemoteResourcesMojo
- extends AbstractMojo
- implements LogChute
+ extends AbstractMojo implements LogChute
{
private static final String TEMPLATE_SUFFIX = ".vm";
@@ -307,7 +306,7 @@ public class ProcessRemoteResourcesMojo
*/
@Parameter
private Map<String, Object> properties = new HashMap<String, Object>();
-
+
/**
* Whether to include properties defined in the project when filtering resources.
*
@@ -373,19 +372,18 @@ public class ProcessRemoteResourcesMojo
*/
@Parameter( property = "excludeScope", defaultValue = "" )
protected String excludeScope;
-
-
+
+
/**
* When resolving project dependencies, specify the scopes to include.
* The default is the same as "includeScope" if there are no exclude scopes set.
* Otherwise, it defaults to "test" to grab all the dependencies so the
* exclude filters can filter out what is not needed.
- *
- * @since 1.5
+ * @since 1.5
*/
@Parameter
private String[] resolveScopes;
-
+
/**
* Comma separated list of Artifact names too exclude.
@@ -432,9 +430,9 @@ public class ProcessRemoteResourcesMojo
@Component( hint = "default" )
protected ProjectDependenciesResolver dependencyResolver;
-
+
private VelocityEngine velocity;
-
+
@SuppressWarnings( "unchecked" )
public void execute()
throws MojoExecutionException
@@ -453,11 +451,11 @@ public class ProcessRemoteResourcesMojo
{
if ( excludeScope == null || "".equals( excludeScope ) )
{
- resolveScopes = new String[]{ this.includeScope };
+ resolveScopes = new String[] { this.includeScope };
}
else
{
- resolveScopes = new String[]{ Artifact.SCOPE_TEST };
+ resolveScopes = new String[] { Artifact.SCOPE_TEST };
}
}
velocity = new VelocityEngine();
@@ -715,11 +713,13 @@ public class ProcessRemoteResourcesMojo
if ( runOnlyAtExecutionRoot )
{
List<MavenProject> projects = mavenSession.getSortedProjects();
- return dependencyResolver.resolve( projects, Arrays.asList( resolveScopes ), mavenSession );
+ return dependencyResolver.resolve( projects, Arrays.asList( resolveScopes ),
+ mavenSession );
}
else
{
- return dependencyResolver.resolve( project, Arrays.asList( resolveScopes ), mavenSession );
+ return dependencyResolver.resolve( project, Arrays.asList( resolveScopes ),
+ mavenSession );
}
}
catch ( ArtifactResolutionException e )
@@ -764,7 +764,7 @@ public class ProcessRemoteResourcesMojo
artifact.setResolvedVersion( Artifact.LATEST_VERSION );
}
artifacts.add( artifact );
- }
+ }
}
}
catch ( InvalidDependencyVersionException e )
@@ -978,14 +978,10 @@ public class ProcessRemoteResourcesMojo
}
throw new MojoExecutionException( "The " + position +
- " resource bundle configured must specify a groupId, artifactId, "
- +
- " version and, optionally, type and classifier for a remote resource bundle. "
- +
- "Must be of the form <resourceBundle>groupId:artifactId:version</resourceBundle>, "
- +
- "<resourceBundle>groupId:artifactId:version:type</resourceBundle> or "
- +
+ " resource bundle configured must specify a groupId, artifactId, " +
+ " version and, optionally, type and classifier for a remote resource bundle. " +
+ "Must be of the form <resourceBundle>groupId:artifactId:version</resourceBundle>, " +
+ "<resourceBundle>groupId:artifactId:version:type</resourceBundle> or " +
"<resourceBundle>groupId:artifactId:version:type:classifier</resourceBundle>" );
}
@@ -1014,7 +1010,7 @@ public class ProcessRemoteResourcesMojo
context.put( "projects", projects );
context.put( "projectsSortedByOrganization", getProjectsSortedByOrganization( projects ) );
context.put( "presentYear", year );
- context.put( "locator", locator );
+ context.put( "locator", locator);
if ( inceptionYear.equals( year ) )
{
@@ -1048,11 +1044,11 @@ public class ProcessRemoteResourcesMojo
if ( s[0].equals( p.getGroupId() ) && s[1].equals( p.getArtifactId() ) &&
s[2].equals( p.getVersion() ) )
{
- if ( s.length >= 4 && "test-jar".equals( s[3] ) )
+ if ( s.length >= 4 && "test-jar".equals( s[3] ) )
{
artifactFile = new File( p.getBuild().getTestOutputDirectory() );
- }
- else
+ }
+ else
{
artifactFile = new File( p.getBuild().getOutputDirectory() );
}
@@ -1160,12 +1156,13 @@ public class ProcessRemoteResourcesMojo
{
if ( bundle.getSourceEncoding() == null )
{
- velocity.mergeTemplate( bundleResource, "ISO-8859-1", context, writer );
+ velocity.mergeTemplate( bundleResource, "ISO-8859-1",
+ context, writer );
}
else
{
- velocity.mergeTemplate( bundleResource, bundle.getSourceEncoding(), context,
- writer );
+ velocity.mergeTemplate( bundleResource, bundle.getSourceEncoding(),
+ context, writer );
}
}
@@ -1307,35 +1304,29 @@ public class ProcessRemoteResourcesMojo
}
List<Supplement> supplements = new ArrayList<Supplement>();
- for ( String set : models )
- {
- getLog().debug( "Preparing ruleset: " + set );
- try
- {
- File f = locator.getResourceAsFile( set, getLocationTemp( set ) );
+ for (String set : models) {
+ getLog().debug("Preparing ruleset: " + set);
+ try {
+ File f = locator.getResourceAsFile(set, getLocationTemp(set));
- if ( null == f || !f.exists() )
- {
- throw new MojoExecutionException( "Cold not resolve " + set );
+ if (null == f || !f.exists()) {
+ throw new MojoExecutionException("Cold not resolve " + set);
}
- if ( !f.canRead() )
- {
- throw new MojoExecutionException( "Supplemental data models won't be loaded. " + "File " +
- f.getAbsolutePath() +
- " cannot be read, check permissions on the file." );
+ if (!f.canRead()) {
+ throw new MojoExecutionException("Supplemental data models won't be loaded. " + "File " +
+ f.getAbsolutePath() +
+ " cannot be read, check permissions on the file.");
}
- getLog().debug( "Loading supplemental models from " + f.getAbsolutePath() );
+ getLog().debug("Loading supplemental models from " + f.getAbsolutePath());
SupplementalDataModelXpp3Reader reader = new SupplementalDataModelXpp3Reader();
- SupplementalDataModel supplementalModel = reader.read( new FileReader( f ) );
- supplements.addAll( supplementalModel.getSupplement() );
- }
- catch ( Exception e )
- {
+ SupplementalDataModel supplementalModel = reader.read(new FileReader(f));
+ supplements.addAll(supplementalModel.getSupplement());
+ } catch (Exception e) {
String msg = "Error loading supplemental data models: " + e.getMessage();
- getLog().error( msg, e );
- throw new MojoExecutionException( msg, e );
+ getLog().error(msg, e);
+ throw new MojoExecutionException(msg, e);
}
}
@@ -1451,7 +1442,7 @@ public class ProcessRemoteResourcesMojo
default:
getLog().debug( message );
break;
- }
+ }
}
public void log( int level, String message, Throwable t )
@@ -1474,7 +1465,7 @@ public class ProcessRemoteResourcesMojo
default:
getLog().debug( message, t );
break;
- }
+ }
}
public boolean isLevelEnabled( int level )
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java Tue Aug 27 18:25:03 2013
@@ -41,7 +41,6 @@ import java.util.Calendar;
import java.util.Properties;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;
-
import org.codehaus.plexus.util.IOUtil;
@@ -53,7 +52,6 @@ public class RemoteResourcesMojoTest
extends AbstractMojoTestCase
{
static final String DEFAULT_BUNDLE_POM_PATH = "target/test-classes/unit/rrmojotest/bundle-plugin-config.xml";
-
static final String DEFAULT_PROCESS_POM_PATH = "target/test-classes/unit/rrmojotest/process-plugin-config.xml";
public void setUp()
@@ -95,26 +93,39 @@ public class RemoteResourcesMojoTest
public void testCreateBundle()
throws Exception
{
- buildResourceBundle( "default-createbundle", null, new String[]{ "SIMPLE.txt" }, null );
+ buildResourceBundle( "default-createbundle",
+ null,
+ new String[] { "SIMPLE.txt" },
+ null );
}
public void testSimpleBundles()
throws Exception
{
final MavenProjectResourcesStub project = createTestProject( "default-simplebundles" );
- final ProcessRemoteResourcesMojo mojo =
- lookupProcessMojoWithSettings( project, new String[]{ "test:test:1.0" } );
+ final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings( project ,
+ new String[] {
+ "test:test:1.0"
+ } );
setupDefaultProject( project );
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
- String path = repo.pathOf(
- new DefaultArtifact( "test", "test", VersionRange.createFromVersion( "1.0" ), null, "jar", "",
- new DefaultArtifactHandler() ) );
+ String path = repo.pathOf( new DefaultArtifact( "test",
+ "test",
+ VersionRange.createFromVersion( "1.0" ),
+ null,
+ "jar",
+ "",
+ new DefaultArtifactHandler() ) );
File file = new File( repo.getBasedir() + "/" + path + ".jar" );
file.getParentFile().mkdirs();
- buildResourceBundle( "default-simplebundles-create", null, new String[]{ "SIMPLE.txt" }, file );
+ buildResourceBundle( "default-simplebundles-create",
+ null,
+ new String[] { "SIMPLE.txt" },
+ file );
+
mojo.execute();
@@ -127,69 +138,98 @@ public class RemoteResourcesMojoTest
throws Exception
{
final MavenProjectResourcesStub project = createTestProject( "default-simplebundles" );
- final ProcessRemoteResourcesMojo mojo =
- lookupProcessMojoWithSettings( project, new String[]{ "test:test:1.0:war" } );
-
+ final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings( project ,
+ new String[] {
+ "test:test:1.0:war"
+ } );
+
setupDefaultProject( project );
-
+
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
- String path = repo.pathOf(
- new DefaultArtifact( "test", "test", VersionRange.createFromVersion( "1.0" ), null, "war", "",
- new DefaultArtifactHandler() ) );
-
+ String path = repo.pathOf( new DefaultArtifact( "test",
+ "test",
+ VersionRange.createFromVersion( "1.0" ),
+ null,
+ "war",
+ "",
+ new DefaultArtifactHandler() ) );
+
File file = new File( repo.getBasedir() + "/" + path + ".war" );
file.getParentFile().mkdirs();
- buildResourceBundle( "default-simplebundles-create", null, new String[]{ "SIMPLE.txt" }, file );
-
+ buildResourceBundle( "default-simplebundles-create",
+ null,
+ new String[] { "SIMPLE.txt" },
+ file );
+
+
mojo.execute();
-
+
file = (File) getVariableValueFromObject( mojo, "outputDirectory" );
file = new File( file, "SIMPLE.txt" );
assertTrue( file.exists() );
}
-
+
public void testSimpleBundlesWithClassifier()
throws Exception
{
final MavenProjectResourcesStub project = createTestProject( "default-simplebundles" );
- final ProcessRemoteResourcesMojo mojo =
- lookupProcessMojoWithSettings( project, new String[]{ "test:test:1.0:jar:test" } );
-
+ final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings( project ,
+ new String[] {
+ "test:test:1.0:jar:test"
+ } );
+
setupDefaultProject( project );
-
+
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
- String path = repo.pathOf(
- new DefaultArtifact( "test", "test", VersionRange.createFromVersion( "1.0" ), null, "jar", "test",
- new DefaultArtifactHandler() ) );
-
+ String path = repo.pathOf( new DefaultArtifact( "test",
+ "test",
+ VersionRange.createFromVersion( "1.0" ),
+ null,
+ "jar",
+ "test",
+ new DefaultArtifactHandler() ) );
+
File file = new File( repo.getBasedir() + "/" + path + ".jar" );
file.getParentFile().mkdirs();
- buildResourceBundle( "default-simplebundles-create", null, new String[]{ "SIMPLE.txt" }, file );
-
+ buildResourceBundle( "default-simplebundles-create",
+ null,
+ new String[] { "SIMPLE.txt" },
+ file );
+
+
mojo.execute();
-
+
file = (File) getVariableValueFromObject( mojo, "outputDirectory" );
file = new File( file, "SIMPLE.txt" );
assertTrue( file.exists() );
}
-
+
public void testVelocityUTF8()
throws Exception
{
final MavenProjectResourcesStub project = createTestProject( "default-utf8" );
- final ProcessRemoteResourcesMojo mojo =
- lookupProcessMojoWithSettings( project, new String[]{ "test:test:1.2" } );
+ final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings( project ,
+ new String[] {
+ "test:test:1.2"
+ } );
setupDefaultProject( project );
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
- String path = repo.pathOf(
- new DefaultArtifact( "test", "test", VersionRange.createFromVersion( "1.2" ), null, "jar", "",
- new DefaultArtifactHandler() ) );
+ String path = repo.pathOf( new DefaultArtifact( "test",
+ "test",
+ VersionRange.createFromVersion( "1.2" ),
+ null,
+ "jar",
+ "",
+ new DefaultArtifactHandler() ) );
File file = new File( repo.getBasedir() + "/" + path + ".jar" );
file.getParentFile().mkdirs();
- buildResourceBundle( "default-utf8-create", "UTF-8", new String[]{ "UTF-8.bin.vm" }, file );
+ buildResourceBundle( "default-utf8-create",
+ "UTF-8",
+ new String[] { "UTF-8.bin.vm" },
+ file );
mojo.execute();
@@ -209,19 +249,28 @@ public class RemoteResourcesMojoTest
throws Exception
{
final MavenProjectResourcesStub project = createTestProject( "default-iso88591" );
- final ProcessRemoteResourcesMojo mojo =
- lookupProcessMojoWithSettings( project, new String[]{ "test:test:1.3" } );
+ final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings( project ,
+ new String[] {
+ "test:test:1.3"
+ } );
setupDefaultProject( project );
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
- String path = repo.pathOf(
- new DefaultArtifact( "test", "test", VersionRange.createFromVersion( "1.3" ), null, "jar", "",
- new DefaultArtifactHandler() ) );
+ String path = repo.pathOf( new DefaultArtifact( "test",
+ "test",
+ VersionRange.createFromVersion( "1.3" ),
+ null,
+ "jar",
+ "",
+ new DefaultArtifactHandler() ) );
File file = new File( repo.getBasedir() + "/" + path + ".jar" );
file.getParentFile().mkdirs();
- buildResourceBundle( "default-iso88591-create", "ISO-8859-1", new String[]{ "ISO-8859-1.bin.vm" }, file );
+ buildResourceBundle( "default-iso88591-create",
+ "ISO-8859-1",
+ new String[] { "ISO-8859-1.bin.vm" },
+ file );
mojo.execute();
@@ -241,19 +290,29 @@ public class RemoteResourcesMojoTest
throws Exception
{
final MavenProjectResourcesStub project = createTestProject( "default-filterbundles" );
- final ProcessRemoteResourcesMojo mojo =
- lookupProcessMojoWithSettings( project, new String[]{ "test:test:1.1" } );
+ final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings( project ,
+ new String[] {
+ "test:test:1.1"
+ } );
setupDefaultProject( project );
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
- String path = repo.pathOf(
- new DefaultArtifact( "test", "test", VersionRange.createFromVersion( "1.1" ), null, "jar", "",
- new DefaultArtifactHandler() ) );
+ String path = repo.pathOf( new DefaultArtifact( "test",
+ "test",
+ VersionRange.createFromVersion( "1.1" ),
+ null,
+ "jar",
+ "",
+ new DefaultArtifactHandler() ) );
File file = new File( repo.getBasedir() + "/" + path + ".jar" );
file.getParentFile().mkdirs();
- buildResourceBundle( "default-filterbundles-create", null, new String[]{ "FILTER.txt.vm" }, file );
+ buildResourceBundle( "default-filterbundles-create",
+ null,
+ new String[] { "FILTER.txt.vm" },
+ file );
+
mojo.execute();
// executing a second time (example: forked lifecycle) should still work
@@ -264,16 +323,16 @@ public class RemoteResourcesMojoTest
assertTrue( file.exists() );
String data = FileUtils.fileRead( file );
- assertTrue( data.contains( "2007" ) );
- assertTrue( data.contains( "default-filterbundles" ) );
+ assertTrue(data.contains("2007"));
+ assertTrue(data.contains("default-filterbundles"));
}
public void testFilteredBundlesWithProjectProperties()
- throws Exception
+ throws Exception
{
final MavenProjectResourcesStub project = createTestProject( "default-filterbundles-two" );
final ProcessRemoteResourcesMojo mojo =
- lookupProcessMojoWithSettings( project, new String[]{ "test-filtered-bundles:test-filtered-bundles:2" } );
+ lookupProcessMojoWithSettings( project, new String[]{"test-filtered-bundles:test-filtered-bundles:2"} );
mojo.includeProjectProperties = true;
setupDefaultProject( project );
@@ -288,7 +347,7 @@ public class RemoteResourcesMojoTest
File file = new File( repo.getBasedir() + "/" + path + ".jar" );
file.getParentFile().mkdirs();
- buildResourceBundle( "default-filterbundles-two-create", null, new String[]{ "PROPERTIES.txt.vm" }, file );
+ buildResourceBundle( "default-filterbundles-two-create", null, new String[]{"PROPERTIES.txt.vm"}, file );
mojo.execute();
// executing a second time (example: forked lifecycle) should still work
@@ -300,26 +359,28 @@ public class RemoteResourcesMojoTest
assertTrue( file.exists() );
String data = FileUtils.fileRead( file );
- assertTrue( data.contains( "maven" ) );
- assertTrue( data.contains( "rules" ) );
+ assertTrue(data.contains("maven"));
+ assertTrue(data.contains("rules"));
}
- protected void buildResourceBundle( String id, String sourceEncoding, String resourceNames[], File jarName )
- throws Exception
+ protected void buildResourceBundle( String id,
+ String sourceEncoding,
+ String resourceNames[],
+ File jarName )
+ throws Exception
{
final MavenProjectResourcesStub project = createTestProject( id );
final File resourceDir = new File( project.getBasedir() + "/src/main/resources" );
- final BundleRemoteResourcesMojo mojo = lookupBundleMojoWithSettings( project, resourceDir, sourceEncoding );
+ final BundleRemoteResourcesMojo mojo = lookupBundleMojoWithSettings( project , resourceDir, sourceEncoding );
setupDefaultProject( project );
- for ( String resourceName2 : resourceNames )
- {
- File resource = new File( resourceDir, resourceName2 );
- URL source = getClass().getResource( "/" + resourceName2 );
+ for (String resourceName2 : resourceNames) {
+ File resource = new File(resourceDir, resourceName2);
+ URL source = getClass().getResource("/" + resourceName2);
- FileUtils.copyURLToFile( source, resource );
+ FileUtils.copyURLToFile(source, resource);
}
mojo.execute();
@@ -328,9 +389,8 @@ public class RemoteResourcesMojoTest
assertTrue( xmlFile.exists() );
String data = FileUtils.fileRead( xmlFile );
- for ( String resourceName1 : resourceNames )
- {
- assertTrue( data.contains( resourceName1 ) );
+ for (String resourceName1 : resourceNames) {
+ assertTrue(data.contains(resourceName1));
}
if ( null != jarName )
@@ -340,13 +400,12 @@ public class RemoteResourcesMojoTest
jar.write( data.getBytes() );
jar.closeEntry();
- for ( String resourceName : resourceNames )
- {
- File resource = new File( resourceDir, resourceName );
- InputStream in = new FileInputStream( resource );
- jar.putNextEntry( new ZipEntry( resourceName ) );
- IOUtil.copy( in, jar );
- IOUtil.close( in );
+ for (String resourceName : resourceNames) {
+ File resource = new File(resourceDir, resourceName);
+ InputStream in = new FileInputStream(resource);
+ jar.putNextEntry(new ZipEntry(resourceName));
+ IOUtil.copy(in, jar);
+ IOUtil.close(in);
jar.closeEntry();
}
jar.close();
@@ -354,16 +413,16 @@ public class RemoteResourcesMojoTest
}
+
protected MavenProjectResourcesStub createTestProject( final String testName )
- throws Exception
+ throws Exception
{
// this will automatically create the isolated
// test environment
return new MavenProjectResourcesStub( testName );
}
-
protected void setupDefaultProject( final MavenProjectResourcesStub project )
- throws Exception
+ throws Exception
{
// put this on the root dir
project.addFile( "pom.xml", MavenProjectResourcesStub.ROOT_FILE );
@@ -374,7 +433,7 @@ public class RemoteResourcesMojoTest
protected BundleRemoteResourcesMojo lookupBundleMojo()
- throws Exception
+ throws Exception
{
File pomFile = new File( getBasedir(), DEFAULT_BUNDLE_POM_PATH );
BundleRemoteResourcesMojo mojo = (BundleRemoteResourcesMojo) lookupMojo( "bundle", pomFile );
@@ -383,17 +442,15 @@ public class RemoteResourcesMojoTest
return mojo;
}
-
protected BundleRemoteResourcesMojo lookupBundleMojoWithDefaultSettings( final MavenProject project )
throws Exception
{
File resourceDir = new File( project.getBasedir() + "/src/main/resources" );
return lookupBundleMojoWithSettings( project, resourceDir, null );
}
-
- protected BundleRemoteResourcesMojo lookupBundleMojoWithSettings( final MavenProject project, File resourceDir,
- String sourceEncoding )
- throws Exception
+ protected BundleRemoteResourcesMojo lookupBundleMojoWithSettings( final MavenProject project,
+ File resourceDir, String sourceEncoding )
+ throws Exception
{
final BundleRemoteResourcesMojo mojo = lookupBundleMojo();
@@ -415,24 +472,28 @@ public class RemoteResourcesMojoTest
}
- protected ProcessRemoteResourcesMojo lookupProcessMojoWithSettings( final MavenProject project, String bundles[] )
+ protected ProcessRemoteResourcesMojo lookupProcessMojoWithSettings( final MavenProject project,
+ String bundles[] )
throws Exception
{
return lookupProcessMojoWithSettings( project, new ArrayList<String>( Arrays.asList( bundles ) ) );
}
protected ProcessRemoteResourcesMojo lookupProcessMojoWithSettings( final MavenProject project,
- ArrayList<String> bundles )
+ ArrayList<String> bundles )
throws Exception
{
final ProcessRemoteResourcesMojo mojo = lookupProcessMojo();
- MavenSession session = new MavenSession( container, null, //Settings settings,
- null, //ArtifactRepository localRepository,
- null, //EventDispatcher eventDispatcher,
- new ReactorManager( new ArrayList<MavenProject>() ),
- Arrays.asList( "install" ), project.getBasedir().toString(),
- new Properties(), Calendar.getInstance().getTime() );
+ MavenSession session = new MavenSession( container,
+ null, //Settings settings,
+ null, //ArtifactRepository localRepository,
+ null, //EventDispatcher eventDispatcher,
+ new ReactorManager(new ArrayList<MavenProject>()),
+ Arrays.asList("install"),
+ project.getBasedir().toString(),
+ new Properties(),
+ Calendar.getInstance().getTime() );
setVariableValueToObject( mojo, "project", project );
setVariableValueToObject( mojo, "outputDirectory", new File( project.getBuild().getOutputDirectory() ) );
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java Tue Aug 27 18:25:03 2013
@@ -52,8 +52,8 @@ public class IT_BadDependencyPoms
File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
- assertTrue( content.contains( "Dependency Id: test:missing:0.1" ) );
- assertTrue( content.contains( "Dependency Id: test:pom:0.2" ) );
+ assertTrue(content.contains("Dependency Id: test:missing:0.1"));
+ assertTrue(content.contains("Dependency Id: test:pom:0.2"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java Tue Aug 27 18:25:03 2013
@@ -31,24 +31,24 @@ import java.net.URISyntaxException;
public class IT_CustomFilterDelimiter
extends AbstractIT
{
-
+
@SuppressWarnings( "unchecked" )
public void test()
throws IOException, URISyntaxException, VerificationException
{
File dir = TestUtils.getTestDir( "custom-filter-delim" );
Verifier verifier = new Verifier( dir.getAbsolutePath() );
-
+
verifier.getCliOptions().add( "-X" );
-
+
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
-
+
File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
-
- assertTrue( content.contains( "Override: custom-filter-delim" ) );
+
+ assertTrue(content.contains("Override: custom-filter-delim"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java Tue Aug 27 18:25:03 2013
@@ -31,21 +31,21 @@ import java.net.URISyntaxException;
public class IT_FilterLocalOverride
extends AbstractIT
{
-
+
public void test()
throws IOException, URISyntaxException, VerificationException
{
File dir = TestUtils.getTestDir( "filter-local-override" );
Verifier verifier = new Verifier( dir.getAbsolutePath() );
-
+
verifier.executeGoal( "generate-resources" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
-
+
File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
-
- assertTrue( content.contains( "Override: filter-local-override" ) );
+
+ assertTrue(content.contains("Override: filter-local-override"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java Tue Aug 27 18:25:03 2013
@@ -31,21 +31,21 @@ import java.net.URISyntaxException;
public class IT_GenerateFromBundle
extends AbstractIT
{
-
+
public void test()
throws IOException, URISyntaxException, VerificationException
{
File dir = TestUtils.getTestDir( "generate-from-bundle" );
Verifier verifier = new Verifier( dir.getAbsolutePath() );
-
+
verifier.executeGoal( "generate-resources" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
-
+
File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
-
- assertTrue( content.contains( "Built-In:" ) );
+
+ assertTrue(content.contains("Built-In:"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java Tue Aug 27 18:25:03 2013
@@ -31,21 +31,21 @@ import java.net.URISyntaxException;
public class IT_GenerateFromBundleWithTypeAndClassifier
extends AbstractIT
{
-
+
public void test()
throws IOException, URISyntaxException, VerificationException
{
File dir = TestUtils.getTestDir( "generate-from-bundle-with-type-and-classifier" );
Verifier verifier = new Verifier( dir.getAbsolutePath() );
-
+
verifier.executeGoal( "generate-resources" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
-
+
File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
-
- assertTrue( content.contains( "Built-In:" ) );
+
+ assertTrue(content.contains("Built-In:"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java Tue Aug 27 18:25:03 2013
@@ -31,21 +31,21 @@ import java.net.URISyntaxException;
public class IT_GenerateFromOverride
extends AbstractIT
{
-
+
public void test()
throws IOException, URISyntaxException, VerificationException
{
File dir = TestUtils.getTestDir( "generate-from-override" );
Verifier verifier = new Verifier( dir.getAbsolutePath() );
-
+
verifier.executeGoal( "generate-resources" );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
-
+
File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
-
- assertTrue( content.contains( "Override:" ) );
+
+ assertTrue(content.contains("Override:"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java Tue Aug 27 18:25:03 2013
@@ -58,9 +58,8 @@ public class IT_GetDependencyProjects
File output = new File( dir, "project/target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
- assertTrue( content.contains( "Dependency Id: org.apache.maven.plugin.rresource.it.gdp:release:1.0" ) );
- assertTrue(
- content.contains( "Dependency Id: org.apache.maven.plugin.rresource.it.gdp:snapshot:1.0-SNAPSHOT" ) );
+ assertTrue(content.contains("Dependency Id: org.apache.maven.plugin.rresource.it.gdp:release:1.0"));
+ assertTrue(content.contains("Dependency Id: org.apache.maven.plugin.rresource.it.gdp:snapshot:1.0-SNAPSHOT"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java Tue Aug 27 18:25:03 2013
@@ -58,15 +58,14 @@ public class IT_RunOnlyAtExecutionRoot
String depResource = "target/maven-shared-archive-resources/DEPENDENCIES";
File output = new File( dir, depResource );
assertTrue( output.exists() );
-
+
assertFalse( new File( dir, "child1/" + depResource ).exists() );
assertFalse( new File( dir, "child2/" + depResource ).exists() );
-
+
String content = FileUtils.fileRead( output );
- assertTrue( content.contains( "Dependency Id: org.apache.maven.plugin.rresource.it.mrr41:release:1.0" ) );
- assertTrue(
- content.contains( "Dependency Id: org.apache.maven.plugin.rresource.it.mrr41:snapshot:1.0-SNAPSHOT" ) );
+ assertTrue(content.contains("Dependency Id: org.apache.maven.plugin.rresource.it.mrr41:release:1.0"));
+ assertTrue(content.contains("Dependency Id: org.apache.maven.plugin.rresource.it.mrr41:snapshot:1.0-SNAPSHOT"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java Tue Aug 27 18:25:03 2013
@@ -44,7 +44,7 @@ public class IT_SupplementalArtifact
Verifier verifier;
verifier = new Verifier( resources.getAbsolutePath() );
-
+
verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.mrr43" );
verifier.executeGoal( "deploy" );
@@ -59,10 +59,9 @@ public class IT_SupplementalArtifact
File output = new File( dir, "target/maven-shared-archive-resources/DEPENDENCIES" );
String content = FileUtils.fileRead( output );
-
- assertTrue( content.contains( "From: 'Deficient Tooling, Inc.' (http://www.deficient-tools.us/)" ) );
- assertTrue( content.contains(
- "Deficient Dependency (http://www.deficient-tools.us/dep) org.apache.maven.plugin.rresource.it.mrr43:deficient-dep" ) );
+
+ assertTrue(content.contains("From: 'Deficient Tooling, Inc.' (http://www.deficient-tools.us/)"));
+ assertTrue(content.contains("Deficient Dependency (http://www.deficient-tools.us/dep) org.apache.maven.plugin.rresource.it.mrr43:deficient-dep"));
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectBuildStub.java Tue Aug 27 18:25:03 2013
@@ -223,20 +223,17 @@ public class MavenProjectBuildStub
{
File currentDirectory;
- for ( String aDirectoryList : directoryList )
- {
- currentDirectory = new File( parent, "/" + aDirectoryList );
+ for (String aDirectoryList : directoryList) {
+ currentDirectory = new File(parent, "/" + aDirectoryList);
- if ( !currentDirectory.exists() )
- {
+ if (!currentDirectory.exists()) {
currentDirectory.mkdirs();
}
// duplicate dir structure in test resources
- currentDirectory = new File( testparent, "/" + aDirectoryList );
+ currentDirectory = new File(testparent, "/" + aDirectoryList);
- if ( !currentDirectory.exists() )
- {
+ if (!currentDirectory.exists()) {
currentDirectory.mkdirs();
}
}
@@ -248,16 +245,16 @@ public class MavenProjectBuildStub
switch ( type )
{
- case SOURCE_FILE:
+ case SOURCE_FILE :
retVal = sourceFileList;
break;
- case OUTPUT_FILE:
+ case OUTPUT_FILE :
retVal = targetClassesList;
break;
- case RESOURCES_FILE:
+ case RESOURCES_FILE :
retVal = resourcesFileList;
break;
- case ROOT_FILE:
+ case ROOT_FILE :
retVal = rootFileList;
break;
}
@@ -276,26 +273,20 @@ public class MavenProjectBuildStub
return;
}
- for ( String aList : list )
- {
- currentFile = new File( parent, aList );
+ for (String aList : list) {
+ currentFile = new File(parent, aList);
// create the necessary parent directories
// before we create the files
- if ( !currentFile.getParentFile().exists() )
- {
+ if (!currentFile.getParentFile().exists()) {
currentFile.getParentFile().mkdirs();
}
- if ( !currentFile.exists() )
- {
- try
- {
+ if (!currentFile.exists()) {
+ try {
currentFile.createNewFile();
- populateFile( currentFile, RESOURCES_FILE );
- }
- catch ( IOException io )
- {
+ populateFile(currentFile, RESOURCES_FILE);
+ } catch (IOException io) {
//TODO: handle exception
}
}
Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectResourcesStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectResourcesStub.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectResourcesStub.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/stub/MavenProjectResourcesStub.java Tue Aug 27 18:25:03 2013
@@ -39,49 +39,49 @@ public class MavenProjectResourcesStub
public void addInclude( String pattern )
{
- build.getResources().get( 0 ).addInclude( pattern );
+ build.getResources().get( 0 ).addInclude(pattern);
}
public void addExclude( String pattern )
{
- build.getResources().get( 0 ).addExclude( pattern );
+ build.getResources().get( 0 ).addExclude(pattern);
}
public void addTestInclude( String pattern )
{
- build.getTestResources().get( 0 ).addInclude( pattern );
+ build.getTestResources().get( 0 ).addInclude(pattern);
}
public void addTestExclude( String pattern )
{
- build.getTestResources().get( 0 ).addExclude( pattern );
+ build.getTestResources().get( 0 ).addExclude(pattern);
}
public void setTargetPath( String path )
{
- build.getResources().get( 0 ).setTargetPath( path );
+ build.getResources().get( 0 ).setTargetPath(path);
}
public void setTestTargetPath( String path )
{
- build.getTestResources().get( 0 ).setTargetPath( path );
+ build.getTestResources().get( 0 ).setTargetPath(path);
}
public void setDirectory( String dir )
{
- build.getResources().get( 0 ).setDirectory( dir );
+ build.getResources().get( 0 ).setDirectory(dir);
}
public void setTestDirectory( String dir )
{
- build.getTestResources().get( 0 ).setDirectory( dir );
+ build.getTestResources().get( 0 ).setDirectory(dir);
}
public void setResourceFiltering( int nIndex, boolean filter )
{
if ( build.getResources().size() > nIndex )
{
- build.getResources().get( nIndex ).setFiltering( filter );
+ build.getResources().get( nIndex ).setFiltering(filter);
}
}
Modified: maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target-no-scm/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target-no-scm/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target-no-scm/pom.xml (original)
+++ maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target-no-scm/pom.xml Tue Aug 27 18:25:03 2013
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -11,14 +10,14 @@
<relativePath>../../it-parent/pom.xml</relativePath>
</parent>
- <artifactId>bundle-pack-target-no-scm</artifactId>
+ <artifactId>bundle-pack-target-no-scm</artifactId>
<version>1.0</version>
-
+
<name>bundle-pack Target without SCM</name>
<description>Target for the bundle:bundle-pack goal ITs that is missing the SCM section</description>
-
+
<url>http://maven.apache.org/plugins/maven-repository-plugin/test</url>
-
+
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
Modified: maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target/pom.xml (original)
+++ maven/plugins/trunk/maven-repository-plugin/src/it/bootstrap/bundle-pack-target/pom.xml Tue Aug 27 18:25:03 2013
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -11,14 +10,14 @@
<relativePath>../../it-parent/pom.xml</relativePath>
</parent>
- <artifactId>bundle-pack-target</artifactId>
+ <artifactId>bundle-pack-target</artifactId>
<version>1.0</version>
-
+
<name>bundle-pack Target</name>
<description>Target for the bundle:bundle-pack goal ITs</description>
-
+
<url>http://maven.apache.org/plugins/maven-repository-plugin/test</url>
-
+
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
@@ -26,7 +25,7 @@
<distribution>repo</distribution>
</license>
</licenses>
-
+
<scm>
<url>http://foo/</url>
<connection>scm:svn:http://foo/</connection>
Modified: maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleUtils.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleUtils.java (original)
+++ maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleUtils.java Tue Aug 27 18:25:03 2013
@@ -38,10 +38,9 @@ final class BundleUtils
private BundleUtils()
{
}
-
- public static List<File> selectProjectFiles( final File dir, final InputHandler inputHandler,
- final String finalName, final File pom, final Log log,
- final boolean batchMode )
+
+ public static List<File> selectProjectFiles( final File dir, final InputHandler inputHandler, final String finalName,
+ final File pom, final Log log, final boolean batchMode )
throws MojoExecutionException
{
File[] projectFiles = dir.listFiles( new FilenameFilter()
@@ -51,57 +50,50 @@ final class BundleUtils
return new File( dir, name ).isFile() && name.startsWith( finalName );
}
} );
-
+
List<File> result = new ArrayList<File>();
-
+
if ( projectFiles == null )
{
return result;
}
- for ( File projectFile : projectFiles )
- {
- if ( projectFile.getName().endsWith( ".pom" ) )
- {
- if ( !projectFile.equals( pom ) )
- {
- log.info( "Detected POM file will be excluded:\n" + projectFile
- + "\n\nInstead, the bundle will include the POM from:\n" + pom );
+ for (File projectFile : projectFiles) {
+ if (projectFile.getName().endsWith(".pom")) {
+ if (!projectFile.equals(pom)) {
+ log.info("Detected POM file will be excluded:\n" + projectFile
+ + "\n\nInstead, the bundle will include the POM from:\n" + pom);
}
- }
- else if ( projectFile.getName().endsWith( "-bundle.jar" ) )
- {
- log.warn( "Skipping project file which collides with repository bundle filename:\n" + projectFile );
- }
- else
- {
- result.add( projectFile );
+ } else if (projectFile.getName().endsWith("-bundle.jar")) {
+ log.warn("Skipping project file which collides with repository bundle filename:\n" + projectFile);
+ } else {
+ result.add(projectFile);
}
}
-
+
if ( result.isEmpty() )
{
return result;
}
-
+
Collections.sort( result, new Comparator<File>()
{
public int compare( File first, File second )
{
String f = first.getName();
String s = second.getName();
-
+
if ( f.length() == s.length() )
{
return f.compareTo( s );
}
-
+
return f.length() < s.length() ? -1 : 1;
}
} );
-
+
result = reviseFileList( result, inputHandler, log, batchMode );
-
+
return result;
}
@@ -109,28 +101,28 @@ final class BundleUtils
throws MojoExecutionException
{
List<File> result = new ArrayList<File>( input );
-
+
if ( batchMode )
{
return result;
}
-
- while ( true )
+
+ while( true )
{
StringBuilder message = new StringBuilder();
message.append( "The following files are marked for inclusion in the repository bundle:\n" );
message.append( "\n0.) Done" );
-
+
int i = 1;
for ( File f : result )
{
- message.append( "\n" ).append( ( i++ ) ).append( ".) " ).append( f.getName() );
+ message.append( "\n" ).append( (i++) ).append( ".) " ).append( f.getName() );
}
-
+
message.append( "\n\nPlease select the number(s) for any files you wish to exclude, " +
- "or '0' when you're done.\nSeparate the numbers for multiple files with a " +
- "comma (',').\n\nSelection: " );
-
+ "or '0' when you're done.\nSeparate the numbers for multiple files with a " +
+ "comma (',').\n\nSelection: " );
+
log.info( message );
String response;
try
@@ -139,17 +131,16 @@ final class BundleUtils
}
catch ( IOException e )
{
- throw new MojoExecutionException(
- "Project file selection failed with an I/O exception: " + e.getMessage(), e );
+ throw new MojoExecutionException( "Project file selection failed with an I/O exception: " + e.getMessage(), e );
}
-
+
if ( response == null || "0".equals( response ) )
{
break;
}
-
+
StringTokenizer st = new StringTokenizer( response, "," );
-
+
if ( st.countTokens() > 0 )
{
int[] idxs = new int[st.countTokens()];
@@ -157,18 +148,18 @@ final class BundleUtils
{
idxs[j] = Integer.parseInt( st.nextToken().trim() );
}
-
+
Arrays.sort( idxs );
-
- for ( int k = idxs.length - 1; k > -1; k-- )
+
+ for( int k = idxs.length - 1; k > -1; k-- )
{
if ( idxs[k] < 1 || idxs[k] > result.size() )
{
log.warn( "NOT removing: " + idxs[k] + "; no such file." );
continue;
}
-
- File removed = result.remove( idxs[k] - 1 );
+
+ File removed = result.remove( idxs[k] -1 );
log.info( "Removed: " + removed.getName() );
}
}
@@ -177,7 +168,7 @@ final class BundleUtils
break;
}
}
-
+
return result;
}
Modified: maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/BundleCreateMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/BundleCreateMojoTest.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/BundleCreateMojoTest.java (original)
+++ maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/BundleCreateMojoTest.java Tue Aug 27 18:25:03 2013
@@ -50,7 +50,7 @@ public class BundleCreateMojoTest
/**
* Test for repository plugin with project.packaging == pom
- *
+ *
* @throws Exception
*/
public void testDefaults_PomPackaging()
@@ -68,7 +68,8 @@ public class BundleCreateMojoTest
e.printStackTrace();
}
- File bundleSource = new File( getBasedir(), "target/test/unit/pom-only/target/pom-only-bundle.jar" );
+ File bundleSource =
+ new File( getBasedir(), "target/test/unit/pom-only/target/pom-only-bundle.jar" );
assertTrue( FileUtils.fileExists( bundleSource.getAbsolutePath() ) );
Set<String> entryNames = new HashSet<String>();
@@ -81,7 +82,7 @@ public class BundleCreateMojoTest
/**
* Test for repository plugin default configuration
- *
+ *
* @throws Exception
*/
public void testDefaultconfiguration()
@@ -90,8 +91,8 @@ public class BundleCreateMojoTest
try
{
- createTestJars( "default-configuration", true, true,
- getBasedir() + "/target/test/unit/default-configuration/target" );
+ createTestJars( "default-configuration", true, true, getBasedir()
+ + "/target/test/unit/default-configuration/target" );
}
catch ( IOException ie )
{
@@ -130,8 +131,8 @@ public class BundleCreateMojoTest
{
try
{
- createTestJars( "default-configuration", true, true,
- getBasedir() + "/target/test/unit/default-configuration/target" );
+ createTestJars( "default-configuration", true, true, getBasedir()
+ + "/target/test/unit/default-configuration/target" );
}
catch ( IOException ie )
{
@@ -180,8 +181,8 @@ public class BundleCreateMojoTest
{
try
{
- createTestJars( "default-configuration", true, true,
- getBasedir() + "/target/test/unit/default-configuration/target" );
+ createTestJars( "default-configuration", true, true, getBasedir()
+ + "/target/test/unit/default-configuration/target" );
}
catch ( IOException ie )
{
@@ -230,8 +231,8 @@ public class BundleCreateMojoTest
{
try
{
- createTestJars( "default-configuration", true, true,
- getBasedir() + "/target/test/unit/default-configuration/target" );
+ createTestJars( "default-configuration", true, true, getBasedir()
+ + "/target/test/unit/default-configuration/target" );
}
catch ( IOException ie )
{
@@ -280,8 +281,8 @@ public class BundleCreateMojoTest
{
try
{
- createTestJars( "default-configuration", true, true,
- getBasedir() + "/target/test/unit/default-configuration/target" );
+ createTestJars( "default-configuration", true, true, getBasedir()
+ + "/target/test/unit/default-configuration/target" );
}
catch ( IOException ie )
{
@@ -327,7 +328,7 @@ public class BundleCreateMojoTest
/**
* Test repository plugin when there is no javadoc jar to be included in the bundle
- *
+ *
* @throws Exception
*/
public void testNoJavadocJar()
@@ -370,7 +371,7 @@ public class BundleCreateMojoTest
/**
* Test repository plugin when there is no sources jar to be included in the bundle
- *
+ *
* @throws Exception
*/
public void testNoSourcesJar()
@@ -413,7 +414,7 @@ public class BundleCreateMojoTest
/**
* Test repository plugin when there are no javadoc and sources jar files to be included in the bundle
- *
+ *
* @throws Exception
*/
public void testNoJavadocSourcesJars()
@@ -422,8 +423,8 @@ public class BundleCreateMojoTest
try
{
- createTestJars( "no-javadoc-sources", false, false,
- getBasedir() + "/target/test/unit/no-javadoc-sources/target" );
+ createTestJars( "no-javadoc-sources", false, false, getBasedir()
+ + "/target/test/unit/no-javadoc-sources/target" );
}
catch ( IOException ie )
{
@@ -461,7 +462,7 @@ public class BundleCreateMojoTest
/**
* Test repository plugin when the scm element is null
- *
+ *
* @throws Exception
*/
public void testNullScm()
@@ -485,7 +486,7 @@ public class BundleCreateMojoTest
// MREPOSITORY-2 project.scm.connection should not be required for bundle-create
// MREPOSITORY-19 project.scm.{url|connection} are required for project materialization...
- fail( "Must throw an exception on a project element scm is null" );
+ fail( "Must throw an exception on a project element scm is null" );
}
catch ( MojoExecutionException e )
{
@@ -496,7 +497,7 @@ public class BundleCreateMojoTest
/**
* Test repository plugin when license file does not exist
- *
+ *
* @throws Exception
*/
public void testNoLicense()
@@ -505,8 +506,7 @@ public class BundleCreateMojoTest
try
{
- createTestJars( "no-license-file", false, false,
- getBasedir() + "/target/test/unit/no-license-file/target" );
+ createTestJars( "no-license-file", false, false, getBasedir() + "/target/test/unit/no-license-file/target" );
}
catch ( IOException ie )
{
@@ -530,7 +530,7 @@ public class BundleCreateMojoTest
/**
* Test repository plugin when there is no project name specified in the pom
- *
+ *
* @throws Exception
*/
public void testNoProjectName()
@@ -538,8 +538,7 @@ public class BundleCreateMojoTest
{
try
{
- createTestJars( "no-project-name", false, false,
- getBasedir() + "/target/test/unit/no-project-name/target" );
+ createTestJars( "no-project-name", false, false, getBasedir() + "/target/test/unit/no-project-name/target" );
}
catch ( IOException ie )
{
@@ -563,11 +562,15 @@ public class BundleCreateMojoTest
/**
* Method for creating the jar files that will be used in testing
- *
- * @param fileName the file name of the jar file(s) to be created
- * @param createJavadocJar specifies whether a javadoc jar file will be created or not
- * @param createSourcesJar specifies whether a sources jar file will be created or not
- * @param destDir the destination directory where the jar file(s) are to be created
+ *
+ * @param fileName
+ * the file name of the jar file(s) to be created
+ * @param createJavadocJar
+ * specifies whether a javadoc jar file will be created or not
+ * @param createSourcesJar
+ * specifies whether a sources jar file will be created or not
+ * @param destDir
+ * the destination directory where the jar file(s) are to be created
* @throws IOException
*/
private void createTestJars( String fileName, boolean createJavadocJar, boolean createSourcesJar, String destDir )
Modified: maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/testutil/TestInputHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/testutil/TestInputHandler.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/testutil/TestInputHandler.java (original)
+++ maven/plugins/trunk/maven-repository-plugin/src/test/java/org/apache/maven/plugins/repository/testutil/TestInputHandler.java Tue Aug 27 18:25:03 2013
@@ -28,11 +28,11 @@ import java.util.Stack;
public class TestInputHandler
implements InputHandler
{
-
+
private Stack<String> lineResponses;
-
+
private Stack<List<String>> lineListResponses;
-
+
private Stack<String> passwordResponses;
public String readLine()
Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/PropertyUtils.java Tue Aug 27 18:25:03 2013
@@ -28,10 +28,11 @@ import java.io.IOException;
import java.util.Properties;
/**
+ * @deprecated use classes in the component maven-filtering
+ * TODO remove the class ?
* @author <a href="mailto:kenney@neonics.com">Kenney Westerhof</a>
* @author William Ferguson
- * @deprecated use classes in the component maven-filtering
- * TODO remove the class ?
+ *
*/
public final class PropertyUtils
{
@@ -47,7 +48,7 @@ public final class PropertyUtils
* resolution the value of property B will contain the value of property B.
* </p>
*
- * @param propFile The property file to load.
+ * @param propFile The property file to load.
* @param baseProps Properties containing the initial values to subsitute into the properties file.
* @return Properties object containing the properties in the file with their values fully resolved.
* @throws IOException if profile does not exist, or cannot be read.
@@ -84,11 +85,10 @@ public final class PropertyUtils
// as can be verified by replacing the implementation of #loadPropertyFile(File, boolean, boolean)
// with the commented variant I have provided that reuses this method.
- for ( Object o : fileProps.keySet() )
- {
+ for (Object o : fileProps.keySet()) {
final String k = (String) o;
- final String propValue = getPropertyValue( k, combinedProps );
- fileProps.setProperty( k, propValue );
+ final String propValue = getPropertyValue(k, combinedProps);
+ fileProps.setProperty(k, propValue);
}
return fileProps;
@@ -97,8 +97,8 @@ public final class PropertyUtils
/**
* Reads a property file, resolving all internal variables.
*
- * @param propfile The property file to load
- * @param fail wheter to throw an exception when the file cannot be loaded or to return null
+ * @param propfile The property file to load
+ * @param fail wheter to throw an exception when the file cannot be loaded or to return null
* @param useSystemProps wheter to incorporate System.getProperties settings into the returned Properties object.
* @return the loaded and fully resolved Properties object
*/
@@ -137,7 +137,7 @@ public final class PropertyUtils
/**
* Retrieves a property value, replacing values like ${token}
* using the Properties to look them up.
- * <p/>
+ *
* It will leave unresolved properties alone, trying for System
* properties, and implements reparsing (in the case that
* the value of a property contains a key), and will
Modified: maven/plugins/trunk/maven-resources-plugin/src/test/java/org/apache/maven/plugin/resources/ResourcesMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/test/java/org/apache/maven/plugin/resources/ResourcesMojoTest.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/test/java/org/apache/maven/plugin/resources/ResourcesMojoTest.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/test/java/org/apache/maven/plugin/resources/ResourcesMojoTest.java Tue Aug 27 18:25:03 2013
@@ -39,10 +39,10 @@ public class ResourcesMojoTest
extends AbstractMojoTestCase
{
protected final static String defaultPomFilePath = "/target/test-classes/unit/resources-test/plugin-config.xml";
-
+
/**
* test mojo lookup, test harness should be working fine
- *
+ *
* @throws Exception
*/
public void testHarnessEnvironment()
@@ -53,7 +53,7 @@ public class ResourcesMojoTest
assertNotNull( mojo );
}
-
+
/**
* @throws Exception
*/
@@ -324,8 +324,8 @@ public class ResourcesMojoTest
setVariableValueToObject( mojo, "buildFilters", new LinkedList() );
setVariableValueToObject( mojo, "useBuildFilters", Boolean.TRUE );
setVariableValueToObject( mojo, "escapeWindowsPaths", Boolean.TRUE );
- MavenSession mavenSession =
- new MavenSession( null, null, null, null, null, null, null, System.getProperties(), null );
+ MavenSession mavenSession = new MavenSession( null, null, null, null, null, null, null, System.getProperties(),
+ null );
setVariableValueToObject( mojo, "session", mavenSession );
mojo.execute();
@@ -337,7 +337,7 @@ public class ResourcesMojoTest
Properties props = new Properties();
props.load( new FileInputStream( new File( resourcesDir, "file4.txt" ) ) );
File fileFromFiltering = new File( props.getProperty( "current-working-directory" ) );
-
+
assertTrue( fileFromFiltering.getAbsolutePath() + " does not exist.", fileFromFiltering.exists() );
assertEquals( userDir.getAbsolutePath(), fileFromFiltering.getAbsolutePath() );
}
@@ -382,8 +382,8 @@ public class ResourcesMojoTest
{
File testPom = new File( getBasedir(), defaultPomFilePath );
ResourcesMojo mojo = (ResourcesMojo) lookupMojo( "resources", testPom );
- MavenProjectResourcesStub project =
- new MavenProjectResourcesStub( "resourcePojectProperty_Filtering_PropertyDestination" );
+ MavenProjectResourcesStub project = new MavenProjectResourcesStub(
+ "resourcePojectProperty_Filtering_PropertyDestination" );
List resources = project.getBuild().getResources();
assertNotNull( mojo );
@@ -497,10 +497,10 @@ public class ResourcesMojoTest
project.addFile( "filter.properties", "dir:testdir" );
project.addFile( "extra-filter.properties", "dir2:testdir2" );
project.setResourceFiltering( 0, true );
-
+
project.cleanBuildEnvironment();
project.setupBuildEnvironment();
-
+
filterList.add( project.getResourcesDirectory() + "filter.properties" );
extraFilterList.add( project.getResourcesDirectory() + "extra-filter.properties" );
@@ -523,7 +523,7 @@ public class ResourcesMojoTest
/**
* Validates that a Filter token containing a project property will be resolved before the Filter is applied to the
* resources.
- *
+ *
* @throws Exception
*/
public void testPropertyFiles_Filtering_TokensInFilters()
@@ -531,8 +531,8 @@ public class ResourcesMojoTest
{
final File testPom = new File( getBasedir(), defaultPomFilePath );
final ResourcesMojo mojo = (ResourcesMojo) lookupMojo( "resources", testPom );
- final MavenProjectResourcesStub project =
- new MavenProjectResourcesStub( "resourcePropertyFiles_Filtering_TokensInFilters" );
+ final MavenProjectResourcesStub project = new MavenProjectResourcesStub(
+ "resourcePropertyFiles_Filtering_TokensInFilters" );
final List resources = project.getBuild().getResources();
final LinkedList filterList = new LinkedList();
@@ -628,9 +628,8 @@ public class ResourcesMojoTest
assertTrue( FileUtils.fileExists( new File( resourcesDir, "path-listing.txt" ).getAbsolutePath() ) );
- assertEquals(
- "base path is C:\\\\Users\\\\Administrator\ndocuments path is C:\\\\Users\\\\Administrator\\\\Documents",
- FileUtils.fileRead( new File( resourcesDir, "path-listing.txt" ) ) );
+ assertEquals( "base path is C:\\\\Users\\\\Administrator\ndocuments path is C:\\\\Users\\\\Administrator\\\\Documents",
+ FileUtils.fileRead( new File( resourcesDir, "path-listing.txt" ) ) );
}
/**
Modified: maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-relocated-result/child/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-relocated-result/child/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-relocated-result/child/pom.xml (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-relocated-result/child/pom.xml Tue Aug 27 18:25:03 2013
@@ -19,8 +19,7 @@ specific language governing permissions
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -29,7 +28,7 @@ under the License.
<version>1.0</version>
</parent>
- <artifactId>child</artifactId>
+ <artifactId>child</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
Modified: maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-with-local-parent/child/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-with-local-parent/child/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-with-local-parent/child/pom.xml (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/dep-reduced-pom-with-local-parent/child/pom.xml Tue Aug 27 18:25:03 2013
@@ -19,8 +19,7 @@ specific language governing permissions
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -29,7 +28,7 @@ under the License.
<version>1.0</version>
</parent>
- <artifactId>child</artifactId>
+ <artifactId>child</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
Modified: maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/filter/MinijarFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/filter/MinijarFilter.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/filter/MinijarFilter.java (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/filter/MinijarFilter.java Tue Aug 27 18:25:03 2013
@@ -62,6 +62,7 @@ public class MinijarFilter
}
/**
+ *
* @since 1.6
*/
@SuppressWarnings( { "unchecked" } )
@@ -103,9 +104,9 @@ public class MinijarFilter
catch ( ZipException e )
{
log.warn( dependency.getFile()
- + " could not be unpacked/read for minimization; dependency is probably malformed." );
- IOException ioe = new IOException(
- "Dependency " + dependency.toString() + " in file " + dependency.getFile()
+ + " could not be unpacked/read for minimization; dependency is probably malformed." );
+ IOException ioe =
+ new IOException( "Dependency " + dependency.toString() + " in file " + dependency.getFile()
+ " could not be unpacked. File is probably corrupt" );
ioe.initCause( e );
throw ioe;
@@ -113,17 +114,17 @@ public class MinijarFilter
catch ( ArrayIndexOutOfBoundsException e )
{
//trap ArrayIndexOutOfBoundsExceptions caused by malformed dependency classes (MSHADE-107)
- log.warn(
- dependency.toString() + " could not be analyzed for minimization; dependency is probably malformed." );
+ log.warn( dependency.toString()
+ + " could not be analyzed for minimization; dependency is probably malformed." );
}
finally
{
IOUtil.close( is );
}
-
+
return clazzpathUnit;
}
-
+
private void removePackages( ClazzpathUnit artifactUnit )
{
Set<String> packageNames = new HashSet<String>();
@@ -134,16 +135,13 @@ public class MinijarFilter
@SuppressWarnings( "rawtypes" )
private void removePackages( Set clazzes, Set<String> packageNames )
{
- for ( Object clazze : clazzes )
- {
+ for (Object clazze : clazzes) {
Clazz clazz = (Clazz) clazze;
String name = clazz.getName();
- while ( name.contains( "." ) )
- {
- name = name.substring( 0, name.lastIndexOf( '.' ) );
- if ( packageNames.add( name ) )
- {
- removable.remove( new Clazz( name + ".package-info" ) );
+ while (name.contains(".")) {
+ name = name.substring(0, name.lastIndexOf('.'));
+ if (packageNames.add(name)) {
+ removable.remove(new Clazz(name + ".package-info"));
}
}
}
@@ -170,8 +168,8 @@ public class MinijarFilter
{
Clazz clazz = j.next();
- if ( depClazzpathUnit.getClazzes().contains( clazz ) && simpleFilter.isSpecificallyIncluded(
- clazz.getName().replace( '.', '/' ) ) )
+ if ( depClazzpathUnit.getClazzes().contains( clazz )
+ && simpleFilter.isSpecificallyIncluded( clazz.getName().replace( '.', '/' ) ) )
{
log.info( clazz.getName() + " not removed because it was specifically included" );
j.remove();
@@ -207,6 +205,8 @@ public class MinijarFilter
public void finished()
{
int classesTotal = classesRemoved + classesKept;
- log.info( "Minimized " + classesTotal + " -> " + classesKept + " (" + 100 * classesKept / classesTotal + "%)" );
+ log.info(
+ "Minimized " + classesTotal + " -> " + classesKept + " (" + 100 * classesKept / classesTotal
+ + "%)" );
}
}