Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,777 changes: 2,777 additions & 0 deletions mvnVerifyError.txt

Large diffs are not rendered by default.

39 changes: 32 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ under the License.
<relativePath>../../pom/maven/maven-plugins/pom.xml</relativePath>
</parent>



<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.3-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
Expand Down Expand Up @@ -217,7 +219,6 @@ under the License.
<artifactId>plexus-io</artifactId>
<version>3.2.0</version>
</dependency>

<!-- shared -->
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand All @@ -230,11 +231,6 @@ under the License.
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-dependency-tree</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-common-artifact-filters</artifactId>
Expand Down Expand Up @@ -275,6 +271,33 @@ under the License.
<artifactId>maven-plugin-annotations</artifactId>
</dependency>

<!-- aether -->
<dependency>
<groupId>org.eclipse.aether</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still an old version. You want maven-resolver:

org.apache.maven.resolver maven-resolver-api 1.4.2

<artifactId>aether-api</artifactId>
<version>1.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>1.1.0</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
</exclusion>
</exclusions>
</dependency>


<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-components</artifactId>
<version>34</version>
<type>pom</type>
</dependency>

<!-- test -->
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -340,6 +363,7 @@ under the License.
<scope>test</scope>
</dependency>


</dependencies>

<build>
Expand All @@ -350,6 +374,7 @@ under the License.
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes combine.children="append">
<exclude>mvnVerifyError.txt</exclude>
<!--
These files contain results for integration tests which can't contain license header
otherwise the IT's will fail.
Expand Down Expand Up @@ -424,7 +449,7 @@ under the License.
<pomExcludes>
<pomExclude>purge-local-repository-bad-pom/pom.xml</pomExclude>
<!-- verbose was using Maven2 code, removed with MDEP-494, requires MSHARED-339 to be fixed first -->
<pomExclude>tree-verbose/pom.xml</pomExclude>
<!-- <pomExclude>tree-verbose/pom.xml</pomExclude> -->
</pomExcludes>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
Expand Down
1 change: 1 addition & 0 deletions src/it/projects/tree-verbose/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* under the License.
*/

import org.apache.maven.shared.dependency.graph.DependencyNode;
import org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor;
import org.apache.maven.plugins.dependency.tree.DependencyNode;
import org.apache.maven.plugins.dependency.tree.traversal.DependencyNodeVisitor;

import java.io.Writer;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;


import java.util.Collection;

/**
* Maven project dependency graph builder API, neutral against Maven 2 or Maven 3.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer neutral

*
* @author Hervé Boutemy
* @since 2.0
*/
public interface DependencyGraphBuilder
{
/**
* Build the dependency graph.
*
* @param buildingRequest the buildingRequest
* @param filter artifact filter (can be <code>null</code>)
* @return the dependency graph
* @throws DependencyGraphBuilderException if some of the dependencies could not be resolved.
*/
DependencyNode buildDependencyGraph( ProjectBuildingRequest buildingRequest, ArtifactFilter filter )
throws DependencyGraphBuilderException;

/**
* Build the dependency graph, with a hack to include dependencies contained in the reactor projects
* but that are not yet compiled, which is the minimum prerequisite for Maven core's
* ReactorReader to find them. Notice that this hack hasn't been done for Maven 2.
* <p>Notice: If Maven core did collect instead of resolving dependencies (ie did not try to get the
* artifacts but only the poms), probably this hack wouldn't be necessary even for people requiring
* the dependency graph before compiling. TODO: for Maven 3, use Aether to collect dependencies.</p>
*
* @param buildingRequest the buildingRequest
* @param filter artifact filter (can be <code>null</code>)
* @param reactorProjects Collection of those projects contained in the reactor (can be <code>null</code>).
* @return the dependency graph
* @throws DependencyGraphBuilderException if some of the dependencies could not be resolved.
*/
DependencyNode buildDependencyGraph( ProjectBuildingRequest buildingRequest, ArtifactFilter filter, Collection<MavenProject> reactorProjects )
throws DependencyGraphBuilderException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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.
*/

/**
* Indicates that a Maven project's dependency graph cannot be resolved.
*
* @author Hervé Boutemy
* @since 2.0
*/
public class DependencyGraphBuilderException
extends Exception
{
private static final long serialVersionUID = -7428777046707410949L;

// constructors -----------------------------------------------------------

/**
* @param message Message indicating why dependency graph could not be resolved.
*/
public DependencyGraphBuilderException( String message )
{
super( message );
}

/**
* @param message Message indicating why dependency graph could not be resolved.
* @param cause Throwable indicating at which point the graph failed to be resolved.
*/
public DependencyGraphBuilderException( String message, Throwable cause )
{
super( message, cause );
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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.artifact.Artifact;
import org.apache.maven.model.Exclusion;
import org.apache.maven.plugins.dependency.tree.traversal.DependencyNodeVisitor;

import java.util.List;

/**
* Represents an artifact node within a Maven project's dependency graph. Notice there is no support for omitted nodes
* at the moment, only dependencies kept in the resolved dependency list are available.
*
* @author Hervé Boutemy
* @since 2.0
*/
public interface DependencyNode
{
/**
* @return Artifact for this DependencyNode.
*/
Artifact getArtifact();

/**
* @return children of this DependencyNode.
*/
List<DependencyNode> getChildren();

/**
* Applies the specified dependency node visitor to this dependency node and its children.
*
* @param visitor the dependency node visitor to use
* @return the visitor result of ending the visit to this node
* @since 1.1
*/
boolean accept( DependencyNodeVisitor visitor );

/**
* Gets the parent dependency node of this dependency node.
*
* @return the parent dependency node
*/
DependencyNode getParent();

/**
* Gets the version or version range for the dependency before dependency management was applied (if any).
*
* @return The dependency version before dependency management or {@code null} if the version was not managed.
*/
String getPremanagedVersion();

/**
* Gets the scope for the dependency before dependency management was applied (if any).
*
* @return The dependency scope before dependency management or {@code null} if the scope was not managed.
*/
String getPremanagedScope();

/**
* A constraint on versions for a dependency. A constraint can either consist of one or more version ranges or a
* single version.
*
* @return The constraint on the dependency.
*/
String getVersionConstraint();

/**
* Returns a string representation of this dependency node.
*
* @return the string representation
*/
String toNodeString();

/**
* @return true for an optional dependency.
*/
Boolean getOptional();

/**
*
* @return the exclusions of the dependency
*/
List<Exclusion> getExclusions();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

import java.io.Writer;

import org.apache.maven.shared.dependency.graph.DependencyNode;
import org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor;
import org.apache.maven.plugins.dependency.tree.DependencyNode;
import org.apache.maven.plugins.dependency.tree.traversal.DependencyNodeVisitor;

/**
* A dependency node visitor that serializes visited nodes to a writer using the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.maven.shared.dependency.graph.DependencyNode;
import org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor;
import org.apache.maven.plugins.dependency.tree.DependencyNode;
import org.apache.maven.plugins.dependency.tree.traversal.DependencyNodeVisitor;

/**
* A dependency node visitor that serializes visited nodes to a writer using the
Expand Down
Loading