Hello.

I put together a small project a while back to experiment with various
aspects of OSGi (such as independent module versioning, and producing
a runnable distribution zip containing an OSGi framework and a set of
bundles).

I'm currently using Maven for all of my projects (and have been for
close to ten years), and am currently using the maven-bundle-plugin
to produce OSGi bundles.

  https://github.com/io7m/thoth

The com.io7m.thoth.distribution module solely exists to aggregate
dependencies and to produce a runnable distribution.

I've had various issues creating a runnable distribution of the project,
the latest of which seems to be that the Assembly plugin can't
really seem to do what I'm asking it to do:

  https://issues.apache.org/jira/browse/MASSEMBLY-848

Basically, what I'm trying to do is produce a zip file containing a
specific directory hierarchy. The directory hierarchy contains a set of
Apache Felix bundles (the framework and service implementations), some
configuration files, and the bundles that make up the thoth project. I
don't want to produce a single executable jar; I want to keep all of
the bundles separate so that they can be easily upgraded individually
after deployment.

As the subject of the bnd-maven-export-plugin came up a few hours ago,
I thought I'd try it having never actually used Bnd directly, or any
of the bnd-* Maven plugins. My thinking is that I can get the export
plugin to intelligently decide what bundles are needed, to
intelligently fetch framework bundles, and to dump all of those into a
single directory. I can then use the Assembly plugin to package them up
into the directory layout that I need, and won't need to depend on the
problematic artifact resolution mechanism the Assembly plugin
apparently uses.

I'm following the enRoute runtime tutorial:

  http://enroute.osgi.org/tutorial_eval/380-run.html

Using a somewhat incomplete main.bndrun file, I have something that I
think should effectively not do very much:

  https://github.com/io7m/thoth/commit/a9f58c11daeba94f5d79878cd23a68bef7955195

In other words, unless I'm misunderstanding the documentation, the
export plugin should grab some Felix bundles and put them into the
target directory. It hasn't been asked to do anything else, so it
shouldn't.

Unfortunately, what actually happens is this:

[INFO] --- bnd-export-maven-plugin:3.3.0:export (default) @
com.io7m.thoth.distribution --- [INFO] cached
file:/home/someone/git/com.github/io7m/thoth/com.io7m.thoth.distribution/pom.xml
[INFO] Unlocking url cache
file:/home/someone/git/com.github/io7m/thoth/com.io7m.thoth.distribution/pom.xml
[INFO] cached
https://repo1.maven.org/maven2/com/io7m/thoth/com.io7m.thoth/1.0.0/com.io7m.thoth-1.0.0.pom
[INFO] Proxy handlers [] [INFO] No match for
https://repo1.maven.org/maven2/com/io7m/thoth/com.io7m.thoth/1.0.0/com.io7m.thoth-1.0.0.pom,
handler Server [ match=sonatype-nexus-staging,
basic=BasicAuthentication
[password=*, user=io7m],
https=HttpsVerification [verify=true, certificatesPath=null]] [INFO] No
match for
https://repo1.maven.org/maven2/com/io7m/thoth/com.io7m.thoth/1.0.0/com.io7m.thoth-1.0.0.pom,
handler Server [ match=sonatype-nexus-snapshots,
basic=BasicAuthentication
[password=*, user=io7m],
https=HttpsVerification [verify=true, certificatesPath=null]] [INFO]
set header User-Agent=Bnd [INFO] GET
https://repo1.maven.org/maven2/com/io7m/thoth/com.io7m.thoth/1.0.0/com.io7m.thoth-1.0.0.pom
[INFO] result TaggedData [tag="1fb066da6a67c7c02962f59b4b8cd1ee",
code=404, modified=Wed Aug 10 15:08:35 UTC 2016,
url=https://repo1.maven.org/maven2/com/io7m/thoth/com.io7m.thoth/1.0.0/com.io7m.thoth-1.0.0.pom,
state=NOT_FOUND, msg= 404 Not Found 404 Not Found nginx ] [INFO]
Unlocking url cache
https://repo1.maven.org/maven2/com/io7m/thoth/com.io7m.thoth/1.0.0/com.io7m.thoth-1.0.0.pom

I'm not sure why the plugin is going out to Maven Central to resolve
that particular artifact (the parent POM), and this project is unlikely
to ever be deployed to Maven Central as it's just a toy project for
experimenting with OSGi.

Can I get Bnd to work with the modules in the current Maven reactor?

M

Attachment: pgpOTCsagukJI.pgp
Description: OpenPGP digital signature

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to