-
Notifications
You must be signed in to change notification settings - Fork 183
[MDEP-644] [DRAFT] Reintroduce the verbose option for dependency:tree #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/main/java/org/apache/maven/plugins/dependency/tree/DependencyGraphBuilder.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/org/apache/maven/plugins/dependency/tree/DependencyGraphBuilderException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
src/main/java/org/apache/maven/plugins/dependency/tree/DependencyNode.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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