Skip to content

Commit 63a194b

Browse files
belingueresslachiewicz
authored andcommitted
MSHARED-994 - fix collect dependencies when artifact has 'war' packaging
Added verbose-war IT.
1 parent c49362d commit 63a194b

File tree

6 files changed

+287
-1
lines changed

6 files changed

+287
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
org.apache.maven.its.dependency-tree:verbose:war: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-artifact-manager:jar:2.0.6:compile
5+
| | +- org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
6+
| | \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
7+
| +- org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
8+
| +- org.codehaus.plexus:plexus-utils:jar:1.4.1:compile
9+
| \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
10+
| +- junit:junit:jar:3.8.1:compile
11+
| \- classworlds:classworlds:jar:1.1-alpha-2:compile
12+
+- org.apache.maven:maven-profile:jar:2.0.4:test
13+
+- org.apache.maven:maven-model:jar:2.0.7:runtime
14+
\- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
15+
+- org.apache.xmlgraphics:batik-anim:jar:1.7:compile
16+
+- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
17+
+- org.apache.xmlgraphics:batik-css:jar:1.7:compile
18+
+- org.apache.xmlgraphics:batik-dom:jar:1.7:compile
19+
+- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
20+
+- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile
21+
+- org.apache.xmlgraphics:batik-parser:jar:1.7:compile
22+
+- org.apache.xmlgraphics:batik-script:jar:1.7:compile
23+
| \- org.apache.xmlgraphics:batik-js:jar:1.7:compile
24+
+- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
25+
+- org.apache.xmlgraphics:batik-util:jar:1.7:compile
26+
+- org.apache.xmlgraphics:batik-xml:jar:1.7:compile
27+
+- xalan:xalan:jar:2.6.0:compile
28+
+- xml-apis:xml-apis:jar:1.3.04:compile
29+
\- xml-apis:xml-apis-ext:jar:1.3.04:compile
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
org.apache.maven.its.dependency-tree:verbose:war: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 conflict with 2.0.7)
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 exclusion by org.apache.maven:maven-project)
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 conflict with 1.4.1)
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 - omitted for exclusion by org.apache.maven:maven-project)
22+
| \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
23+
| +- junit:junit:jar:3.8.1:compile
24+
| +- (org.codehaus.plexus:plexus-utils:jar:1.0.4:compile - omitted for conflict with 1.4.1)
25+
| \- classworlds:classworlds:jar:1.1-alpha-2:compile
26+
+- org.apache.maven:maven-profile:jar:2.0.4:test (scope not updated to compile)
27+
| +- (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)
28+
| +- (org.codehaus.plexus:plexus-utils:jar:1.1:test - omitted for conflict with 1.4.1)
29+
| \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9:test - omitted for conflict with 1.0-alpha-9-stable-1)
30+
+- org.apache.maven:maven-model:jar:2.0.7:runtime
31+
| \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:runtime - omitted for duplicate)
32+
\- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
33+
+- org.apache.xmlgraphics:batik-anim:jar:1.7:compile
34+
| +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate)
35+
| +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate)
36+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
37+
| +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate)
38+
| +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate)
39+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
40+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
41+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
42+
+- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
43+
| \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
44+
+- org.apache.xmlgraphics:batik-css:jar:1.7:compile
45+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
46+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
47+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
48+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
49+
+- org.apache.xmlgraphics:batik-dom:jar:1.7:compile
50+
| +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate)
51+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
52+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
53+
| +- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate)
54+
| +- (xalan:xalan:jar:2.6.0:compile - omitted for duplicate)
55+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
56+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
57+
+- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
58+
| \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
59+
+- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile
60+
| +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate)
61+
| +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle)
62+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
63+
| \- (xml-apis:xml-apis:jar:1.3.04: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-script:jar:1.7:compile
69+
| +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle)
70+
| +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate)
71+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
72+
| +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate)
73+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
74+
| +- org.apache.xmlgraphics:batik-js:jar:1.7:compile
75+
| | \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
76+
| \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
77+
+- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
78+
| +- (org.apache.xmlgraphics:batik-anim:jar:1.7:compile - omitted for duplicate)
79+
| +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate)
80+
| +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate)
81+
| +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate)
82+
| +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate)
83+
| +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate)
84+
| +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
85+
| +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate)
86+
| \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
87+
+- org.apache.xmlgraphics:batik-util:jar:1.7:compile
88+
+- org.apache.xmlgraphics:batik-xml:jar:1.7:compile
89+
| \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate)
90+
+- xalan:xalan:jar:2.6.0:compile
91+
| \- (xml-apis:xml-apis:jar:1.0.b2:compile - omitted for conflict with 1.3.04)
92+
+- xml-apis:xml-apis:jar:1.3.04:compile
93+
\- xml-apis:xml-apis-ext:jar:1.3.04:compile

src/it/verbose-war/invoker.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 validate
19+
# Maven 2 makes wrong resolution
20+
invoker.maven.version = 3.0+

src/it/verbose-war/pom.xml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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-tree</groupId>
27+
<artifactId>verbose</artifactId>
28+
<version>1.0-SNAPSHOT</version>
29+
<packaging>war</packaging>
30+
31+
<name>VerboseTest</name>
32+
<description>
33+
Test verbose dependency-tree with actual Maven version through old dependency:tree 2.4, before the feature was removed.
34+
</description>
35+
36+
<properties>
37+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38+
</properties>
39+
40+
<dependencyManagement>
41+
<dependencies>
42+
<dependency>
43+
<groupId>org.apache.maven</groupId>
44+
<artifactId>maven-model</artifactId>
45+
<version>2.0.5</version>
46+
<scope>test</scope>
47+
</dependency>
48+
</dependencies>
49+
</dependencyManagement>
50+
51+
<dependencies>
52+
<dependency>
53+
<groupId>org.apache.maven</groupId>
54+
<artifactId>maven-project</artifactId>
55+
<version>2.0.6</version>
56+
<exclusions>
57+
<exclusion>
58+
<groupId>org.apache.maven</groupId>
59+
<artifactId>maven-artifact</artifactId>
60+
</exclusion>
61+
</exclusions>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.apache.maven</groupId>
65+
<artifactId>maven-profile</artifactId>
66+
<version>2.0.4</version>
67+
<scope>test</scope>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.apache.maven</groupId>
71+
<artifactId>maven-model</artifactId>
72+
<version>2.0.7</version>
73+
<scope>runtime</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.apache.xmlgraphics</groupId>
77+
<artifactId>batik-bridge</artifactId>
78+
<version>1.7</version>
79+
</dependency>
80+
</dependencies>
81+
82+
<build>
83+
<plugins>
84+
<plugin>
85+
<groupId>org.apache.maven.its.dependency-tree</groupId>
86+
<artifactId>graph-maven-plugin</artifactId>
87+
<version>1.0-SNAPSHOT</version>
88+
<executions>
89+
<execution>
90+
<id>verbose</id>
91+
<phase>validate</phase>
92+
<configuration>
93+
<outputFile>target/tree-verbose.txt</outputFile>
94+
<verbose>true</verbose>
95+
</configuration>
96+
<goals>
97+
<goal>graph</goal>
98+
</goals>
99+
</execution>
100+
<execution>
101+
<id>default</id>
102+
<phase>validate</phase>
103+
<configuration>
104+
<outputFile>target/tree-default.txt</outputFile>
105+
</configuration>
106+
<goals>
107+
<goal>graph</goal>
108+
</goals>
109+
</execution>
110+
</executions>
111+
</plugin>
112+
</plugins>
113+
</build>
114+
</project>

src/it/verbose-war/verify.groovy

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
def actual = new File( basedir, "target/tree-verbose.txt" ).readLines()
21+
// omitted for cycle not supported anymore, but should probably return
22+
// omitted for exclusion is not supported yet
23+
def expected = new File( basedir, "expected-verbose.txt" ).readLines().findAll{!((it.contains('omitted for cycle')||it.contains('omitted for exclusion')))}
24+
25+
assert actual.equals( expected )
26+
27+
actual = new File( basedir, "target/tree-default.txt" ).readLines()
28+
expected = new File( basedir, "expected-default.txt" ).readLines()
29+
30+
assert actual.equals( expected )

src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyCollectorBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public DependencyNode collectDependencyGraph( ProjectBuildingRequest buildingReq
133133
exceptionHandler );
134134

135135
CollectRequest collectRequest = new CollectRequest();
136-
collectRequest.setRoot( new org.eclipse.aether.graph.Dependency( aetherArtifact, "" ) );
136+
collectRequest.setRootArtifact( aetherArtifact );
137137
collectRequest.setRepositories( aetherRepos );
138138

139139
org.eclipse.aether.artifact.ArtifactTypeRegistry stereotypes = session.getArtifactTypeRegistry();

0 commit comments

Comments
 (0)