On 12/08/2011 06:34 AM, Benson Margulies wrote:
In the test case, there's a maven plugin which declares various maven
2 components as provided dependencies, notably the
DefaultArtifactResolver. So, my IDE keeps trying (I think) to show me
the source to the 2.2.1 version even though, since I'm running M3, I'm
using the M3 version.

FWIW - using a NetBeans 7.2 dev build (close to 7.1 RC2), I:

1. Opened the M3 root POM (File > Open Project) so the IDE knows where all the 
submodule projects are.

2. Opened the Maven Embedder module. Accept suggestion to prime.

3. Under File > Project Properties > Run, set Main Class to org.apache.maven.cli.MavenCli, and Arguments to "-f .../pom.xml clean install" for a project using nbm-maven-plugin 3.6 (more or less arbitrarily).

4. Opened sources for nbm-maven-plugin. Accept suggestion to prime. Go to Type on DefaultArtifactResolver offers both the 3.0.x source project version, and the 2.0.6 repository version (since both are in classpath of an open project). Accept the first.

5. Set a breakpoint in the constructor (int threads = ...).

6. Debug Project on Maven Embedder.

7. Breakpoint hit in the correct DefaultArtifactResolver.java. Debug > Step Over shows threads=5 in the Variables view as expected (the 2.0.6 version has no such constructor code).

Alternately, if bundled Maven binary (currently 3.0.3) suffices:

3. [can be skipped but then Step Over will not work] Window > Debugging > Sources with test project selected, Add Source Root, select .../maven-compat/src/main/java/ (will be default filechooser location if DAR.java selected in editor).

6. Right-click test project, Custom > Goals..., "clean install" under Goals, 
jpda.listen=maven (i.e. launch Maven itself inside debugger) under Properties.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to