You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ilia Sretenskii <sr...@realtimeboard.com> on 2015/04/15 16:57:26 UTC

How to find the artifact version of MavenPluginManager.getConfiguredMojo result in debugger?

I am debugging a module lifecycle in IntelliJ IDEA.
When the debugger stops on some exception breakpoint I see that there
are unknown java classes and their methods in the stack trace.
The classes are returned by the MavenPluginManager.getConfiguredMojo method.
I would like to debug those artifacts but I need to know the exact
versions of their used artifacts because otherwise there will be line
numbers mismatch with their source files.

Whether is there a way to find exactly what artifact version is used
in the Maven livecycle process, especially when the java classes are
returned by the MavenPluginManager.getConfiguredMojo method?

Thanks!
Ilia.

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


Re: How to find the artifact version of MavenPluginManager.getConfiguredMojo result in debugger?

Posted by Ilia Sretenskii <sr...@realtimeboard.com>.
Ah, I think I have already found one method already, myself.

1. The method MavenPluginManager.getConfiguredMojo takes parameter
mojoExecution of type org.apache.maven.plugin.MojoExecution.
2. It has field mojoDescriptor of type
org.apache.maven.plugin.descriptor.MojoDescriptor which extends
org.codehaus.plexus.component.repository.ComponentDescriptor
3. It has field classRealm of type
org.codehaus.plexus.classworlds.realm.ClassRealm
4. It has field id of type String which reads exactly which
groupId:artifactId:version contains that requested class.

Well, is that the correct way to find the mojo artifact version?
Is there a better way for that?

On Wed, Apr 15, 2015 at 7:57 PM, Ilia Sretenskii
<sr...@realtimeboard.com> wrote:
> I am debugging a module lifecycle in IntelliJ IDEA.
> When the debugger stops on some exception breakpoint I see that there
> are unknown java classes and their methods in the stack trace.
> The classes are returned by the MavenPluginManager.getConfiguredMojo method.
> I would like to debug those artifacts but I need to know the exact
> versions of their used artifacts because otherwise there will be line
> numbers mismatch with their source files.
>
> Whether is there a way to find exactly what artifact version is used
> in the Maven livecycle process, especially when the java classes are
> returned by the MavenPluginManager.getConfiguredMojo method?
>
> Thanks!
> Ilia.

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