svn commit: r169041 [2/2] - in /maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven: model/v3_0_0/ model/v3_0_0/io/xpp3/ tools/repoclean/ tools/repoclean/artifact/handler/ tools/repoclean/artifact/layout/ tools/repoclean/artifact/metad

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r169041 [2/2] - in /maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven: model/v3_0_0/ model/v3_0_0/io/xpp3/ tools/repoclean/ tools/repoclean/artifact/handler/ tools/repoclean/artifact/layout/ tools/repoclean/artifact/metad

John Casey-2
Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/ArtifactDiscoverer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/ArtifactDiscoverer.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/ArtifactDiscoverer.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/ArtifactDiscoverer.java Fri May  6 22:45:20 2005
@@ -27,15 +27,30 @@
 {
     public static final String ROLE = ArtifactDiscoverer.class.getName();
 
-    public static final String[] STANDARD_DISCOVERY_EXCLUDES = {"bin/**", "reports/**", ".maven/**", "**/poms/*.pom",
-                                                                "**/*.md5", "**/*.MD5", "**/*.sha1", "**/*.SHA1",
-                                                                "**/*snapshot-version", "*/website/**",
-                                                                "*/licenses/**", "*/licences/**", "**/.htaccess",
-                                                                "**/*.html", "**/*.asc", "**/*.txt", "**/*.xml",
-                                                                "**/README*", "**/CHANGELOG*", "**/KEYS*"};
+    public static final String[] STANDARD_DISCOVERY_EXCLUDES = {
+        "bin/**",
+        "reports/**",
+        ".maven/**",
+        "**/poms/*.pom",
+        "**/*.md5",
+        "**/*.MD5",
+        "**/*.sha1",
+        "**/*.SHA1",
+        "**/*snapshot-version",
+        "*/website/**",
+        "*/licenses/**",
+        "*/licences/**",
+        "**/.htaccess",
+        "**/*.html",
+        "**/*.asc",
+        "**/*.txt",
+        "**/*.xml",
+        "**/README*",
+        "**/CHANGELOG*",
+        "**/KEYS*" };
 
     List discoverArtifacts( File repositoryBase, Reporter reporter, String blacklistedPatterns,
-                            PathLister excludeLister, PathLister kickoutLister )
+                           PathLister excludeLister, PathLister kickoutLister )
         throws Exception;
 
 }

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/DefaultArtifactDiscoverer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/DefaultArtifactDiscoverer.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/DefaultArtifactDiscoverer.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/DefaultArtifactDiscoverer.java Fri May  6 22:45:20 2005
@@ -29,13 +29,14 @@
 /**
  * @author jdcasey
  */
-public class DefaultArtifactDiscoverer extends AbstractArtifactDiscoverer
+public class DefaultArtifactDiscoverer
+    extends AbstractArtifactDiscoverer
 {
 
     private ArtifactFactory artifactFactory;
 
     public List discoverArtifacts( File repositoryBase, Reporter reporter, String blacklistedPatterns,
-                                   PathLister excludeLister, PathLister kickoutLister )
+                                  PathLister excludeLister, PathLister kickoutLister )
         throws Exception
     {
         List artifacts = new ArrayList();

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java Fri May  6 22:45:20 2005
@@ -30,13 +30,14 @@
 /**
  * @author jdcasey
  */
-public class LegacyArtifactDiscoverer extends AbstractArtifactDiscoverer
+public class LegacyArtifactDiscoverer
+    extends AbstractArtifactDiscoverer
 {
 
     private ArtifactFactory artifactFactory;
 
     public List discoverArtifacts( File repositoryBase, Reporter reporter, String blacklistedPatterns,
-                                   PathLister excludeLister, PathLister kickoutLister )
+                                  PathLister excludeLister, PathLister kickoutLister )
         throws Exception
     {
         List artifacts = new ArrayList();
@@ -133,13 +134,13 @@
                 }
             }
 
-            String validVersionParts = "([Dd][Ee][Vv][_.0-9]*)|" + "([Ss][Nn][Aa][Pp][Ss][Hh][Oo][Tt])|" +
-                "([0-9][_.0-9a-zA-Z]*)|" + "([Gg]?[_.0-9ab]*([Pp][Rr][Ee]|[Rr][Cc]|[Gg]|[Mm])[_.0-9]*)|" +
-                "([Aa][Ll][Pp][Hh][Aa][_.0-9]*)|" + "([Bb][Ee][Tt][Aa][_.0-9]*)|" + "([Rr][Cc][_.0-9]*)|" +
-                "([Tt][Ee][Ss][Tt][_.0-9]*)|" + "([Dd][Ee][Bb][Uu][Gg][_.0-9]*)|" +
-                "([Uu][Nn][Oo][Ff][Ff][Ii][Cc][Ii][Aa][Ll][_.0-9]*)|" + "([Cc][Uu][Rr][Rr][Ee][Nn][Tt])|" +
-                "([Ll][Aa][Tt][Ee][Ss][Tt])|" + "([Ff][Cc][Ss])|" + "([Rr][Ee][Ll][Ee][Aa][Ss][Ee][_.0-9]*)|" +
-                "([Nn][Ii][Gg][Hh][Tt][Ll][Yy])";
+            String validVersionParts = "([Dd][Ee][Vv][_.0-9]*)|" + "([Ss][Nn][Aa][Pp][Ss][Hh][Oo][Tt])|"
+                + "([0-9][_.0-9a-zA-Z]*)|" + "([Gg]?[_.0-9ab]*([Pp][Rr][Ee]|[Rr][Cc]|[Gg]|[Mm])[_.0-9]*)|"
+                + "([Aa][Ll][Pp][Hh][Aa][_.0-9]*)|" + "([Bb][Ee][Tt][Aa][_.0-9]*)|" + "([Rr][Cc][_.0-9]*)|"
+                + "([Tt][Ee][Ss][Tt][_.0-9]*)|" + "([Dd][Ee][Bb][Uu][Gg][_.0-9]*)|"
+                + "([Uu][Nn][Oo][Ff][Ff][Ii][Cc][Ii][Aa][Ll][_.0-9]*)|" + "([Cc][Uu][Rr][Rr][Ee][Nn][Tt])|"
+                + "([Ll][Aa][Tt][Ee][Ss][Tt])|" + "([Ff][Cc][Ss])|" + "([Rr][Ee][Ll][Ee][Aa][Ss][Ee][_.0-9]*)|"
+                + "([Nn][Ii][Gg][Hh][Tt][Ll][Yy])";
 
             // let's discover the version, and whatever's leftover will be either
             // a classifier, or part of the artifactId, depending on position.
@@ -196,15 +197,17 @@
                 tokensIterated++;
             }
 
-            getLogger().debug( "After parsing loop, state of buffers:\no  Version Buffer: \'" + versionBuffer +
-                               "\'\no  Classifier Buffer: \'" + classifierBuffer +
-                               "\'\no Number of Tokens Iterated: " + tokensIterated );
+            getLogger().debug(
+                               "After parsing loop, state of buffers:\no  Version Buffer: \'" + versionBuffer
+                                   + "\'\no  Classifier Buffer: \'" + classifierBuffer
+                                   + "\'\no Number of Tokens Iterated: " + tokensIterated );
 
             // Now, restore the proper ordering so we can build the artifactId.
             Collections.reverse( avceTokenList );
 
-            getLogger().debug( "Before repairing bad version and/or cleaning up used tokens, avce token list is:\n" +
-                               avceTokenList );
+            getLogger().debug(
+                               "Before repairing bad version and/or cleaning up used tokens, avce token list is:\n"
+                                   + avceTokenList );
 
             // if we didn't find a version, then punt. Use the last token
             // as the version, and set the classifier empty.
@@ -220,8 +223,9 @@
                 else
                 {
                     getLogger().debug( "Cannot parse version from artifact path: \'" + path + "\'." );
-                    getLogger().debug( "artifact-version-classifier-extension remaining tokens is: \'" + avceTokenList +
-                                      "\'" );
+                    getLogger().debug(
+                                       "artifact-version-classifier-extension remaining tokens is: \'" + avceTokenList
+                                           + "\'" );
                 }
 
                 classifierBuffer.setLength( 0 );
@@ -232,8 +236,7 @@
 
                 // if everything is kosher, then pop off all the classifier and
                 // version tokens, leaving the naked artifact id in the list.
-                avceTokenList =
-                    new LinkedList( avceTokenList.subList( 0, avceTokenList.size() - ( tokensIterated ) ) );
+                avceTokenList = new LinkedList( avceTokenList.subList( 0, avceTokenList.size() - ( tokensIterated ) ) );
             }
 
             getLogger().debug( "Now, remainder of avce token list is:\n" + avceTokenList );
@@ -272,10 +275,11 @@
                 version = null;
             }
 
-            getLogger().debug( "Extracted artifact information from path:\n" + "groupId: \'" + groupId + "\'\n" +
-                               "artifactId: \'" + artifactId + "\'\n" + "type: \'" + type + "\'\n" +
-                               "version: \'" + version + "\'\n" + "classifier: \'" + classifierBuffer.toString() +
-                               "\'" );
+            getLogger().debug(
+                               "Extracted artifact information from path:\n" + "groupId: \'" + groupId + "\'\n"
+                                   + "artifactId: \'" + artifactId + "\'\n" + "type: \'" + type + "\'\n"
+                                   + "version: \'" + version + "\'\n" + "classifier: \'" + classifierBuffer.toString()
+                                   + "\'" );
 
             Artifact result = null;
 
@@ -284,16 +288,17 @@
                 getLogger().debug( "Creating artifact with classifier." );
 
                 result = artifactFactory.createArtifactWithClassifier( groupId, artifactId, version,
-                                                                       Artifact.SCOPE_RUNTIME, type,
-                                                                       classifierBuffer.toString() );
+                                                                       Artifact.SCOPE_RUNTIME, type, classifierBuffer
+                                                                           .toString() );
             }
             else
             {
                 result = artifactFactory.createArtifact( groupId, artifactId, version, Artifact.SCOPE_RUNTIME, type );
             }
 
-            getLogger().debug( "Resulting artifact is: " + result.getId() + " and has classifier of: " +
-                               result.getClassifier() + "\n\n" );
+            getLogger().debug(
+                               "Resulting artifact is: " + result.getId() + " and has classifier of: "
+                                   + result.getClassifier() + "\n\n" );
 
             return result;
         }

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/index/ArtifactIndexer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/index/ArtifactIndexer.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/index/ArtifactIndexer.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/index/ArtifactIndexer.java Fri May  6 22:45:20 2005
@@ -32,7 +32,8 @@
 /**
  * @author jdcasey
  */
-public class ArtifactIndexer extends AbstractLogEnabled
+public class ArtifactIndexer
+    extends AbstractLogEnabled
 {
 
     public static final String ROLE = ArtifactIndexer.class.getName();
@@ -64,7 +65,8 @@
         }
     }
 
-    private static final class ArtifactIdComparator implements Comparator
+    private static final class ArtifactIdComparator
+        implements Comparator
     {
 
         public int compare( Object first, Object second )

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/FileReporter.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/FileReporter.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/FileReporter.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/FileReporter.java Fri May  6 22:45:20 2005
@@ -32,7 +32,8 @@
 /**
  * @author jdcasey
  */
-public class FileReporter implements Reporter
+public class FileReporter
+    implements Reporter
 {
 
     private static final String WARN_LEVEL = "[WARNING] ";
@@ -61,9 +62,9 @@
 
         if ( !parentDir.isDirectory() )
         {
-            throw new IllegalArgumentException( "path: \'" + parentDir.getAbsolutePath() +
-                                                "\' refers to a file, not a directory.\n" + "Cannot write report file: \'" +
-                                                reportsFile.getAbsolutePath() + "\'." );
+            throw new IllegalArgumentException( "path: \'" + parentDir.getAbsolutePath()
+                + "\' refers to a file, not a directory.\n" + "Cannot write report file: \'"
+                + reportsFile.getAbsolutePath() + "\'." );
         }
     }
 
@@ -170,7 +171,8 @@
         return sWriter.toString();
     }
 
-    private static class AppendingList extends ArrayList
+    private static class AppendingList
+        extends ArrayList
     {
         public AppendingList()
         {

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/ReportWriteException.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/ReportWriteException.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/ReportWriteException.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/report/ReportWriteException.java Fri May  6 22:45:20 2005
@@ -16,7 +16,8 @@
  * limitations under the License.
  */
 
-public class ReportWriteException extends Exception
+public class ReportWriteException
+    extends Exception
 {
 
     public ReportWriteException( String message, Throwable cause )

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/ArtifactPomRewriter.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/ArtifactPomRewriter.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/ArtifactPomRewriter.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/ArtifactPomRewriter.java Fri May  6 22:45:20 2005
@@ -1,9 +1,10 @@
 package org.apache.maven.tools.repoclean.rewrite;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.tools.repoclean.report.FileReporter;
+import org.apache.maven.tools.repoclean.report.Reporter;
 
-import java.io.File;
+import java.io.Reader;
+import java.io.Writer;
 
 /* ====================================================================
  *   Copyright 2001-2004 The Apache Software Foundation.
@@ -30,7 +31,11 @@
 
     public static final String ROLE = ArtifactPomRewriter.class.getName();
 
-    void rewrite( Artifact artifact, File from, File to, FileReporter reporter, boolean reportOnly )
+    public static final String V3_POM = "v3";
+
+    public static final String V4_POM = "v4";
+
+    void rewrite( Artifact artifact, Reader from, Writer to, Reporter reporter, boolean reportOnly )
         throws Exception;
 
 }

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java Fri May  6 22:45:20 2005
@@ -4,14 +4,12 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
 import org.apache.maven.model.v3_0_0.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.tools.repoclean.report.FileReporter;
+import org.apache.maven.tools.repoclean.report.Reporter;
 import org.apache.maven.tools.repoclean.translate.PomV3ToV4Translator;
-import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
+import java.io.Reader;
+import java.io.Writer;
 
 /* ====================================================================
  *   Copyright 2001-2004 The Apache Software Foundation.
@@ -33,51 +31,39 @@
 /**
  * @author jdcasey
  */
-public class V3PomRewriter implements ArtifactPomRewriter
+public class V3PomRewriter
+    implements ArtifactPomRewriter
 {
     private PomV3ToV4Translator translator;
 
-    public void rewrite( Artifact artifact, File from, File to, FileReporter reporter, boolean reportOnly )
+    public void rewrite( Artifact artifact, Reader from, Writer to, Reporter reporter, boolean reportOnly )
         throws Exception
     {
         Model v4Model = null;
 
-        if ( from.exists() )
+        if( from != null )
         {
-            FileReader fromReader = null;
+            org.apache.maven.model.v3_0_0.Model v3Model = null;
             try
             {
-                org.apache.maven.model.v3_0_0.Model v3Model = null;
-                try
-                {
-                    fromReader = new FileReader( from );
-
-                    MavenXpp3Reader v3Reader = new MavenXpp3Reader();
-
-                    v3Model = v3Reader.read( fromReader );
-                }
-                catch ( Exception e )
-                {
-                    reporter.error( "Invalid v3 POM at: \'" + from + "\'. Cannot read.", e );
-
-                    throw e;
-                }
-
-                if ( v3Model != null )
-                {
-                    v4Model = translator.translate( v3Model, reporter );
-                }
+                MavenXpp3Reader v3Reader = new MavenXpp3Reader();
+
+                v3Model = v3Reader.read( from );
             }
-            finally
+            catch ( Exception e )
             {
-                IOUtil.close( fromReader );
+                reporter.error( "Invalid v3 POM at: \'" + from + "\'. Cannot read.", e );
+
+                throw e;
+            }
+            
+            if ( v3Model != null )
+            {
+                v4Model = translator.translate( v3Model, reporter );
             }
         }
         else
         {
-            reporter.warn( "POM for artifact[" + artifact.getId() +
-                           "] does not exist in source repository. We will create a skeletal one here." );
-
             v4Model = new Model();
         }
 
@@ -87,28 +73,13 @@
 
             if ( !reportOnly )
             {
-                File toParent = to.getParentFile();
-                if ( !toParent.exists() )
-                {
-                    toParent.mkdirs();
-                }
-
-                FileWriter toWriter = null;
-                try
-                {
-                    toWriter = new FileWriter( to );
-                    MavenXpp3Writer v4Writer = new MavenXpp3Writer();
-                    v4Writer.write( toWriter, v4Model );
-                }
-                finally
-                {
-                    IOUtil.close( toWriter );
-                }
+                MavenXpp3Writer v4Writer = new MavenXpp3Writer();
+                v4Writer.write( to, v4Model );
             }
         }
     }
 
-    private void validateV4Basics( Model model, Artifact artifact, FileReporter reporter )
+    private void validateV4Basics( Model model, Artifact artifact, Reporter reporter )
         throws Exception
     {
         if ( StringUtils.isEmpty( model.getModelVersion() ) )

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V4PomRewriter.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V4PomRewriter.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V4PomRewriter.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V4PomRewriter.java Fri May  6 22:45:20 2005
@@ -21,50 +21,39 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.apache.maven.tools.repoclean.report.FileReporter;
-import org.codehaus.plexus.util.IOUtil;
+import org.apache.maven.tools.repoclean.report.Reporter;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
+import java.io.Reader;
+import java.io.Writer;
 
 /**
  * @author jdcasey
  */
-public class V4PomRewriter implements ArtifactPomRewriter
+public class V4PomRewriter
+    implements ArtifactPomRewriter
 {
-    public void rewrite( Artifact artifact, File from, File to, FileReporter reporter, boolean reportOnly )
+    public void rewrite( Artifact artifact, Reader from, Writer to, Reporter reporter, boolean reportOnly )
         throws Exception
     {
         Model model = null;
 
-        if ( from.exists() )
+        if( from != null )
         {
-            FileReader fromReader = null;
+            MavenXpp3Reader reader = new MavenXpp3Reader();
+
             try
             {
-                fromReader = new FileReader( from );
-
-                MavenXpp3Reader reader = new MavenXpp3Reader();
-
-                try
-                {
-                    model = reader.read( fromReader );
-                }
-                catch ( Exception e )
-                {
-                    reporter.error( "Invalid v4 POM at \'" + from + "\'. Cannot read.", e );
-                }
+                model = reader.read( from );
             }
-            finally
+            catch ( Exception e )
             {
-                IOUtil.close( fromReader );
+                reporter.error( "Invalid v4 POM at \'" + from + "\'. Cannot read.", e );
             }
         }
         else
         {
-            reporter.error( "POM for artifact[" + artifact.getId() + "] does not exist in source repository!" );
+            model = new Model();
         }
 
         if ( model != null )
@@ -73,28 +62,13 @@
 
             if ( !reportOnly )
             {
-                File toParent = to.getParentFile();
-                if ( !toParent.exists() )
-                {
-                    toParent.mkdirs();
-                }
-
-                FileWriter toWriter = null;
-                try
-                {
-                    toWriter = new FileWriter( to );
-                    MavenXpp3Writer writer = new MavenXpp3Writer();
-                    writer.write( toWriter, model );
-                }
-                finally
-                {
-                    IOUtil.close( toWriter );
-                }
+                MavenXpp3Writer writer = new MavenXpp3Writer();
+                writer.write( to, model );
             }
         }
     }
 
-    private void validateBasics( Model model, Artifact artifact, FileReporter reporter )
+    private void validateBasics( Model model, Artifact artifact, Reporter reporter )
         throws Exception
     {
         if ( StringUtils.isEmpty( model.getModelVersion() ) )

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java Fri May  6 22:45:20 2005
@@ -48,8 +48,8 @@
             File file = (File) it.next();
             if ( file.exists() && !file.delete() )
             {
-                throw new RollbackException( "[rollback] Cannot delete file: " + file +
-                                             "\nPart of transaction for artifact: {" + artifact.getId() + "}." );
+                throw new RollbackException( "[rollback] Cannot delete file: " + file
+                    + "\nPart of transaction for artifact: {" + artifact.getId() + "}." );
             }
         }
     }

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java Fri May  6 22:45:20 2005
@@ -16,7 +16,8 @@
  * limitations under the License.
  */
 
-public class RollbackException extends Exception
+public class RollbackException
+    extends Exception
 {
 
     public RollbackException( String message, Throwable cause )

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java Fri May  6 22:45:20 2005
@@ -20,7 +20,8 @@
 /**
  * @author jdcasey
  */
-public class PomTranslationException extends Exception
+public class PomTranslationException
+    extends Exception
 {
 
     private final String groupId;

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java?rev=169041&r1=169040&r2=169041&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java Fri May  6 22:45:20 2005
@@ -50,7 +50,8 @@
 /**
  * @author jdcasey
  */
-public class PomV3ToV4Translator extends AbstractLogEnabled
+public class PomV3ToV4Translator
+    extends AbstractLogEnabled
 {
 
     public static final String ROLE = PomV3ToV4Translator.class.getName();
@@ -66,15 +67,15 @@
             String artifactId = format( v3Model.getArtifactId() );
 
             String id = v3Model.getId();
-            
+
             if ( StringUtils.isNotEmpty( id ) )
             {
                 if ( StringUtils.isEmpty( groupId ) )
                 {
-                    int plusIdx = id.indexOf("+");
-                    if(plusIdx > -1)
+                    int plusIdx = id.indexOf( "+" );
+                    if ( plusIdx > -1 )
                     {
-                        groupId = id.substring(0, plusIdx);
+                        groupId = id.substring( 0, plusIdx );
                     }
                     else
                     {
@@ -89,7 +90,7 @@
             }
 
             String version = format( v3Model.getCurrentVersion() );
-            
+
             if ( version == null )
             {
                 version = format( v3Model.getVersion() );
@@ -186,8 +187,8 @@
 
         if ( StringUtils.isNotEmpty( v3Model.getGumpRepositoryId() ) )
         {
-            reporter.warn( "Ignoring gump repository id: \'" + v3Model.getGumpRepositoryId() +
-                           "\'. This is not supported in v4 POMs." );
+            reporter.warn( "Ignoring gump repository id: \'" + v3Model.getGumpRepositoryId()
+                + "\'. This is not supported in v4 POMs." );
         }
 
         if ( notEmpty( v3Model.getVersions() ) )
@@ -261,8 +262,8 @@
                 String reportPluginName = null;
                 if ( !matcher.matches() )
                 {
-                    reporter.warn( "Non-standard report name: \'" + reportName +
-                                   "\'. Using entire name for plugin artifactId." );
+                    reporter.warn( "Non-standard report name: \'" + reportName
+                        + "\'. Using entire name for plugin artifactId." );
 
                     reportPluginName = reportName;
                 }
@@ -281,11 +282,11 @@
 
                 StringBuffer info = new StringBuffer();
 
-                info.append( "Using some contrived information for report: \'" ).append( reportName ).append( "\'.\n" ).append(
-                    "\to groupId: \'maven\'\n" ).append( "\to artifactId: \'" ).append( reportPluginName ).append(
-                        "\'\n" ).append( "\to version: \'1.0-SNAPSHOT\'\n" ).append( "\to goal: \'report\'\n" ).append(
-                            "\n" ).append(
-                                "These values were extracted using the v3 report naming convention, but may be wrong." );
+                info.append( "Using some contrived information for report: \'" ).append( reportName ).append( "\'.\n" )
+                    .append( "\to groupId: \'maven\'\n" ).append( "\to artifactId: \'" ).append( reportPluginName )
+                    .append( "\'\n" ).append( "\to version: \'1.0-SNAPSHOT\'\n" ).append( "\to goal: \'report\'\n" )
+                    .append( "\n" )
+                    .append( "These values were extracted using the v3 report naming convention, but may be wrong." );
 
                 reporter.warn( info.toString() );
 
@@ -303,7 +304,8 @@
     }
 
     private org.apache.maven.model.Organization translateOrganization(
-        org.apache.maven.model.v3_0_0.Organization v3Organization, Reporter reporter )
+                                                                      org.apache.maven.model.v3_0_0.Organization v3Organization,
+                                                                      Reporter reporter )
         throws ReportWriteException
     {
         Organization organization = null;
@@ -332,7 +334,8 @@
         {
             for ( Iterator it = v3MailingLists.iterator(); it.hasNext(); )
             {
-                org.apache.maven.model.v3_0_0.MailingList v3List = (org.apache.maven.model.v3_0_0.MailingList) it.next();
+                org.apache.maven.model.v3_0_0.MailingList v3List = (org.apache.maven.model.v3_0_0.MailingList) it
+                    .next();
                 MailingList list = new MailingList();
                 list.setArchive( v3List.getArchive() );
                 list.setName( v3List.getName() );
@@ -382,7 +385,7 @@
     }
 
     private DistributionManagement translateDistributionManagement( PomKey pomKey,
-                                                                    org.apache.maven.model.v3_0_0.Model v3Model )
+                                                                   org.apache.maven.model.v3_0_0.Model v3Model )
         throws PomTranslationException
     {
         DistributionManagement distributionManagement = new DistributionManagement();
@@ -481,7 +484,8 @@
         {
             for ( Iterator it = v3Developers.iterator(); it.hasNext(); )
             {
-                org.apache.maven.model.v3_0_0.Developer v3Developer = (org.apache.maven.model.v3_0_0.Developer) it.next();
+                org.apache.maven.model.v3_0_0.Developer v3Developer = (org.apache.maven.model.v3_0_0.Developer) it
+                    .next();
 
                 Developer developer = new Developer();
 
@@ -519,11 +523,11 @@
                 {
                     if ( StringUtils.isEmpty( groupId ) )
                     {
-                        int plusIdx = id.indexOf("+");
-                        
-                        if(plusIdx > -1)
+                        int plusIdx = id.indexOf( "+" );
+
+                        if ( plusIdx > -1 )
                         {
-                            groupId = id.substring(0, plusIdx);
+                            groupId = id.substring( 0, plusIdx );
                         }
                         else
                         {
@@ -603,7 +607,8 @@
         {
             for ( Iterator it = v3Contributors.iterator(); it.hasNext(); )
             {
-                org.apache.maven.model.v3_0_0.Contributor v3Contributor = (org.apache.maven.model.v3_0_0.Contributor) it.next();
+                org.apache.maven.model.v3_0_0.Contributor v3Contributor = (org.apache.maven.model.v3_0_0.Contributor) it
+                    .next();
 
                 Contributor contributor = new Contributor();
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]