Skip to content

Commit 10398dd

Browse files
ian-lavalleeelharo
andauthored
[MDEP-644] Reintroduce the verbose option for dependency:tree (apache#92)
Reintroduce the verbose option for dependency:tree Co-authored-by: Elliotte Rusty Harold <elharo@ibiblio.org>
1 parent 130aecd commit 10398dd

File tree

29 files changed

+1712
-65
lines changed

29 files changed

+1712
-65
lines changed

dependency-reduced-pom.xml

Lines changed: 426 additions & 0 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@ under the License.
9898
<project.build.outputTimestamp>2020-03-07T11:40:47Z</project.build.outputTimestamp>
9999
</properties>
100100

101-
<dependencyManagement>
102-
<dependencies>
103-
<dependency>
104-
<groupId>org.ow2.asm</groupId>
105-
<artifactId>asm</artifactId>
106-
<version>8.0.1</version>
107-
</dependency>
108-
</dependencies>
109-
</dependencyManagement>
110-
111101
<dependencies>
112102
<!-- maven -->
113103
<!-- Remove once deprecated code has been replaced/removed -->
@@ -339,7 +329,6 @@ under the License.
339329
<version>${jettyVersion}</version>
340330
<scope>test</scope>
341331
</dependency>
342-
343332
</dependencies>
344333

345334
<build>
@@ -359,7 +348,10 @@ under the License.
359348
<exclude>src/it/projects/tree-multimodule/expected.txt</exclude>
360349
<exclude>src/it/projects/tree-multimodule/module-a/expected.txt</exclude>
361350
<exclude>src/it/projects/tree-multimodule/module-b/expected.txt</exclude>
362-
<exclude>src/it/projects/tree-verbose/expected.txt</exclude>
351+
<exclude>src/it/projects/tree-verbose/expected*.txt</exclude>
352+
<exclude>src/it/projects/tree-verbose-small/expected.txt</exclude>
353+
<!-- These files contain expected versions for unit tests -->
354+
<exclude>src/test/resources/unit/verbose-serializer-test/*</exclude>
363355
<!--
364356
These files contain real repository artifacts.
365357
-->
@@ -423,8 +415,6 @@ under the License.
423415
<projectsDirectory>src/it/projects</projectsDirectory>
424416
<pomExcludes>
425417
<pomExclude>purge-local-repository-bad-pom/pom.xml</pomExclude>
426-
<!-- verbose was using Maven2 code, removed with MDEP-494, requires MSHARED-339 to be fixed first -->
427-
<pomExclude>tree-verbose/pom.xml</pomExclude>
428418
</pomExcludes>
429419
<pomIncludes>
430420
<pomInclude>*/pom.xml</pomInclude>
@@ -456,7 +446,7 @@ under the License.
456446
<mockRepo>
457447
<source>src/it/mrm/repository</source>
458448
</mockRepo>
459-
<!--
449+
<!--
460450
<mockRepo>
461451
<source>src/test/resources/m2repo</source>
462452
</mockRepo>

src/it/projects/analyze-report/invoker.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@
1616
# under the License.
1717

1818
invoker.goals = clean ${project.groupId}:${project.artifactId}:${project.version}:analyze-report
19-
# don't know why it fails with Maven 2 on some weird java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
20-
# no time to investigate, Maven 2 is not supported any more
2119
invoker.maven.version = 3.0+

src/it/projects/analyze-testDependencyWithNonTestScope/invoker.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@
1616
# under the License.
1717

1818
invoker.goals = clean ${project.groupId}:${project.artifactId}:${project.version}:analyze-report
19-
# don't know why it fails with Maven 2 on some weird java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
20-
# no time to investigate, Maven 2 is not supported any more
2119
invoker.maven.version = 3.0+

src/it/projects/analyze-testDependencyWithNonTestScope/src/test/java/hello/HelloTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@
2222
import org.junit.Test;
2323
import static org.junit.Assert.*;
2424

25-
import static org.assertj.core.api.Assertions.assertThat;
26-
2725
public class HelloTest {
2826

2927
@Test
3028
public void testAdd() {
3129
assertEquals( 1 + 1, 2 );
32-
assertThat( "aaa" ).contains( "a" );
3330
}
3431

3532
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
org.apache.maven.its.dependency:tree-verbose2:jar:1.0-SNAPSHOT
2+
+- commons-logging:commons-logging:jar:1.2:compile
3+
| +- (log4j:log4j:jar:1.2.17:compile - omitted due to optional dependency)
4+
| +- (logkit:logkit:jar:1.0.1:compile - omitted due to optional dependency)
5+
| +- (avalon-framework:avalon-framework:jar:4.1.5:compile - omitted due to optional dependency)
6+
| \- (javax.servlet:servlet-api:jar:2.3:provided - omitted due to optional dependency)
7+
\- junit:junit:jar:4.13:test
8+
\- org.hamcrest:hamcrest-core:jar:1.3:compile
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
invoker.goals = clean dependency:tree
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one
4+
~ or more contributor license agreements. See the NOTICE file
5+
~ distributed with this work for additional information
6+
~ regarding copyright ownership. The ASF licenses this file
7+
~ to you under the Apache License, Version 2.0 (the
8+
~ "License"); you may not use this file except in compliance
9+
~ with the License. You may obtain a copy of the License at
10+
~
11+
~ http://www.apache.org/licenses/LICENSE-2.0
12+
~
13+
~ Unless required by applicable law or agreed to in writing,
14+
~ software distributed under the License is distributed on an
15+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
~ KIND, either express or implied. See the License for the
17+
~ specific language governing permissions and limitations
18+
~ under the License.
19+
-->
20+
21+
<project xmlns="http://maven.apache.org/POM/4.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<groupId>org.apache.maven.its.dependency</groupId>
27+
<artifactId>tree-verbose2</artifactId>
28+
<version>1.0-SNAPSHOT</version>
29+
30+
<name>VerboseTest2</name>
31+
<description>
32+
Test verbose dependency:tree with current dependency-plugin Maven version.
33+
</description>
34+
35+
<properties>
36+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
37+
</properties>
38+
39+
<dependencies>
40+
<dependency>
41+
<groupId>commons-logging</groupId>
42+
<artifactId>commons-logging</artifactId>
43+
<version>1.2</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>junit</groupId>
47+
<artifactId>junit</artifactId>
48+
<version>4.13</version>
49+
<scope>test</scope>
50+
</dependency>
51+
</dependencies>
52+
53+
<build>
54+
<pluginManagement>
55+
<plugins>
56+
<plugin>
57+
<groupId>@project.groupId@</groupId>
58+
<artifactId>@project.artifactId@</artifactId>
59+
<version>@project.version@</version>
60+
<configuration>
61+
<outputFile>target/tree.txt</outputFile>
62+
<verbose>true</verbose>
63+
</configuration>
64+
</plugin>
65+
</plugins>
66+
</pluginManagement>
67+
</build>
68+
</project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import java.io.*;
21+
import org.codehaus.plexus.util.*;
22+
23+
String actual = FileUtils.fileRead( new File( basedir, "target/tree.txt" ) );
24+
String expected = FileUtils.fileRead( new File( basedir, "expected.txt" ) );
25+
26+
actual = actual.replaceAll( "[\n\r]+", "\n" );
27+
expected = expected.replaceAll( "[\n\r]+", "\n" );
28+
29+
if ( !actual.equals( expected ) )
30+
{
31+
throw new Exception( "Unexpected dependency tree." + System.lineSeparator() + "Expected:" + System.lineSeparator()
32+
+ expected + System.lineSeparator() + "Actual:" + System.lineSeparator() + actual );
33+
}
34+
35+
return true;
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
org.apache.maven.its.dependency:tree-verbose:jar:1.0-SNAPSHOT
2+
+- org.apache.maven:maven-project:jar:2.0.6:compile
3+
| +- org.apache.maven:maven-settings:jar:2.0.6:compile
4+
| | +- (org.apache.maven:maven-model:jar:2.0.5:test - version managed from 2.0.6; scope managed from compile; omitted for duplicate)
5+
| | +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
6+
| | \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate)
7+
| +- (org.apache.maven:maven-profile:jar:2.0.6:compile - omitted for conflict with 2.0.4)
8+
| +- (org.apache.maven:maven-model:jar:2.0.5:test - version managed from 2.0.6; scope managed from compile; omitted for conflict with 2.0.7)
9+
| +- org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
10+
| | +- org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
11+
| | | \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
12+
| | +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
13+
| | +- (org.apache.maven:maven-artifact:jar:2.0.6:compile - omitted for duplicate)
14+
| | +- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate)
15+
| | \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
16+
| | \- (org.codehaus.plexus:plexus-utils:jar:1.0.4:compile - omitted for duplicate)
17+
| +- org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
18+
| | +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
19+
| | \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate)
20+
| +- org.codehaus.plexus:plexus-utils:jar:1.4.1:compile
21+
| +- org.apache.maven:maven-artifact:jar:2.0.6:compile
22+
| | \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
23+
| \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
24+
| +- junit:junit:jar:3.8.1:compile
25+
| +- (org.codehaus.plexus:plexus-utils:jar:1.0.4:compile - omitted for conflict with 1.4.1)
26+
| \- classworlds:classworlds:jar:1.1-alpha-2:compile
27+
+- org.apache.maven:maven-profile:jar:2.0.4:test (scope not updated to compile)
28+
| +- (org.apache.maven:maven-model:jar:2.0.5:test - version managed from 2.0.4; scope managed from compile; omitted for conflict with 2.0.7)
29+
| +- (org.codehaus.plexus:plexus-utils:jar:1.1:compile - omitted for conflict with 1.4.1)
30+
| \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9:compile - omitted for conflict with 1.0-alpha-9-stable-1)
31+
+- org.apache.maven:maven-model:jar:2.0.7:runtime
32+
| \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
33+
\- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
34+
+- org.apache.xmlgraphics:batik-anim:jar:1.7:compile
35+
| +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate)
36+
| +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate)
37+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
38+
| +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate)
39+
| +- (org.apache.xmlgraphics:batik-anim:jar:1.7:compile - omitted for cycle)
40+
| +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate)
41+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
42+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
43+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
44+
+- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
45+
| \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
46+
+- org.apache.xmlgraphics:batik-css:jar:1.7:compile
47+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
48+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
49+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
50+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
51+
+- org.apache.xmlgraphics:batik-dom:jar:1.7:compile
52+
| +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate)
53+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
54+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
55+
| +- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate)
56+
| +- (xalan:xalan:jar:2.6.0:compile - omitted for duplicate)
57+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
58+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
59+
+- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
60+
| \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
61+
+- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle)
62+
+- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile
63+
| \- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate)
64+
+- org.apache.xmlgraphics:batik-parser:jar:1.7:compile
65+
| +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate)
66+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
67+
| \- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate)
68+
+- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle)
69+
+- org.apache.xmlgraphics:batik-script:jar:1.7:compile
70+
+- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
71+
| +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for cycle)
72+
| +- (org.apache.xmlgraphics:batik-anim:jar:1.7:compile - omitted for duplicate)
73+
| +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate)
74+
| +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate)
75+
| +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate)
76+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
77+
| +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate)
78+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
79+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
80+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
81+
+- org.apache.xmlgraphics:batik-util:jar:1.7:compile
82+
+- org.apache.xmlgraphics:batik-xml:jar:1.7:compile
83+
| \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
84+
+- xalan:xalan:jar:2.6.0:compile
85+
| \- (xml-apis:xml-apis:jar:1.0.b2:compile - omitted for conflict with 1.3.04)
86+
+- xml-apis:xml-apis:jar:1.3.04:compile
87+
\- xml-apis:xml-apis-ext:jar:1.3.04:compile

0 commit comments

Comments
 (0)