Author: evenisse
Date: Thu Jul 21 03:10:32 2005
New Revision: 220028

URL: http://svn.apache.org/viewcvs?rev=220028&view=rev
Log:
Add a little tool for check all poms in repo.

Added:
    maven/components/trunk/sandbox/maven-repository-checker/   (with props)
    maven/components/trunk/sandbox/maven-repository-checker/pom.xml   (with 
props)
    maven/components/trunk/sandbox/maven-repository-checker/src/
    maven/components/trunk/sandbox/maven-repository-checker/src/main/
    maven/components/trunk/sandbox/maven-repository-checker/src/main/java/
    maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/
    
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/
    
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/
    
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/
    
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/
    
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/CheckRepo.java
   (with props)

Propchange: maven/components/trunk/sandbox/maven-repository-checker/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jul 21 03:10:32 2005
@@ -0,0 +1 @@
+target

Added: maven/components/trunk/sandbox/maven-repository-checker/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/maven-repository-checker/pom.xml?rev=220028&view=auto
==============================================================================
--- maven/components/trunk/sandbox/maven-repository-checker/pom.xml (added)
+++ maven/components/trunk/sandbox/maven-repository-checker/pom.xml Thu Jul 21 
03:10:32 2005
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven</artifactId>
+    <version>2.0-beta-1-SNAPSHOT</version>
+  </parent>
+  <artifactId>maven-repository-checker</artifactId>
+  <name>Maven Repository Checker</name>
+  <version>1.0-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>2.0-beta-1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.0.1</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: maven/components/trunk/sandbox/maven-repository-checker/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/sandbox/maven-repository-checker/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/CheckRepo.java
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/CheckRepo.java?rev=220028&view=auto
==============================================================================
--- 
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/CheckRepo.java
 (added)
+++ 
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/CheckRepo.java
 Thu Jul 21 03:10:32 2005
@@ -0,0 +1,74 @@
+package org.apache.maven.repository.checker;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+
+import java.io.File;
+import java.io.FileReader;
+
+public class CheckRepo
+{
+    public static void main( String[] args )
+    {
+        if ( args.length != 1 )
+        {
+            System.out.println( "Usage: " + CheckRepo.class.getName() + " 
<repository path>" );
+            System.exit( 1 );
+        }
+
+        File rootDir = new File( args[0] );
+        if ( !rootDir.exists() )
+        {
+            System.out.println( rootDir.getAbsolutePath() + " doesn't exist." 
);
+
+            System.exit( 1 );
+        }
+
+        String[] extensions = { "pom" };
+
+        String[] files = FileUtils.getFilesFromExtension( 
rootDir.getAbsolutePath(), extensions );
+
+        for ( int i = 0; i < files.length; i++ )
+        {
+            //System.out.println( files[i] );
+            parseFile( new File( files[i] ) );
+        }
+    }
+
+    private static void parseFile( File file )
+    {
+        try
+        {
+            FileReader fileReader = new FileReader( file );
+
+            MavenXpp3Reader reader = new MavenXpp3Reader();
+
+            reader.read( fileReader );
+        }
+        catch ( Exception e )
+        {
+            System.out.println( 
"================================================" );
+
+            System.out.println( file.getAbsolutePath() );
+
+            e.printStackTrace();
+
+            System.out.println( 
"================================================" );
+        }
+    }
+}

Propchange: 
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/CheckRepo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/components/trunk/sandbox/maven-repository-checker/src/main/java/org/apache/maven/repository/checker/CheckRepo.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to