kwin closed pull request #9: [MJAVADOC-513] make order of classpath predictable
URL: https://github.com/apache/maven-javadoc-plugin/pull/9
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java 
b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index e19b68f..f1fe71a 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -117,7 +117,6 @@
 import java.util.Calendar;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -2596,7 +2595,18 @@ private String getSourcePath( Collection<String> 
sourcePaths )
         throws MavenReportException
     {
         List<File> classpathElements = new ArrayList<>();
-        Map<String, Artifact> compileArtifactMap = new HashMap<>();
+        // keep the insertion order
+        Map<String, Artifact> compileArtifactMap = new LinkedHashMap<>();
+
+        if ( additionalDependencies != null )
+        {
+            for ( Dependency dependency : additionalDependencies )
+            {
+                Artifact artifact = resolveDependency( dependency );
+                getLog().debug( "add additional artifact with path " + 
artifact.getFile() );
+                classpathElements.add( artifact.getFile() );
+            }
+        }
 
         if ( isTest() )
         {
@@ -2667,16 +2677,6 @@ private String getSourcePath( Collection<String> 
sourcePaths )
             classpathElements.add( a.getFile() );
         }
 
-        if ( additionalDependencies != null )
-        {
-            for ( Dependency dependency : additionalDependencies )
-            {
-                Artifact artifact = resolveDependency( dependency );
-                getLog().debug( "add additional artifact with path " + 
artifact.getFile() );
-                classpathElements.add( artifact.getFile() );
-            }
-        }
-
         return classpathElements;
     }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to