yes, that would be great to improve the doc
notice I don't know of any dependency analyzer, then didn't use the feature, I
just imagined the scenario without really trying to use it effectively :)
The idea is to add a dependency to the plugin to an artifact with a custom
analyzer, which has a specific Plexus role-hint: the parameter needs to be
configured with this role-hint
Then here is the result:
<plugin>
<groupId>org.apache.maven.plugin</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>my.analyzer.groupId</groupId>
<artifactId>my-analyzer</artifactId>
<version></version>
</dependency>
</dependencies>
<configuration>
<analyzer>my-role</analyzer>
</configuration>
</plugin>
Notice this is for CLI usage, ie analyze and analyze-only goals.
For report, there are multiple issues:
- there is no dependency in pom.xml: should the dependency be added to m-site-
p? I don't really master the classloading scenario between m-site-p and
reports
- the parameter hasn't been defined in the analyze-report goal/report
MDEP-262 clearly didn't work on this scenario
Regards,
Hervé
Le mercredi 24 octobre 2012 15:35:58 Benson Margulies a écrit :
> Hervé:
>
> Sorry to mess this up. Can you supply me with a way to use this
> parameter from a POM, so that I could add documentation? The doc that
> was in there fooled me into thinking that this was one of those
> inject-an-implementation situations, not a real configurable
> parameter.
>
> --benson
>
> On Wed, Oct 24, 2012 at 1:20 PM, Hervé BOUTEMY <[email protected]>
wrote:
> >> Add missing 'read only' flag to internal injection parameter
> >
> > no it's not missing at all, it's a configuration needed when user wants to
> > use another dependency analyzer thatn the default one
> > Notice this is a feature and Jira issue I discovered when using blame on
> > code, and I don't know any dependency analyzer other than default...
> >
> > Regards
> >
> > Hervé
> >
> > Le mercredi 24 octobre 2012 11:49:10 [email protected] a écrit :
> >> Author: bimargulies
> >> Date: Wed Oct 24 11:49:09 2012
> >> New Revision: 1401631
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1401631&view=rev
> >> Log:
> >> (no jira): Add missing 'read only' flag to internal injection parameter;
> >> add example of report.
> >>
> >> Modified:
> >>
> >> maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/mave
> >> n/
> >> plugin/dependency/AbstractAnalyzeMojo.java
> >> maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt.vm
> >>
> >> Modified:
> >> maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/mave
> >> n/
> >> plugin/dependency/AbstractAnalyzeMojo.java URL:
> >> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/
> >> sr
> >> c/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java?r
> >> ev= 1401631&r1=1401630&r2=1401631&view=diff
> >> =========================================================================
> >> ==
> >> === ---
> >> maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/mave
> >> n/
> >> plugin/dependency/AbstractAnalyzeMojo.java (original) +++
> >> maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/mave
> >> n/
> >> plugin/dependency/AbstractAnalyzeMojo.java Wed Oct 24 11:49:09 2012 @@
> >> -19,6 +19,10 @@ package org.apache.maven.plugin.dependen
> >>
> >> * under the License.
> >> */
> >>
> >> +import java.io.File;
> >> +import java.io.StringWriter;
> >> +import java.util.Set;
> >> +
> >>
> >> import org.apache.commons.lang.StringUtils;
> >> import org.apache.maven.artifact.Artifact;
> >> import org.apache.maven.plugin.AbstractMojo;
> >>
> >> @@ -37,10 +41,6 @@ import org.codehaus.plexus.context.Conte
> >>
> >> import
> >>
> >> org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
> >> import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
> >>
> >> -import java.io.File;
> >> -import java.io.StringWriter;
> >> -import java.util.Set;
> >> -
> >>
> >> /**
> >>
> >> * Analyzes the dependencies of this project and determines which are:
> >> used
> >>
> >> and declared; used and undeclared; unused * and declared.
> >> @@ -73,7 +73,7 @@ public abstract class AbstractAnalyzeMoj
> >>
> >> *
> >> * @since 2.2
> >> */
> >>
> >> - @Parameter( property = "analyzer", defaultValue = "default" )
> >> + @Parameter( property = "analyzer", defaultValue = "default",
> >> readonly = true) private String analyzer;
> >>
> >> /**
> >>
> >> Modified:
> >> maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt.vm
> >> URL:
> >> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/
> >> sr
> >> c/site/apt/usage.apt.vm?rev=1401631&r1=1401630&r2=1401631&view=diff
> >> =========================================================================
> >> ==
> >> === ---
> >> maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt.vm
> >> (original) +++
> >> maven/plugins/trunk/maven-dependency-plugin/src/site/apt/usage.apt.vm Wed
> >> Oct 24 11:49:09 2012 @@ -676,3 +676,25 @@ mvn dependency:get
> >> -DgroupId=org.apache.
> >>
> >> mvn dependency:get
> >> -Dartifact=org.apache.maven:maven-core:2.2.1:jar:sources
> >>
> >> -DremoteRepositories=http://repo1.maven.apache.org/maven2
> >> -Ddest=/tmp/myfile.jar +-----+
> >>
> >> +* The <<<dependency:analyze-report>>> Reporting Plugin
> >> +
> >> + This mojo is used to include a report of the dependencies in the
> >> output
> >> of the <<<maven-site-plugin>>>. +
> >> ++-------+
> >> + <reporting>
> >> + <plugins>
> >> + ...
> >> + <plugin>
> >> + <artifactId>maven-dependency-plugin</artifactId>
> >> + <version>2.5.1</version>
> >> + <reportSets>
> >> + <reportSet>
> >> + <reports>
> >> + <report>analyze-report</report>
> >> + </reports>
> >> + </reportSet>
> >> + </reportSets>
> >> + </plugin>
> >> + </plugins>
> >> + </reporting>
> >> ++-------+
> >> \ No newline at end of file
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]