Hello,
Maven is case sensitive. You need to write :
<iPOJOMetadata>metadata.xml</iPOJOMetadata>
instead of
<ipojoMetadata>metadata.xml</ipojoMetadata>
This file contains your component type description, and created
instances. It is a mandatory file to use iPOJO.
Regards,
Clement
Steven E. Harris a écrit :
I'm attempting to follow the iPOJO tutorial¹ in creating an
iPOJO-managed bundle. Specifically, I'm trying to define a factory
component inside this bundle.
The POM declares a packaging-type of "ipojo-bundle". There's an iPOJO
metadata file called "metadata.xml" available at the root of the JAR's
resource directory.
The plugin configuration element is as follows, using version
0.7.0-incubator-SNAPSHOT of the plugin:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.plugin</artifactId>
<extensions>true</extensions>
<configuration>
<osgiManifest>
<bundleName>${pom.name}</bundleName>
<bundleDescription>${pom.description}</bundleDescription>
<!--<exportPackage></exportPackage>-->
<!--<ipojoMetadata>metadata.xml</ipojoMetadata>-->
</osgiManifest>
</configuration>
</plugin>
I assumed that most of these values would have sensible defaults like
the maven-bundle-plugin. Uncommenting the ipojoMetadata element fails
during "mvn package" with this error:
,----
| org.codehaus.plexus.component.configurator.ComponentConfigurationException:
| Cannot find setter nor field in
| org.apache.felix.ipojo.plugin.OsgiManifest for 'ipojoMetadata'
`----
When I comment that element out and trust the default, I see the
following error:
,----
| org.apache.maven.plugin.MojoExecutionException:
| [iPOJO] Neither iPOJO-Metadata nor iPOJO-Components are in the manifest
`----
In context:
[INFO] [org.apache.felix.ipojo.:ipojo-bundle]
[INFO] Generating JAR bundle <mybundle>.jar
[INFO] No manifest file specified. Default will be used.
[INFO] iPOJO Manipulation ...
[ERROR] Neither iPOJO-Metadata nor iPOJO-Components are in the manifest, please
in the osgi-bundle packaging instead og ipojo-bundle
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error assembling JAR bundle
Embedded error: [iPOJO] Neither iPOJO-Metadata nor iPOJO-Components are in the
manifest
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error assembling JAR
bundle
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error assembling JAR
bundle
at
org.apache.felix.ipojo.plugin.OsgiJarMojo.execute(OsgiJarMojo.java:167)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: org.apache.maven.plugin.MojoExecutionException: [iPOJO] Neither
iPOJO-Metadata nor iPOJO-Components are in the manifest
at
org.apache.felix.ipojo.plugin.OsgiJarMojo.iPojoManipulation(OsgiJarMojo.java:932)
at
org.apache.felix.ipojo.plugin.OsgiJarMojo.performPackaging(OsgiJarMojo.java:207)
at
org.apache.felix.ipojo.plugin.OsgiJarMojo.execute(OsgiJarMojo.java:164)
... 18 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Mar 01 10:33:14 PST 2007
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
Are there some other steps I need to follow to get this to work?
Footnotes:
¹ http://cwiki.apache.org/FELIX/ipojo-tutorial-07.html
--
Clement Escoffier
Grenoble University
LSR - Bat. C
220, Rue de la Chimie
BP 53
38041 GRENOBLE CEDEX 9
04.76.51.40.24
http://clement.plop-plop.net