You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris <sh...@yahoo.com> on 2011/03/16 21:55:53 UTC

Debugging maven-dependency-plugin

I've having an odd problem with the maven dependency plugin.

I'm using it to copy all the jars upon which my app depends. It's 
copying one particular jar, servlet-api-2.3.jar, which it shouldn't.

How do I figure out *why* it's copying that jar?

I've already tried running mvn dependency:tree from the command line, 
and that particular jar does not show up in the output.

I've also tried to exclude it explicitly using <excludeGroupIds>:

<execution>
   <phase>package</phase>
   <goals>
     <goal>copy-dependencies</goal>
   </goals>
   <configuration>
     <includeScope>compile</includeScope>
     <excludeGroupIds>javax-servlet</excludeGroupIds>
     <outputDirectory>target/lib</outputDirectory>
   </configuration>
</execution>

But it still gets copied.

I also enabled debug output during the maven build, but the dependency 
plugin showed nothing useful.

How do I debug this?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Debugging maven-dependency-plugin

Posted by Chris <sh...@yahoo.com>.
On 3/17/2011 7:48 AM, Marc Rohlfs wrote:
> If can't find useful information in the debug output, it's getting
> somewhat hard to analyse. In the last instance You could try to debug it
> using the IDE:
> 1. Download the sources of the dependency plugin version Your're using
> from the SVN and integrate/import it in Your IDE.
> 2. Set a debug break point at the begining of the execute() method in
> the CopyDependenciesMojo class.
> 3. Start Your build using the command 'mvnDebug' (instead of 'mvn').
> Maven now waits for a remote debugger to connect until it starts the build.
> 4. In Your IDE, start the remote debugger for the
> maven-dependency-plugin project (using port 8000). The execution of the
> Maven build should stop at the break point and You can start debugging ...
>
>
> BTW: I think I have an idea why the servlet-api-2.3.jar isn't excluded
> when copying the dependencies. Try using a dot instead of a dash:
> <excludeGroupIds>javax.servlet</excludeGroupIds>

Excellent -- replacing the dash with a dot did it. Looks like I don't 
have to debug it at all. Though I'm hoping that other mystery jars 
aren't showing up as well...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Debugging maven-dependency-plugin

Posted by Marc Rohlfs <po...@googlemail.com>.
If can't find useful information in the debug output, it's getting 
somewhat hard to analyse. In the last instance You could try to debug it 
using the IDE:
1. Download the sources of the dependency plugin version Your're using 
from the SVN and integrate/import it in Your IDE.
2. Set a debug break point at the begining of the execute() method in 
the CopyDependenciesMojo class.
3. Start Your build using the command 'mvnDebug' (instead of 'mvn'). 
Maven now waits for a remote debugger to connect until it starts the build.
4. In Your IDE, start the remote debugger for the 
maven-dependency-plugin project (using port 8000). The execution of the 
Maven build should stop at the break point and You can start debugging ...


BTW: I think I have an idea why the servlet-api-2.3.jar isn't excluded 
when copying the dependencies. Try using a dot instead of a dash:
<excludeGroupIds>javax.servlet</excludeGroupIds>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org