Author: brianf
Date: Sat Mar 17 20:18:01 2007
New Revision: 519530
URL: http://svn.apache.org/viewvc?view=rev&rev=519530
Log:
fixed up analyze-dep-mgt to detect direct overrides.
Modified:
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt
Modified:
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java?view=diff&rev=519530&r1=519529&r2=519530
==============================================================================
---
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
(original)
+++
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
Sat Mar 17 20:18:01 2007
@@ -28,7 +28,6 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.apache.maven.execution.RuntimeInformation;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.plugin.AbstractMojo;
@@ -79,14 +78,6 @@
*/
private boolean ignoreDirect = true;
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @parameter
expression="${component.org.apache.maven.execution.RuntimeInformation}"
- * @required
- * @readonly
- */
- protected RuntimeInformation rti;
// Mojo methods -----------------------------------------------------------
@@ -144,6 +135,7 @@
// depMgt. That's ok.
if ( this.ignoreDirect )
{
+ getLog().info( "\tIgnoring Direct Dependencies." );
Set directDependencies = project.getDependencyArtifacts();
allDependencies.removeAll( directDependencies );
}
@@ -230,23 +222,6 @@
public void setProject( MavenProject theProject )
{
this.project = theProject;
- }
-
- /**
- * @return the rti
- */
- public RuntimeInformation getRti()
- {
- return this.rti;
- }
-
- /**
- * @param theRti
- * the rti to set
- */
- public void setRti( RuntimeInformation theRti )
- {
- this.rti = theRti;
}
/**
Modified:
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java?view=diff&rev=519530&r1=519529&r2=519530
==============================================================================
---
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
(original)
+++
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeMojo.java
Sat Mar 17 20:18:01 2007
@@ -23,7 +23,6 @@
import java.util.Set;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.execution.RuntimeInformation;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -74,15 +73,6 @@
private ProjectDependencyAnalyzer analyzer;
/**
- * Used to look up Artifacts in the remote repository.
- *
- * @parameter
expression="${component.org.apache.maven.execution.RuntimeInformation}"
- * @required
- * @readonly
- */
- protected RuntimeInformation rti;
-
- /**
* Ignore Direct Dependency Overrides of dependencyManagement section.
*
* @parameter expression="${mdep.analyze.ignore.direct}"
@@ -110,7 +100,6 @@
adm.setProject( this.project );
adm.setFailBuild( this.failBuild );
adm.setPluginContext( this.getPluginContext() );
- adm.setRti( rti );
adm.setIgnoreDirect( this.ignoreDirect );
adm.execute();
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt?view=diff&rev=519530&r1=519529&r2=519530
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt Sat Mar
17 20:18:01 2007
@@ -576,8 +576,8 @@
being included at runtime, or you can specify a dependency in your
project to override what is being included. You can check the results by
rerunning this mojo.
If you decide to override by using a dependency, be sure to note it so
you can remove it later after upgrading to 2.0.6. You could also use the
dependency:analyze mojo to uncover this unused direct dependency.
- Note: Because Maven 2.0.6 fixes the problems this mojo is meant to
detect, it will do nothing in versions of Maven greater than 2.0.5.
-
+ This mojo is also usefull for just detecting projects that override the
dependencyManagement directly. Set ignoreDirect to false to detect these
otherwise normal conditions.
+
This mojo can be executed from the command line:
+---+