Re: [osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-22 Thread Timothy Ward
It should be noted that it’s usually a good idea to have a configured resolve 
step performed by the bnd-resolver-maven-plugin. This allows you to do a 
resolve from the command line, and have those changes written back to the 
bndrun file. The resolve step in the export plugin, on the other hand, is best 
combined with the  option enabled. This way you have a 
verification step that runs in every build to ensure that the resolve result is 
sensible, but a manual command that you can run (i.e. not run by CI) used to 
make changes to the checked in source (the bndrun file).

Regards,

Tim


> On 22 Jun 2017, at 16:27, Raymond Auge  wrote:
> 
> I did forget the "resolve" step!
> 
> In the configuration of the maven plugin add:
> 
> true
> 
> - Ray
> 
> On Thu, Jun 22, 2017 at 9:56 AM, Mark Raynsford  > wrote:
> On 2017-06-21T18:32:35 -0400
> Raymond Auge > 
> wrote:
> >
> > 
> 
> 'Ello!
> 
> Thanks for the detailed instructions. I'll give this a go shortly.
> 
> M
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev 
> 
> 
> 
> 
> -- 
> Raymond Augé  (@rotty3000)
> Senior Software Architect Liferay, Inc.  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

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

Re: [osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-22 Thread Raymond Auge
I did forget the "resolve" step!

In the configuration of the maven plugin add:

true

- Ray

On Thu, Jun 22, 2017 at 9:56 AM, Mark Raynsford 
wrote:

> On 2017-06-21T18:32:35 -0400
> Raymond Auge  wrote:
> >
> > 
>
> 'Ello!
>
> Thanks for the detailed instructions. I'll give this a go shortly.
>
> M
>
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-22 Thread Mark Raynsford
On 2017-06-21T18:32:35 -0400
Raymond Auge  wrote:
>
> 

'Ello!

Thanks for the detailed instructions. I'll give this a go shortly.

M


pgplEhBvfRuRv.pgp
Description: OpenPGP digital signature
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-21 Thread Raymond Auge
1) create a new module in your reactor tree

2) add all the top level dependencies you wish to put in your deployment in
this new module's pom (you CAN refer to other maven modules in the reactor
as expected)

3) add this [1] maven repository since some of what you need is provided by
the yet-to-be-released bnd 3.4.0-RC

4) configure the pom with the following bnd-export-maven-plugin [2]:


biz.aQute.bnd
bnd-export-maven-plugin
3.4.0-SNAPSHOT

false

main.bndrun

true




export





5) in `main.bndrun` make sure to populate the property `-runrequires` with
the set of top level bundles your deployment requires which won't
transitively be added purely through resolution of requirements and
capabilities: e.g.

-runrequires: \

osgi.identity;filter:='(osgi.identity=org.apache.aries.cdi.extension.http)',\
  osgi.identity;filter:='(osgi.identity=org.apache.felix.configadmin)',\
  osgi.identity;filter:='(osgi.identity=slf4j.log4j12)'

6) remove the following lines from your main.bndrun:

-standalone:

-plugin.examples.eval = \
 aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
 snapshotUrls=https://oss.sonatype.org/content/repositories/osgi/; \
 releaseUrls=https://repo1.maven.org/maven2/; \
 pom=${.}/pom.xml; \
 name=examples.eval; \
 location=${.}/target/cached.xml

7) execute `mvn bnd-export:export`

8) if resolve fails then you've missed a dependency in the pom, add it and
try 7) again.

All the resolved bundles should be placed in `*${project.build.directory}*`

HTH,
- Ray

[1]
https://bndtools.ci.cloudbees.com/job/bnd.next/599/artifact/dist/bundles/
[2]
https://github.com/bndtools/bnd/tree/master/maven/bnd-export-maven-plugin


On Wed, Jun 21, 2017 at 11:49 AM, Mark Raynsford 
wrote:

> 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/a9f58c11daeba94f5d79878cd23a68
> bef7955195
>
> 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 [ 

[osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-21 Thread Mark Raynsford
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


pgpOTCsagukJI.pgp
Description: OpenPGP digital signature
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev