Dynamic import works perfectly but I'm not too sure what "inline=true" does.
Packaging jar with Maven does not do any difference. I still need to add the
Bundle-ClassPath and Export-Package tags as instructions. Eclipse still fails
to compile without addition of embedded jars in the build path libraries.
The good point is that adding the Eclipse build path and the two tags solve all
the problems.
Do the maven-bundle-plugin also does the reverse, i.e. exports embedded jar to
allow compilation of other bundles (*)?
(*) Case where:
Bundle A (what I do now):
+org (...)
+ lib
+ embedded1.jar <-- exported packages
+ embedded2.jar
+ ...
+ META-INF (...)
+ OSGI-INF
Bundle B:
+ ...
+ META-INF
+ MANIFEST.MF <-- imported packages (of embedded1.jar)
=> Does maven-bundle-plugin allows B to compile?
JP
De : Achim Nierbeck [mailto:[email protected]]
Envoyé : mardi 22 octobre 2013 16:41
À : [email protected]
Objet : Re: maven-bundle-plugin and embedded jar
add this to your Embed-Dependency tag: inline=true
This will make sure all packages are inlined in your bundle, makes it easier
especially since no bundle-classpath is needed.
I was talking of m2e :D
Regarding the dynamic-import just add a
<Dynamic-Import>x.y.z.*</Dynamic-Import>
to make sure your dynamic import range is not the complete classloader ;)
regards, Achim
2013/10/22 CLEMENT Jean-Philippe
<[email protected]<mailto:[email protected]>>
I use Kepler EE which uses m2e - same as m2eclipse?
With the only instruction
<Embed-Dependency>*;scope=compile;type=!pom</Embed-Dependency> the plugin does
not generate any Bundle-Classpath entry in the manifest. The Import-Package
entry is strange as it states a package that is exported and one of the
embedded jars. I'm not too sure how Karaf will react to this.
Moreover, I'm embedding a very old non-osgi code which uses a large amount of
packages. I would like the plugin to generate the DynamicImport-Package entry.
How may I do this?
Thanks again :)
De : Achim Nierbeck
[mailto:[email protected]<mailto:[email protected]>]
Envoyé : mardi 22 octobre 2013 16:05
À : [email protected]<mailto:[email protected]>
Objet : Re: maven-bundle-plugin and embeded jar
yes the export-package needs to be adapted. The bundle-classpath should be
adapted by the plugin/bnd automagically.
Actually if you don't configure any import-package and export-packages it
should export those packages right away.
Sometimes it's safest just to declare which package should be "private" by
private-package and let the plugin do the rest.
If you use the m2eclipse plugin it should work right away with maven and
eclipse.
regards, Achim
2013/10/22 CLEMENT Jean-Philippe
<[email protected]<mailto:[email protected]>>
Maven succeeds !
However, Eclipse fails to compile unless I explicitly set them in the java
build path. Is it normal?
PS: So I guess I have to add the export-package and bundle-classpath tags
accordingly(?)
JP
De : Achim Nierbeck
[mailto:[email protected]<mailto:[email protected]>]
Envoyé : mardi 22 octobre 2013 15:38
À : [email protected]<mailto:[email protected]>
Objet : Re: maven-bundle-plugin and embeded jar
Hi,
usually you should add those as dependencies with maven.
If you have the following in your maven-bundle-plugin configuration those
dependencies are embedded.
<Embed-Dependency>*; scope=compile; type=!pom</Embed-Dependency>
and sometimes also helpfull:
<Embed-Transitive>true</Embed-Transitive>
regards, Achim
2013/10/22 CLEMENT Jean-Philippe
<[email protected]<mailto:[email protected]>>
In some bundles I have to embed jar files. Do jar files need to be added to the
Maven repository or may they directly be used from a resource directory?
JP
De : CLEMENT Jean-Philippe
[mailto:[email protected]<mailto:[email protected]>]
Envoyé : vendredi 18 octobre 2013 16:02
À : [email protected]<mailto:[email protected]>
Objet : RE: maven-bundle-plugin and blueprint
Great, thanks !
JP
De : Achim Nierbeck
[mailto:[email protected]]<mailto:[mailto:[email protected]]>
Envoyé : vendredi 18 octobre 2013 11:49
À : [email protected]<mailto:[email protected]>
Objet : Re: maven-bundle-plugin and blueprint
Hi Jean-Phillippe,
as long as you have a proper maven structure, it should already be included,
you don't need a special tag for the maven-bundle-plugin to do so.
following structure is usually needed for maven built projects:
/src/main/java
/src/main/resources/
/src/test/java
/src/test/resources
just place your blueprint.xml in the /src/main/resources/OSGI-INF/ folder and
it will be inside your jar/bundle and therefore already in the right place to
be picked up by the blueprint-extender.
regards, Achim
2013/10/18 CLEMENT Jean-Philippe
<[email protected]<mailto:[email protected]>>
Dear Karaf Team,
I would like to use Maven (maven-bundle-plugin) as build tool instead of Ant.
What would be the best approach to build blueprint-enabled bundles - which
maven-bundle-plugin tags should I add in the pom in order the blueprint files
to be included in the bundle?
JP
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>