You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by raner <mi...@raner.ws> on 2009/01/21 20:53:59 UTC

maven-bundle-plugin: Mojo execution failed

Hi,

I'm an Eclipse veteran but a newbie to Maven. I'm trying to set up a
POM-first build of an Eclipse plug-in using the Felix maven-bundle-plugin.
When I trigger a build in my Eclipse workbench I get a
LifecycleExecutionException: Internal error in the plugin manager executing
goal 'org.apache.felix:maven-bundle-plugin:1.4.3:bundle': Mojo execution
failed

The Maven console output is (with debug enabled):

...
1/21/09 10:59:22 AM PST: [DEBUG] Looking up mojo
org.apache.felix:maven-bundle-plugin:1.4.3:bundle in realm
/plugins/org.apache.felix:maven-bundle-plugin:1.4.3@48/thread:Worker-19 -
descRealmId=/plugins/org.apache.felix:maven-bundle-plugin:1.4.3@48/thread:Worker-19
1/21/09 10:59:22 AM PST: [DEBUG] Looked up -
org.apache.felix.bundleplugin.BundlePlugin@fcb501 -
ClassRealm[/plugins/org.apache.felix:maven-bundle-plugin:1.4.3@48/thread:Worker-19,
parent:
ClassRealm[/projects/com.intuit.eclipse.tcr.ui.quickbase:com.intuit.eclipse.tcr.ui.quickbase:0.0.1-SNAPSHOT/thread:Worker-19,
parent: ClassRealm[plexus.core, parent: null]]]
1/21/09 10:59:22 AM PST: [DEBUG] Configuring mojo
'org.apache.felix:maven-bundle-plugin:1.4.3:bundle' with basic configurator
-->
1/21/09 10:59:22 AM PST: [DEBUG]   (f) baseDir =
C:\dev\workspace\com.intuit.eclipse.tcr.ui.quickbase
1/21/09 10:59:22 AM PST: [DEBUG]   (f) buildDirectory =
C:\dev\workspace\com.intuit.eclipse.tcr.ui.quickbase\target
1/21/09 10:59:22 AM PST: [DEBUG]   (f) instructions =
{Bundle-Activator=com.intuit.eclipse.tcr.ui.quickbase.TCRQuickBaseUIPlugin,
Export-Package=com.intuit.eclipse.tcr.ui.quickbase}
1/21/09 10:59:22 AM PST: [DEBUG]   (f) manifestLocation =
C:\dev\workspace\com.intuit.eclipse.tcr.ui.quickbase\META-INF
1/21/09 10:59:22 AM PST: [DEBUG]   (f) outputDirectory =
C:\dev\workspace\com.intuit.eclipse.tcr.ui.quickbase\target\classes
1/21/09 10:59:22 AM PST: [DEBUG]   (f) project = MavenProject:
com.intuit.eclipse.tcr.ui.quickbase:com.intuit.eclipse.tcr.ui.quickbase:0.0.1-SNAPSHOT
@ C:\dev\workspace\com.intuit.eclipse.tcr.ui.quickbase\pom.xml
1/21/09 10:59:22 AM PST: [DEBUG] -- end configuration --
1/21/09 10:59:22 AM PST: [INFO] [bundle:bundle]
1/21/09 10:59:22 AM PST: [DEBUG] Setting context classloader for plugin to:
/plugins/org.apache.felix:maven-bundle-plugin:1.4.3@48/thread:Worker-19
(instance is:
ClassRealm[/plugins/org.apache.felix:maven-bundle-plugin:1.4.3@48/thread:Worker-19,
parent:
ClassRealm[/projects/com.intuit.eclipse.tcr.ui.quickbase:com.intuit.eclipse.tcr.ui.quickbase:0.0.1-SNAPSHOT/thread:Worker-19,
parent: ClassRealm[plexus.core, parent: null]]])
1/21/09 10:59:22 AM PST: Build errors for
com.intuit.eclipse.tcr.ui.quickbase;
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in
the plugin manager executing goal
'org.apache.felix:maven-bundle-plugin:1.4.3:bundle': Mojo execution failed.

The Eclipse project is configured to invoke the 'deploy' goal on project
cleans or resource changes. When I invoke 'mvn deploy' on the command line,
it works just fine:

...
[INFO] [bundle:bundle]
[INFO] [dependency:copy-dependencies {execution: copy-dependencies}]
[INFO] com.intuit.quickbase.api-0.0.1-SNAPSHOT.jar already exists in
destination.
[INFO] com.intuit.tcr-0.0.1-SNAPSHOT.jar already exists in destination.
[INFO] com.intuit.tcr.repository.quickbase-0.0.1-SNAPSHOT.jar already exists
in destination.
[INFO] commons-codec-1.2.jar already exists in destination.
[INFO] commons-httpclient-3.1.jar already exists in destination.
[INFO] commons-logging-1.0.4.jar already exists in destination.
[INFO] [install:install]
...
[INFO] [bundle:deploy]
[INFO] Remote OBR update disabled (enable with -DremoteOBR)
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Wed Jan 21 10:56:43 PST 2009
[INFO] Final Memory: 16M/30M
[INFO]
------------------------------------------------------------------------

So, the problem only occurs when the m2eclipse Maven builder runs, but not
when I invoke mvn manually. Does someone know what this problem could be
about? How can I debug this further? For example, I'd like to know what
"Mojo execution failed" actually refers to; i.e., what is the low-level
exception at the root of this problem? I know about Maven's "-e" option, but
I have no idea how to enable it for m2eclipse's Maven builder.

Thanks for any hints!

Mirko

-- 
View this message in context: http://www.nabble.com/maven-bundle-plugin%3A-Mojo-execution-failed-tp21590942p21590942.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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


Re: maven-bundle-plugin: Mojo execution failed

Posted by Stuart McCulloch <mc...@gmail.com>.
2009/1/22 raner <mi...@raner.ws>

>
> Hm, having a look at the Error Log view wouldn't have been a bad idea...
> Turns out this is the root of the LifecycleExecutionException:
>
> ...
> Caused by: org.apache.maven.plugin.PluginExecutionException: Mojo execution
> failed.
> at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:601)
> at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
> ... 28 more
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error
> calculating
> classpath for project MavenProject:
>
> com.intuit.eclipse.tcr.ui.quickbase:com.intuit.eclipse.tcr.ui.quickbase:0.0.1-SNAPSHOT
> @ C:\dev\workspace\com.intuit.eclipse.tcr.ui.quickbase\pom.xml
> at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:231)
> at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:218)
> at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
> ... 29 more
> Caused by: java.util.zip.ZipException: error in opening zip file
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.<init>(ZipFile.java:203)
> at java.util.zip.ZipFile.<init>(ZipFile.java:234)
> at aQute.lib.osgi.ZipResource.build(ZipResource.java:39)
> at aQute.lib.osgi.ZipResource.build(ZipResource.java:32)
> at aQute.lib.osgi.Jar.<init>(Jar.java:35)
> at
>
> org.apache.felix.bundleplugin.BundlePlugin.getClasspath(BundlePlugin.java:685)
> at
> org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:227)
> ... 31 more
>
> So, I have a stacktrace now, and apparently maven-bundle-plugin is trying
> to
> open some zip file. Please let me know if anybody has any ideas about this.
>

Hi Mirko,

The only time I've seen this exception has been when the JAR or ZIP is
corrupted (which can sometimes happen if Maven is interrupted during
download, or if your network connection is a bit flaky)

However, you also say that exactly the same command works outside of
m2eclipse - which suggests that everything is ok with the build itself, but
for some reason the m2eclipse environment is introducing or uncovering
a bug... although how this causes a ZipException I'm really not sure!

You might want to try the 1.5.0-SNAPSHOT of the bundleplugin available
at http://people.apache.org/repo/m2-snapshot-repository to check if the
problem still exists with the latest code. You can also run with -X to add
more debug output.

If you need additional debug added to the snapshot build let me know.


> Thanks!
>
> P.S.: I also posted to the m2eclipse users group; sorry, if you get this
> twice...
>
> --
> View this message in context:
> http://www.nabble.com/maven-bundle-plugin%3A-Mojo-execution-failed-tp21590942p21592236.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

-- 
Cheers, Stuart

Re: maven-bundle-plugin: Mojo execution failed

Posted by raner <mi...@raner.ws>.
Hm, having a look at the Error Log view wouldn't have been a bad idea...
Turns out this is the root of the LifecycleExecutionException:

...
Caused by: org.apache.maven.plugin.PluginExecutionException: Mojo execution
failed.
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:601)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
... 28 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Error calculating
classpath for project MavenProject:
com.intuit.eclipse.tcr.ui.quickbase:com.intuit.eclipse.tcr.ui.quickbase:0.0.1-SNAPSHOT
@ C:\dev\workspace\com.intuit.eclipse.tcr.ui.quickbase\pom.xml
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:231)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:218)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
... 29 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:203)
at java.util.zip.ZipFile.<init>(ZipFile.java:234)
at aQute.lib.osgi.ZipResource.build(ZipResource.java:39)
at aQute.lib.osgi.ZipResource.build(ZipResource.java:32)
at aQute.lib.osgi.Jar.<init>(Jar.java:35)
at
org.apache.felix.bundleplugin.BundlePlugin.getClasspath(BundlePlugin.java:685)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:227)
... 31 more

So, I have a stacktrace now, and apparently maven-bundle-plugin is trying to
open some zip file. Please let me know if anybody has any ideas about this.

Thanks!

P.S.: I also posted to the m2eclipse users group; sorry, if you get this
twice...

-- 
View this message in context: http://www.nabble.com/maven-bundle-plugin%3A-Mojo-execution-failed-tp21590942p21592236.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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