elharo commented on a change in pull request #97:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/97#discussion_r473230397



##########
File path: 
src/main/java/org/apache/maven/plugins/dependency/tree/VerboseGraphGraphmlSerializer.java
##########
@@ -152,6 +152,12 @@ private String getGraphmlNodeLine( DependencyNode node, 
Map<DependencyNode, Stri
                     "scope managed from " + 
node.getArtifact().getProperties().get( PRE_MANAGED_SCOPE );
         }
         builder.append( getDependencyCoordinate( node ) ).append( coordString 
);
+        if ( node.getData().containsKey( "ContainsModule" ) )
+        {
+            builder.append( " WARNING: this tree contains a submodule and once 
it reaches the submodule will print "

Review comment:
       submodule. Once

##########
File path: src/it/projects/tree-verbose-multimodule/verify.bsh
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 java.io.*;
+
+import org.codehaus.plexus.util.*;
+
+String actual = FileUtils.fileRead( new File( basedir, "target/tree.txt" ) );
+String expected = FileUtils.fileRead( new File( basedir, "expected.txt" ) );
+
+actual = actual.replaceAll( "[\n\r]+", "\n" );
+expected = expected.replaceAll( "[\n\r]+", "\n" );
+
+System.out.println( "Checking root dependency tree..." );
+
+if ( !actual.equals( expected ) )
+{
+    throw new Exception( "Unexpected root dependency tree" );
+}
+
+actual = FileUtils.fileRead( new File( basedir, "module-a/target/tree.txt" ) );
+expected = FileUtils.fileRead( new File( basedir, "module-a/expected.txt" ) );
+
+actual = actual.replaceAll( "[\n\r]+", "\n" );
+expected = expected.replaceAll( "[\n\r]+", "\n" );
+
+System.out.println( "Checking module-a dependency tree..." );

Review comment:
       System.out.println isn't usually desired in tests. Passing tests should 
generate no output.

##########
File path: 
src/main/java/org/apache/maven/plugins/dependency/tree/ArtifactKey.java
##########
@@ -0,0 +1,73 @@
+package org.apache.maven.plugins.dependency.tree;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.project.MavenProject;
+
+/**
+ * Uniquely defines an artifact by groupId, artifactId and version.
+ */
+final class ArtifactKey
+{
+    private static final int HASH_PRIME = 31;

Review comment:
       this can be a local variable

##########
File path: 
src/main/java/org/apache/maven/plugins/dependency/tree/VerboseGraphTextSerializer.java
##########
@@ -45,8 +45,16 @@ public String serialize( DependencyNode root )
         // deal with root first
         Artifact rootArtifact = root.getArtifact();
         builder.append( rootArtifact.getGroupId() ).append( ":" ).append( 
rootArtifact.getArtifactId() ).append(
-                ":" ).append( rootArtifact.getExtension() ).append( ":" 
).append( rootArtifact.getVersion() ).append(
-                "\n" );
+                ":" ).append( rootArtifact.getExtension() ).append( ":" 
).append( rootArtifact.getVersion() );
+
+        if ( root.getData().containsKey( "ContainsModule" ) )
+        {
+            builder.append( " WARNING: this tree contains a submodule and once 
it reaches the submodule will print "

Review comment:
       or just convert to two sentences




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to