You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2008/11/01 18:20:26 UTC

svn commit: r709727 - in /maven/plugins/trunk/maven-source-plugin: ./ src/test/java/org/apache/maven/plugin/source/ src/test/java/org/apache/maven/plugin/source/stubs/

Author: hboutemy
Date: Sat Nov  1 10:20:26 2008
New Revision: 709727

URL: http://svn.apache.org/viewvc?rev=709727&view=rev
Log:
o removed unused imports
o use ReaderFactory.newXmlReader to read XML content

Modified:
    maven/plugins/trunk/maven-source-plugin/pom.xml
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java
    maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java

Modified: maven/plugins/trunk/maven-source-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/pom.xml?rev=709727&r1=709726&r2=709727&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-source-plugin/pom.xml Sat Nov  1 10:20:26 2008
@@ -36,7 +36,7 @@
   <description>The Maven 2 Source Plugin creates a JAR archive of the source files of the current project.</description>
 
   <prerequisites>
-    <maven>2.0</maven>
+    <maven>2.0.6</maven>
   </prerequisites>
 
   <scm>
@@ -78,7 +78,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>1.1</version>
+      <version>1.5.6</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java?rev=709727&r1=709726&r2=709727&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/AbstractSourcePluginTestCase.java Sat Nov  1 10:20:26 2008
@@ -1,29 +1,5 @@
 package org.apache.maven.plugin.source;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.zip.ZipEntry;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Resource;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
-import org.codehaus.plexus.archiver.zip.ZipFile;
-
 /*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
@@ -43,6 +19,17 @@
 * under the License.
 */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.zip.ZipEntry;
+
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.codehaus.plexus.archiver.zip.ZipFile;
+
 /**
  * @author Stephane Nicoll
  */
@@ -50,18 +37,18 @@
     extends AbstractMojoTestCase
 {
 
-    protected final String FINAL_NAME_PREFIX = "maven-source-plugin-test-";
+    protected static final String FINAL_NAME_PREFIX = "maven-source-plugin-test-";
 
-    protected final String FINAL_NAME_SUFFIX = "-99.0";
+    protected static final String FINAL_NAME_SUFFIX = "-99.0";
 
     protected abstract String getGoal();
 
     /**
-     * Execute the souce plugin for the specified project.
+     * Execute the source plugin for the specified project.
      *
      * @param projectName the name of the project
      * @return the base directory of the project
-     * @throws Exception if an error occured
+     * @throws Exception if an error occurred
      */
     protected void executeMojo( final String projectName )
         throws Exception

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java?rev=709727&r1=709726&r2=709727&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/SourceJarMojoTest.java Sat Nov  1 10:20:26 2008
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.util.Properties;
 
 /**
  * @author <a href="mailto:oching@exist.com">Maria Odea Ching</a>

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java?rev=709727&r1=709726&r2=709727&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project001Stub.java Sat Nov  1 10:20:26 2008
@@ -20,17 +20,14 @@
  */
 
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
-import org.apache.maven.plugin.testing.stubs.ArtifactStub;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
-import org.apache.maven.model.Resource;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.util.ReaderFactory;
 
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Iterator;
-import java.io.FileReader;
 import java.io.File;
 
 /**
@@ -53,7 +50,7 @@
         try
         {
             model = pomReader.read(
-                new FileReader( new File( getBasedir() + "/target/test-classes/unit/project-001/pom.xml" ) ) );
+                ReaderFactory.newXmlReader( new File( getBasedir(), "target/test-classes/unit/project-001/pom.xml" ) ) );
             setModel( model );
 
             setGroupId( model.getGroupId() );

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java?rev=709727&r1=709726&r2=709727&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project003Stub.java Sat Nov  1 10:20:26 2008
@@ -22,14 +22,12 @@
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
-import org.apache.maven.model.Resource;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.util.ReaderFactory;
 
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Iterator;
-import java.io.FileReader;
 import java.io.File;
 
 /**
@@ -52,7 +50,7 @@
         try
         {
             model = pomReader.read(
-                new FileReader( new File( getBasedir() + "/target/test-classes/unit/project-003/pom.xml" ) ) );
+                ReaderFactory.newXmlReader( new File( getBasedir(), "target/test-classes/unit/project-003/pom.xml" ) ) );
             setModel( model );
 
             setGroupId( model.getGroupId() );

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java?rev=709727&r1=709726&r2=709727&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project005Stub.java Sat Nov  1 10:20:26 2008
@@ -24,10 +24,9 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.util.ReaderFactory;
 
 import java.util.List;
-import java.util.ArrayList;
-import java.io.FileReader;
 import java.io.File;
 
 /**
@@ -50,7 +49,7 @@
         try
         {
             model = pomReader.read(
-                new FileReader( new File( getBasedir() + "/target/test-classes/unit/project-005/pom.xml" ) ) );
+                ReaderFactory.newXmlReader( new File( getBasedir(), "target/test-classes/unit/project-005/pom.xml" ) ) );
             setModel( model );
 
             setGroupId( model.getGroupId() );

Modified: maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java?rev=709727&r1=709726&r2=709727&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/test/java/org/apache/maven/plugin/source/stubs/Project007Stub.java Sat Nov  1 10:20:26 2008
@@ -24,10 +24,10 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.util.ReaderFactory;
 
 import java.util.List;
 import java.util.ArrayList;
-import java.io.FileReader;
 import java.io.File;
 
 /**
@@ -50,7 +50,7 @@
         try
         {
             model = pomReader.read(
-                new FileReader( new File( getBasedir() + "/target/test-classes/unit/project-007/pom.xml" ) ) );
+                ReaderFactory.newXmlReader( new File( getBasedir(), "target/test-classes/unit/project-007/pom.xml" ) ) );
             setModel( model );
 
             setGroupId( model.getGroupId() );