diff --git a/src/it/verbose-war/expected-default.txt b/src/it/verbose-war/expected-default.txt new file mode 100644 index 0000000..24557be --- /dev/null +++ b/src/it/verbose-war/expected-default.txt @@ -0,0 +1,29 @@ +org.apache.maven.its.dependency-tree:verbose:war:1.0-SNAPSHOT ++- org.apache.maven:maven-project:jar:2.0.6:compile +| +- org.apache.maven:maven-settings:jar:2.0.6:compile +| +- org.apache.maven:maven-artifact-manager:jar:2.0.6:compile +| | +- org.apache.maven:maven-repository-metadata:jar:2.0.6:compile +| | \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile +| +- org.apache.maven:maven-plugin-registry:jar:2.0.6:compile +| +- org.codehaus.plexus:plexus-utils:jar:1.4.1:compile +| \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile +| +- junit:junit:jar:3.8.1:compile +| \- classworlds:classworlds:jar:1.1-alpha-2:compile ++- org.apache.maven:maven-profile:jar:2.0.4:test ++- org.apache.maven:maven-model:jar:2.0.7:runtime +\- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile + +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile + +- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile + +- org.apache.xmlgraphics:batik-css:jar:1.7:compile + +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile + +- org.apache.xmlgraphics:batik-ext:jar:1.7:compile + +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile + +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile + +- org.apache.xmlgraphics:batik-script:jar:1.7:compile + | \- org.apache.xmlgraphics:batik-js:jar:1.7:compile + +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile + +- org.apache.xmlgraphics:batik-util:jar:1.7:compile + +- org.apache.xmlgraphics:batik-xml:jar:1.7:compile + +- xalan:xalan:jar:2.6.0:compile + +- xml-apis:xml-apis:jar:1.3.04:compile + \- xml-apis:xml-apis-ext:jar:1.3.04:compile diff --git a/src/it/verbose-war/expected-verbose.txt b/src/it/verbose-war/expected-verbose.txt new file mode 100644 index 0000000..20be1b3 --- /dev/null +++ b/src/it/verbose-war/expected-verbose.txt @@ -0,0 +1,93 @@ +org.apache.maven.its.dependency-tree:verbose:war:1.0-SNAPSHOT ++- org.apache.maven:maven-project:jar:2.0.6:compile +| +- org.apache.maven:maven-settings:jar:2.0.6:compile +| | +- (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) +| | +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate) +| | \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate) +| +- (org.apache.maven:maven-profile:jar:2.0.6:compile - omitted for conflict with 2.0.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) +| +- org.apache.maven:maven-artifact-manager:jar:2.0.6:compile +| | +- org.apache.maven:maven-repository-metadata:jar:2.0.6:compile +| | | \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate) +| | +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate) +| | +- (org.apache.maven:maven-artifact:jar:2.0.6:compile - omitted for exclusion by org.apache.maven:maven-project) +| | +- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate) +| | \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile +| | \- (org.codehaus.plexus:plexus-utils:jar:1.0.4:compile - omitted for conflict with 1.4.1) +| +- org.apache.maven:maven-plugin-registry:jar:2.0.6:compile +| | +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate) +| | \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate) +| +- org.codehaus.plexus:plexus-utils:jar:1.4.1:compile +| +- (org.apache.maven:maven-artifact:jar:2.0.6:compile - omitted for exclusion by org.apache.maven:maven-project) +| \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile +| +- junit:junit:jar:3.8.1:compile +| +- (org.codehaus.plexus:plexus-utils:jar:1.0.4:compile - omitted for conflict with 1.4.1) +| \- classworlds:classworlds:jar:1.1-alpha-2:compile ++- org.apache.maven:maven-profile:jar:2.0.4:test (scope not updated to compile) +| +- (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) +| +- (org.codehaus.plexus:plexus-utils:jar:1.1:test - omitted for conflict with 1.4.1) +| \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9:test - omitted for conflict with 1.0-alpha-9-stable-1) ++- org.apache.maven:maven-model:jar:2.0.7:runtime +| \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:runtime - omitted for duplicate) +\- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile + +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile + | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + | +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile + | \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-css:jar:1.7:compile + | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + | +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile + | +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate) + | +- (xalan:xalan:jar:2.6.0:compile - omitted for duplicate) + | +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-ext:jar:1.7:compile + | \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile + | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle) + | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + | \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile + | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + | \- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-script:jar:1.7:compile + | +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle) + | +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + | +- org.apache.xmlgraphics:batik-js:jar:1.7:compile + | | \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + | \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile + | +- (org.apache.xmlgraphics:batik-anim:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate) + | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + | +- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for duplicate) + | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) + +- org.apache.xmlgraphics:batik-util:jar:1.7:compile + +- org.apache.xmlgraphics:batik-xml:jar:1.7:compile + | \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) + +- xalan:xalan:jar:2.6.0:compile + | \- (xml-apis:xml-apis:jar:1.0.b2:compile - omitted for conflict with 1.3.04) + +- xml-apis:xml-apis:jar:1.3.04:compile + \- xml-apis:xml-apis-ext:jar:1.3.04:compile diff --git a/src/it/verbose-war/invoker.properties b/src/it/verbose-war/invoker.properties new file mode 100644 index 0000000..55442dc --- /dev/null +++ b/src/it/verbose-war/invoker.properties @@ -0,0 +1,20 @@ +# 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. + +invoker.goals = clean validate +# Maven 2 makes wrong resolution +invoker.maven.version = 3.0+ diff --git a/src/it/verbose-war/pom.xml b/src/it/verbose-war/pom.xml new file mode 100644 index 0000000..cdf9bca --- /dev/null +++ b/src/it/verbose-war/pom.xml @@ -0,0 +1,114 @@ + + + + + 4.0.0 + + org.apache.maven.its.dependency-tree + verbose + 1.0-SNAPSHOT + war + + VerboseTest + + Test verbose dependency-tree with actual Maven version through old dependency:tree 2.4, before the feature was removed. + + + + UTF-8 + + + + + + org.apache.maven + maven-model + 2.0.5 + test + + + + + + + org.apache.maven + maven-project + 2.0.6 + + + org.apache.maven + maven-artifact + + + + + org.apache.maven + maven-profile + 2.0.4 + test + + + org.apache.maven + maven-model + 2.0.7 + runtime + + + org.apache.xmlgraphics + batik-bridge + 1.7 + + + + + + + org.apache.maven.its.dependency-tree + graph-maven-plugin + 1.0-SNAPSHOT + + + verbose + validate + + target/tree-verbose.txt + true + + + graph + + + + default + validate + + target/tree-default.txt + + + graph + + + + + + + diff --git a/src/it/verbose-war/verify.groovy b/src/it/verbose-war/verify.groovy new file mode 100644 index 0000000..2065d47 --- /dev/null +++ b/src/it/verbose-war/verify.groovy @@ -0,0 +1,30 @@ +/* + * 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. + */ + +def actual = new File( basedir, "target/tree-verbose.txt" ).readLines() +// omitted for cycle not supported anymore, but should probably return +// omitted for exclusion is not supported yet +def expected = new File( basedir, "expected-verbose.txt" ).readLines().findAll{!((it.contains('omitted for cycle')||it.contains('omitted for exclusion')))} + +assert actual.equals( expected ) + +actual = new File( basedir, "target/tree-default.txt" ).readLines() +expected = new File( basedir, "expected-default.txt" ).readLines() + +assert actual.equals( expected ) \ No newline at end of file diff --git a/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyCollectorBuilder.java b/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyCollectorBuilder.java index 927c389..87f9334 100644 --- a/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyCollectorBuilder.java +++ b/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyCollectorBuilder.java @@ -133,7 +133,7 @@ public DependencyNode collectDependencyGraph( ProjectBuildingRequest buildingReq exceptionHandler ); CollectRequest collectRequest = new CollectRequest(); - collectRequest.setRoot( new org.eclipse.aether.graph.Dependency( aetherArtifact, "" ) ); + collectRequest.setRootArtifact( aetherArtifact ); collectRequest.setRepositories( aetherRepos ); org.eclipse.aether.artifact.ArtifactTypeRegistry stereotypes = session.getArtifactTypeRegistry();