You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thomas Koch <th...@koch.ro> on 2013/03/08 13:48:35 UTC

No mojo definitions were found for plugin

Hi,

I'm working on the Debian package for the maven-plugin-tools. In this package 
we first use a prepared plugin.xml and just copy it into the maven-plugin-
plugin.jar. Then we call the plugin:descriptor goal to actually generate the 
plugin.xml and repackage again afterwards.

But maven doesn't like debian... :-) Do you have any hint where I could start 
to debug? The class files are there in target/classes. Maven is executed in 
the maven-plugin-plugin directory.

[DEBUG]   (f) local = Repository[local|file:///tmp/buildd/maven-plugin-
tools-3.2/debian/tmp/maven-repo/]
[DEBUG]   (f) outputDirectory = /tmp/buildd/maven-plugin-tools-3.2/maven-
plugin-plugin/target/classes/META-INF/maven
[DEBUG]   (f) remoteRepos = [Repository[central|
http://repo1.maven.org/maven2]]
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipDescriptor = false
[DEBUG]   (f) skipErrorNoDescriptorsFound = false
[DEBUG]   (f) project = MavenProject: org.apache.maven.plugins:maven-plugin-
plugin:3.2 @ /tmp/buildd/maven-plugin-tools-3.2/maven-plugin-plugin/pom.xml
[DEBUG] -- end configuration --
[INFO] [plugin:descriptor {execution: default-cli}]
[WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to read mojo 
metadata, i.e. build is platform dependent!
[DEBUG] Using 0 mojo extractors.
[INFO] 
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] 
------------------------------------------------------------------------
[INFO] Error extracting plugin descriptor: 'No mojo definitions were found for 
plugin: org.apache.maven.plugins:maven-plugin-plugin.'

[INFO] 
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error extracting 
plugin descriptor: 'No mojo definitions were found for plugin: 
org.apache.maven.plugins:maven-plugin-plugin.'
	at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
	at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
	at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
	at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
	at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
	at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:100)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error extracting 
plugin descriptor: 'No mojo definitions were found for plugin: 
org.apache.maven.plugins:maven-plugin-plugin.'
	at 
org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:245)
	at 
org.apache.maven.plugin.plugin.DescriptorGeneratorMojo.execute(DescriptorGeneratorMojo.java:92)
	at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
	at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
	... 9 more
Caused by: 
org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException: No mojo 
definitions were found for plugin: org.apache.maven.plugins:maven-plugin-
plugin.
	at 
org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:126)
	at 
org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:233)
	... 12 more


Regards,

Thomas Koch, http://www.koch.ro

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


Re: No mojo definitions were found for plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
On 11 Mar 2013, at 21:28, Thomas Koch wrote:

> Stuart McCulloch:
>> Perhaps you could post a link to your re-packaging build so people can
>> recreate the issue? There's not enough information here to debug the
>> problem remotely.
> 
> http://anonscm.debian.org/gitweb/?p=pkg-java/maven-plugin-
> tools.git;a=tree;hb=refs/heads/update_to_3.2
> 
> The build works as follow:
> 
> - build all modules without maven, with some debian specific ant magic

Unfortunately I don't have a debian system to hand - and despite spending this evening unpacking various deb files I'm unable to get enough of this 'magic' to work to recreate the issue. Far too many hard-coded references to "/usr/share/java/..." in various build files, including some patched class files. If you could provide a tarball of all the packages needed to build so that I could just unpack locally on a non-debian system (without requiring it to be located under "/usr") and invoke a few commands to recreate the issue then that would help immensely.

Since you presumably have a working build for 2.8, I suggest you compare the differences to check what has changed and what might affect the results. Plexus components are found by scanning the runtime classpath for META-INF/plexus/components.xml files, so make sure that you have the various extractor jars on your classpath and those jars have META-INF/plexus/components.xml files that describe their extractors. Also unpack and compare the contents of your patched jars with the ones from Maven which work.

> - call maven-plugin-plugin on itself, see debian/build.xml, target package
> 
> The last step fails. It would already help me a lot if you could give me a 
> hint how I could get some debug logging from plexus to see why it doesn't pick 
> up the available extractor classes.
> 
> Regards,
> 
> Thomas Koch, http://www.koch.ro


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


Re: No mojo definitions were found for plugin

Posted by Thomas Koch <th...@koch.ro>.
Stuart McCulloch:
> Perhaps you could post a link to your re-packaging build so people can
> recreate the issue? There's not enough information here to debug the
> problem remotely.

http://anonscm.debian.org/gitweb/?p=pkg-java/maven-plugin-
tools.git;a=tree;hb=refs/heads/update_to_3.2

The build works as follow:

- build all modules without maven, with some debian specific ant magic
- call maven-plugin-plugin on itself, see debian/build.xml, target package

The last step fails. It would already help me a lot if you could give me a 
hint how I could get some debug logging from plexus to see why it doesn't pick 
up the available extractor classes.

Regards,

Thomas Koch, http://www.koch.ro

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


Re: No mojo definitions were found for plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
On 8 Mar 2013, at 16:54, Thomas Koch wrote:

> Thomas Koch:
>> [DEBUG] Using 0 mojo extractors.
> 
> I could track down the problem. The field "mojoDescriptorExtractors" in  the 
> DefaultMojoScanner class is not filed by plexus with the available extractors 
> although they should be available on the classpath.
> 
> Now I don't know how to debug this issue. Why doesn't plexus find those 
> extractors?

Perhaps you could post a link to your re-packaging build so people can recreate the issue? There's not enough information here to debug the problem remotely.

> Thomas Koch, http://www.koch.ro
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: No mojo definitions were found for plugin

Posted by Thomas Koch <th...@koch.ro>.
Martin Gainty:
> Thomas
> 
> I can see  public DefaultMojoScanner( Map<String, MojoDescriptorExtractor>
> extractors )  in maven-plugin-tools-api v3.2
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.maven.plugin-to
> ols/maven-plugin-tools-api/3.2/org/apache/maven/tools/plugin/scanner/Defaul
> tMojoScanner.java#DefaultMojoScanner Which version of
> maven-plugin-tools-api are you implementing?

Hi Martin,

thank you for replying. I'm packaging version 3.2.

Regards,

Thomas Koch, http://www.koch.ro

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


RE: No mojo definitions were found for plugin

Posted by Martin Gainty <mg...@hotmail.com>.
Thomas

I can see  public DefaultMojoScanner( Map<String, MojoDescriptorExtractor> extractors )  in maven-plugin-tools-api v3.2
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.maven.plugin-tools/maven-plugin-tools-api/3.2/org/apache/maven/tools/plugin/scanner/DefaultMojoScanner.java#DefaultMojoScanner
Which version of maven-plugin-tools-api are you implementing?
Martin ______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

 > From: thomas@koch.ro
> To: users@maven.apache.org
> Subject: Re: No mojo definitions were found for plugin
> Date: Fri, 8 Mar 2013 17:54:27 +0100
> 
> Thomas Koch:
> > [DEBUG] Using 0 mojo extractors.
> 
> I could track down the problem. The field "mojoDescriptorExtractors" in  the 
> DefaultMojoScanner class is not filed by plexus with the available extractors 
> although they should be available on the classpath.
> 
> Now I don't know how to debug this issue. Why doesn't plexus find those 
> extractors?
> 
> Thomas Koch, http://www.koch.ro
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
 		 	   		  

Re: No mojo definitions were found for plugin

Posted by Thomas Koch <th...@koch.ro>.
Thomas Koch:
> [DEBUG] Using 0 mojo extractors.

I could track down the problem. The field "mojoDescriptorExtractors" in  the 
DefaultMojoScanner class is not filed by plexus with the available extractors 
although they should be available on the classpath.

Now I don't know how to debug this issue. Why doesn't plexus find those 
extractors?

Thomas Koch, http://www.koch.ro

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