You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2018/06/30 21:32:37 UTC

[maven-jxr] branch JXR-125 created (now 396c200)

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch JXR-125
in repository https://gitbox.apache.org/repos/asf/maven-jxr.git.


      at 396c200  [JXR-125] Upgrade to Maven 3.0 compatiblity

This branch includes the following new commits:

     new 396c200  [JXR-125] Upgrade to Maven 3.0 compatiblity

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-jxr] 01/01: [JXR-125] Upgrade to Maven 3.0 compatiblity

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch JXR-125
in repository https://gitbox.apache.org/repos/asf/maven-jxr.git

commit 396c200dba807c697e0b67bee76a15cddc0356ea
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Jun 30 23:32:30 2018 +0200

    [JXR-125] Upgrade to Maven 3.0 compatiblity
---
 maven-jxr-plugin/pom.xml                           | 43 +++++++++-------------
 .../org/apache/maven/plugin/jxr/JxrReportTest.java | 18 ---------
 maven-jxr/pom.xml                                  |  5 ---
 .../org/apache/maven/jxr/DirectoryIndexer.java     | 28 +++++++-------
 4 files changed, 30 insertions(+), 64 deletions(-)

diff --git a/maven-jxr-plugin/pom.xml b/maven-jxr-plugin/pom.xml
index 5587a58..bac9e10 100644
--- a/maven-jxr-plugin/pom.xml
+++ b/maven-jxr-plugin/pom.xml
@@ -36,9 +36,9 @@ under the License.
   <inceptionYear>2005</inceptionYear>
 
   <properties>
-    <mavenVersion>2.2.1</mavenVersion>
-    <doxia-sitetoolsVersion>1.4</doxia-sitetoolsVersion>
-    <doxiaVersion>1.4</doxiaVersion>
+    <mavenVersion>3.0</mavenVersion>
+    <doxia-sitetoolsVersion>1.8</doxia-sitetoolsVersion>
+    <doxiaVersion>1.8</doxiaVersion>
   </properties>
 
   <prerequisites>
@@ -88,11 +88,6 @@ under the License.
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity</artifactId>
-      <version>1.5</version>
-    </dependency>
-    <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-jxr</artifactId>
       <version>${project.version}</version>
@@ -106,7 +101,12 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
+      <artifactId>maven-artifact</artifactId>
+      <version>${mavenVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
       <version>${mavenVersion}</version>
     </dependency>
     <dependency>
@@ -114,17 +114,18 @@ under the License.
       <artifactId>maven-model</artifactId>
       <version>${mavenVersion}</version>
     </dependency>
-
-    <!-- shared -->
     <dependency>
-      <groupId>org.apache.maven.reporting</groupId>
-      <artifactId>maven-reporting-api</artifactId>
-      <version>3.0</version>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-compat</artifactId>
+      <version>${mavenVersion}</version>
+      <scope>test</scope>
     </dependency>
+
+    <!-- shared -->
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
-      <version>2.3</version>
+      <version>3.0.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
@@ -137,11 +138,6 @@ under the License.
       <version>${doxia-sitetoolsVersion}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-sink-api</artifactId>
-      <version>${doxiaVersion}</version>
-    </dependency>
-    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
@@ -164,14 +160,9 @@ under the License.
     </dependency>
 
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.apache.maven.plugin-testing</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
-      <version>1.2</version>
+      <version>2.1</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java
index 42c59d1..6b83e82 100644
--- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java
+++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java
@@ -35,24 +35,6 @@ public class JxrReportTest
     extends AbstractMojoTestCase
 {
     /**
-     * @see org.apache.maven.plugin.testing.AbstractMojoTestCase#setUp()
-     */
-    protected void setUp()
-        throws Exception
-    {
-        super.setUp();
-    }
-
-    /**
-     * @see org.codehaus.plexus.PlexusTestCase#tearDown()
-     */
-    protected void tearDown()
-        throws Exception
-    {
-        // nop
-    }
-
-    /**
      * Test the plugin with default configuration
      *
      * @throws Exception
diff --git a/maven-jxr/pom.xml b/maven-jxr/pom.xml
index 1efe892..eb2a13e 100644
--- a/maven-jxr/pom.xml
+++ b/maven-jxr/pom.xml
@@ -88,11 +88,6 @@ under the License.
       <version>1.5</version>
     </dependency>
     <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <version>2.5</version>
-    </dependency>
-    <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
       <version>2.6</version>
diff --git a/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java b/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java
index 5a465d2..b15b058 100644
--- a/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java
+++ b/maven-jxr/src/main/java/org/apache/maven/jxr/DirectoryIndexer.java
@@ -36,7 +36,6 @@ import org.apache.maven.jxr.log.VelocityLogger;
 import org.apache.maven.jxr.pacman.ClassType;
 import org.apache.maven.jxr.pacman.PackageManager;
 import org.apache.maven.jxr.pacman.PackageType;
-import org.apache.oro.text.perl.Perl5Util;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
@@ -216,7 +215,7 @@ public class DirectoryIndexer
     public void process( Log log )
         throws JxrException
     {
-        Map info = getPackageInfo();
+        Map<String, Object> info = getPackageInfo();
 
         VelocityEngine engine = new VelocityEngine();
         setProperties( engine, log );
@@ -334,17 +333,16 @@ public class DirectoryIndexer
      */
     private Map<String, Object> getPackageInfo()
     {
-        TreeMap<String, Map<String, Object>> allPackages = new TreeMap<String, Map<String, Object>>();
-        TreeMap<String, Map<String, String>> allClasses = new TreeMap<String, Map<String, String>>();
-        Perl5Util perl = new Perl5Util();
+        Map<String, Map<String, Object>> allPackages = new TreeMap<>();
+        Map<String, Map<String, String>> allClasses = new TreeMap<>();
 
-        Enumeration packages = packageManager.getPackageTypes();
+        Enumeration<PackageType> packages = packageManager.getPackageTypes();
         while ( packages.hasMoreElements() )
         {
-            PackageType pkg = (PackageType) packages.nextElement();
+            PackageType pkg = packages.nextElement();
             String pkgName = pkg.getName();
-            String pkgDir = perl.substitute( "s/\\./\\//g", pkgName );
-            String rootRef = perl.substitute( "s/[^\\.]*(\\.|$)/..\\//g", pkgName );
+            String pkgDir = pkgName.replace( '.', '/' );
+            String rootRef = pkgName.replaceAll( "[^\\.]+(\\.|$)", "../" );
 
             // special case for the default package
             // javadoc doesn't deal with it, but it's easy for us
@@ -355,14 +353,14 @@ public class DirectoryIndexer
                 rootRef = "./";
             }
 
-            TreeMap<String, Map<String, String>> pkgClasses = new TreeMap<String, Map<String, String>>();
-            Enumeration classes = pkg.getClassTypes();
+            Map<String, Map<String, String>> pkgClasses = new TreeMap<String, Map<String, String>>();
+            Enumeration<ClassType> classes = pkg.getClassTypes();
             while ( classes.hasMoreElements() )
             {
-                ClassType clazz = (ClassType) classes.nextElement();
+                ClassType clazz = classes.nextElement();
 
                 String className = clazz.getName();
-                Map<String, String> classInfo = new HashMap<String, String>();
+                Map<String, String> classInfo = new HashMap<>();
                 if ( clazz.getFilename() != null )
                 {
                     classInfo.put( "filename", clazz.getFilename() );
@@ -378,7 +376,7 @@ public class DirectoryIndexer
                 allClasses.put( className, classInfo );
             }
 
-            Map<String, Object> pkgInfo = new HashMap<String, Object>();
+            Map<String, Object> pkgInfo = new HashMap<>();
             pkgInfo.put( "name", pkgName );
             pkgInfo.put( "dir", pkgDir );
             pkgInfo.put( "classes", pkgClasses );
@@ -386,7 +384,7 @@ public class DirectoryIndexer
             allPackages.put( pkgName, pkgInfo );
         }
 
-        Map<String, Object> info = new HashMap<String, Object>();
+        Map<String, Object> info = new HashMap<>();
         info.put( "allPackages", allPackages );
         info.put( "allClasses", allClasses );