Quantcast

Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
https://docs.sonatype.org/display/Nexus/Nexus+OSGi+Experimental+Features+-+P2+Repository+Plugin

"How does it work?
As soon as an OSGi bundle gets deployed to a Nexus Maven repository,
P2 metadata will be automatically generated and stored alongside the
bundle using classifiers."

What about bundles that already exist, can I force generation of the metadata?
When I browse our repo via
https://nexus..../nexus/content/repositories/releases/.meta/p2/ its
empty.

I've tried re-uploading the bundles to a new GAV, but the .meta/p2 is
still empty.

Guidance most welcome.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Mirko Swillus
Am 04.04.2012 02:19, schrieb Barrie Treloar:

> What about bundles that already exist, can I force generation of the metadata?

There is a dedicated task for this. You have to add one:

Administration/Scheduled Tasks/Add/

Task Type: Rebuild P2 metadata

Afterwards you can run this task and the metadata for the repositories
OSGi artifacts should be generated (look for the p2Artifacts.xml and
p2Content.xml beside the artifacts).

To aggregate these metadata to the p2 repository within .meta/p2, you
have to add a another task of type "Rebuild P2 repository" and run this
as well.

Regards,
Mirko
____________________________________________________________________

[ M i r k o  S w i l l u s ]

    Software Development

    Qualitype AG
    Quality Management Systems | Bioinformatics
    Moritzburger Weg 67 | 01109 Dresden
    fon +49.351.8838 2813 | fax +49.351.8838 2809
    e-mail: [hidden email] | http://www.qualitype.de

    Sitz der Gesellschaft: Dresden | Amtsgericht Dresden HRB 19830
    Vorstand: Dr. Wilhelm Zörgiebel | Dr. Frank Götz
    Aufsichtsratsvorsitz: Prof. Dr. Gerhard P. Fettweis
____________________________________________________________________

The information in this email and any attachments is confidential and is
intended for the addressee only. If you are not the intended recipient,
please delete this message and any attachments and advise the sender by
return email.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
On Wed, Apr 4, 2012 at 4:35 PM, Mirko Swillus <[hidden email]> wrote:

> Am 04.04.2012 02:19, schrieb Barrie Treloar:
>> What about bundles that already exist, can I force generation of the
>> metadata?
> There is a dedicated task for this. You have to add one:
>
> Administration/Scheduled Tasks/Add/
>
> Task Type: Rebuild P2 metadata
>
> Afterwards you can run this task and the metadata for the repositories OSGi
> artifacts should be generated (look for the p2Artifacts.xml and
> p2Content.xml beside the artifacts).
>
> To aggregate these metadata to the p2 repository within .meta/p2, you have
> to add a another task of type "Rebuild P2 repository" and run this as well.

Thanks Mirko,
Is this documented somewhere?

I've been googling, reading the nexus wiki and the 3.0.2 nexus book
and I haven't found it so far - which is more likely a fault on my
part.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
In reply to this post by Mirko Swillus
On Wed, Apr 4, 2012 at 4:35 PM, Mirko Swillus <[hidden email]> wrote:
> Task Type: Rebuild P2 metadata
>
> Afterwards you can run this task and the metadata for the repositories OSGi
> artifacts should be generated (look for the p2Artifacts.xml and
> p2Content.xml beside the artifacts).

So, I'm adding comments to the
https://docs.sonatype.org/display/Nexus/Nexus+OSGi+Experimental+Features+-+P2+Repository+Plugin
page with these notes.

From what I can understand, I should only need to manually run this
once to backfill any OSGi artifacts in the repository.
Any future ones will get created automatically from the plugins installed.

> To aggregate these metadata to the p2 repository within .meta/p2, you have
> to add a another task of type "Rebuild P2 repository" and run this as well.

I'm not sure whether this task needs to be done just once, or whether
it will also be done automatically.
Any guidance?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Jeff MAURY

I will suggest to run it daily

Jeff

Le 4 avr. 2012 09:31, "Barrie Treloar" <[hidden email]> a écrit :
On Wed, Apr 4, 2012 at 4:35 PM, Mirko Swillus <[hidden email]> wrote:
> Task Type: Rebuild P2 metadata
>
> Afterwards you can run this task and the metadata for the repositories OSGi
> artifacts should be generated (look for the p2Artifacts.xml and
> p2Content.xml beside the artifacts).

So, I'm adding comments to the
https://docs.sonatype.org/display/Nexus/Nexus+OSGi+Experimental+Features+-+P2+Repository+Plugin
page with these notes.

From what I can understand, I should only need to manually run this
once to backfill any OSGi artifacts in the repository.
Any future ones will get created automatically from the plugins installed.

> To aggregate these metadata to the p2 repository within .meta/p2, you have
> to add a another task of type "Rebuild P2 repository" and run this as well.

I'm not sure whether this task needs to be done just once, or whether
it will also be done automatically.
Any guidance?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
In reply to this post by Mirko Swillus
On Wed, Apr 4, 2012 at 4:35 PM, Mirko Swillus <[hidden email]> wrote:

> Rebuild P2 metadata
> Rebuild P2 repository

Ok, I have run these.

When I browse to
https://nexus.../nexus/content/repositories/releases/.meta/p2/ it is
empty.
But the storage contains artifacts.xml and contents.xml which look
well populated.
And the plugins/ directory correctly contains my bundles.

Suggestions on what else I have forgotten are most welcome.

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Jeff MAURY

What's missing ?
Features are not supported yet

Jeff

Le 4 avr. 2012 09:48, "Barrie Treloar" <[hidden email]> a écrit :
On Wed, Apr 4, 2012 at 4:35 PM, Mirko Swillus <[hidden email]> wrote:

> Rebuild P2 metadata
> Rebuild P2 repository

Ok, I have run these.

When I browse to
https://nexus.../nexus/content/repositories/releases/.meta/p2/ it is
empty.
But the storage contains artifacts.xml and contents.xml which look
well populated.
And the plugins/ directory correctly contains my bundles.

Suggestions on what else I have forgotten are most welcome.

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
In reply to this post by Barrie Treloar
On Wed, Apr 4, 2012 at 5:18 PM, Barrie Treloar <[hidden email]> wrote:

> On Wed, Apr 4, 2012 at 4:35 PM, Mirko Swillus <[hidden email]> wrote:
>
>> Rebuild P2 metadata
>> Rebuild P2 repository
>
> Ok, I have run these.
>
> When I browse to
> https://nexus.../nexus/content/repositories/releases/.meta/p2/ it is
> empty.

I'm trying to create an Eclipse Target Platform with this P2 repo.
I know that its a valid P2 repo because giving it any other URL causes
Eclipse to says its not a valid P2 repo.
So I thought I would try requesting the artifacts.xml file via the
brower on the assumption that Nexus is not allowing me to browse the
P2 repo much like the Eclipse site does.
Yay! I get back a valid artifacts.xml file.

I remember seeing notes about having to manually add bundles to the
*.target file yourself because the GUI is sucky.
I did that for the local copy I create with the FeaturesAndBundles Export.

However I couldn't even start to create the http repo via the GUI
because there are not bundles to seed the files definition.
With nothing to loose, I cut and paste a previous location, change the
URL and specified my bundles and voila! I can see the plugins I
wanted.

My next mission, should I choose to accept it, is to get Tycho working
on this beast.

Thanks for the help.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

masa
Barrie Treloar <baerrach@...> writes:

>
> On Wed, Apr 4, 2012 at 5:18 PM, Barrie Treloar <baerrach@...> wrote:
> > On Wed, Apr 4, 2012 at 4:35 PM, Mirko Swillus <m.swillus@...> wrote:
> >
> >> Rebuild P2 metadata
> >> Rebuild P2 repository
> >
> > Ok, I have run these.
> >
> > When I browse to
> > https://nexus.../nexus/content/repositories/releases/.meta/p2/ it is
> > empty.
>
> I'm trying to create an Eclipse Target Platform with this P2 repo.
> I know that its a valid P2 repo because giving it any other URL causes
> Eclipse to says its not a valid P2 repo.
> So I thought I would try requesting the artifacts.xml file via the
> brower on the assumption that Nexus is not allowing me to browse the
> P2 repo much like the Eclipse site does.
> Yay! I get back a valid artifacts.xml file.
>
> I remember seeing notes about having to manually add bundles to the
> *.target file yourself because the GUI is sucky.
> I did that for the local copy I create with the FeaturesAndBundles Export.
>
> However I couldn't even start to create the http repo via the GUI
> because there are not bundles to seed the files definition.
> With nothing to loose, I cut and paste a previous location, change the
> URL and specified my bundles and voila! I can see the plugins I
> wanted.
>
> My next mission, should I choose to accept it, is to get Tycho working
> on this beast.
>
> Thanks for the help.
>

Hi Barrie,

I have the same problem that the .../.meta/p2/ directory is empty and was
wondering if you were able to fix the problem.  I wasn't sure what you meant
when you wrote " With nothing to loose, I cut and paste a previous location,
change the URL and specified my bundles and voila! I can see the plugins I
wanted."  Any help is appreciated.

Thanks in advance,

Masa


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
> I have the same problem that the .../.meta/p2/ directory is empty and was
> wondering if you were able to fix the problem.  I wasn't sure what you meant
> when you wrote " With nothing to loose, I cut and paste a previous location,
> change the URL and specified my bundles and voila! I can see the plugins I
> wanted."  Any help is appreciated.
>
> Thanks in advance,

Yup, I can see that its not clear.

I know that Nexus is exposing the URL as a valid p2 repository because
I can use my browser at the URL and I get a valid response (instead of
an error page).
The valid response is just an "Index of" page for that location, which
is empty because the p2 repository is not browsable via a web browser.
If I request the URLs http://<nexus_url>/.meta/p2/artifacts.xml or
http://<nexus_url>/.meta/p2/content.xml I get back valid p2 files, and
I can see what the experimental plugins think should be in my p2
repository.
I know this is the URL because I looked at the raw storage for the
nexus repository and saw these file names (I dont know p2 at all so
I'm having to investigate and make assumptions to test things out)

So now that I know I've got a valid p2 repository, how do I create a
*.target file for use by Tycho (and also by Eclipse)?
This is where I say "With nothing to loose, I cut and paste a previous
location" and the bit about "I remember seeing notes about having to
manually add bundles to the
*.target file yourself because the GUI is sucky."
The Eclipse editor for *.target file is junk, so you need to open this
file as a Text File in Eclipse.

That *.target file already had a location that pointed to a Nexus
Proxy of an Eclipse Orbit repository, which I created using the GUI.
It looked like this:

<location includeAllPlatforms="false" includeMode="slicer"
includeSource="true" type="InstallableUnit">
<unit id="javax.xml" version="1.3.4.v201005080400"/>
<repository location="http://nexus..../nexus/content/repositories/eclipse-orbit-R20120119162704/"/>
</location>

I'm not sure why the Nexus Experimental P2 repo doesn't work with the
*.target editor.
It could very well be because I'm clueless and was doing something wrong.
However other googling found me the comment noted above about manually
adding bubdles.
So with nothing to lose, I bravely cut-and-pasted this location and
pointed it at the Experimental P2 repository stuff
<location includeAllPlatforms="false" includeMode="slicer"
includeSource="true" type="InstallableUnit">
<unit id="....geocode" version="15.0.1"/>
<unit id="....mapping" version="14.0.1"/>
<unit id="com.springsource.org.apache.commons.io" version="1.4.0"/>
<repository location="http://nexus..../nexus/content/repositories/releases/.meta/p2"/>
</location>

I also have the Eclipse Indigo P2 repository proxied in Nexus, so I
also included:

<location includeAllPlatforms="false" includeMode="slicer"
includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rcp.feature.group" version="0.0.0" />
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0" />
<unit id="org.junit" version="0.0.0"/>
<repository location="http://nexus..../nexus/content/repositories/eclipse-indigo/"/>
</location>

This is a good example of how to include a feature.  Features have a
suffix of ".feature.group" after the feature name.  This is an
implementation detail that I didn't know about.  I stumbled across the
Eclipse documentation later that explained it all.

So hopefully that helps with your problem.
I'm assuming that:
* its empty because its non-web browsable
* that if you try grabbing the artifacts.xml and content.xml that they
correctly include your bundles. If they dont have you created and run
the Nexus Tasks "Rebuild P2 metadata" and "Rebuild P2 repository"?
* you can set Eclipse to use your *.target file as the default target
and it will resolve everything correctly and display in the GUI screen
all the values you manually entered via the Text Editor.  If you have
typos you will get errors.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

masa

Thank you for your very quick response and it was very helpful.  I have been
googling everything and anything I could find and I was always getting about 90%
of what I needed.  I believe I should be able to push forward now.  I was
contemplating a pom first approach but I should not have to anymore.  I have
successfully built RCP applications with tycho before but I was always manually
generating the update site through eclipse that I referenced within my target-
definition portion of my tycho build.  Now it should all work together better
but I am sure I'll have other issues along the way.  Thanks again.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
On Fri, Jun 8, 2012 at 3:18 AM, masa <[hidden email]> wrote:
>
> Thank you for your very quick response and it was very helpful.  I have been
> googling everything and anything I could find and I was always getting about 90%
> of what I needed.  I believe I should be able to push forward now.  I was
> contemplating a pom first approach but I should not have to anymore.  I have
> successfully built RCP applications with tycho before but I was always manually
> generating the update site through eclipse that I referenced within my target-
> definition portion of my tycho build.  Now it should all work together better
> but I am sure I'll have other issues along the way.  Thanks again.

Well then your experience may also help me.

I'm at the stage where I am trying to remove embedding my plugin's dependencies.
But there are a couple of dependencies that refer to SNAPSHOTs of the
current build.

The whole point of doing this is to avoid the current pain of manually
editing .classpath, build.properties, MANIFEST.MF to refer to the
release versions, and then doing that again to refer to the next
SNAPSHOT version.

But at the moment my *.target is point to Nexus and not a local file
system, so I am not sure how/whether this approach will work.  I'm
hoping Tycho is smart enough to know to resolve the dependencies from
the reactor first before looking at the *.target.

It would be beneficial if you could take my notes and enhance them
into something on the wiki.

I've been contemplating building another tycho example that builds a
more complex RCP application to show how to solve this problem.  But
I've got enough on my hands at work and just don't have the time (or
proper knowledge) to do that yet.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

masa
Barrie Treloar <baerrach@...> writes:

>
> On Fri, Jun 8, 2012 at 3:18 AM, masa <masa.ebisawa@...> wrote:
> >
> > Thank you for your very quick response and it was very helpful.  I have been
> > googling everything and anything I could find and I was always getting about
90%
> > of what I needed.  I believe I should be able to push forward now.  I was
> > contemplating a pom first approach but I should not have to anymore.  I have
> > successfully built RCP applications with tycho before but I was always
manually
> > generating the update site through eclipse that I referenced within my
target-
> > definition portion of my tycho build.  Now it should all work together
better
> > but I am sure I'll have other issues along the way.  Thanks again.
>
> Well then your experience may also help me.
>
> I'm at the stage where I am trying to remove embedding my plugin's
dependencies.

> But there are a couple of dependencies that refer to SNAPSHOTs of the
> current build.
>
> The whole point of doing this is to avoid the current pain of manually
> editing .classpath, build.properties, MANIFEST.MF to refer to the
> release versions, and then doing that again to refer to the next
> SNAPSHOT version.
>
> But at the moment my *.target is point to Nexus and not a local file
> system, so I am not sure how/whether this approach will work.  I'm
> hoping Tycho is smart enough to know to resolve the dependencies from
> the reactor first before looking at the *.target.
>
> It would be beneficial if you could take my notes and enhance them
> into something on the wiki.
>
> I've been contemplating building another tycho example that builds a
> more complex RCP application to show how to solve this problem.  But
> I've got enough on my hands at work and just don't have the time (or
> proper knowledge) to do that yet.
>

I may need to get some more information from you.  I have had to build RCP app
and osgi plugins using different methods.  I have used maven-bundle-plugin when
I want to embed the dependencies (none bundle jars) from the pom along with the
bundle it self.  My RCP app right now is structured exactly like the RCP tycho
demo.  When tycho gets the dependencies from nexus or where ever it will then
put it in $USER_HOME/.m2/repository/p2/....  If you don't want to build the
dependency and reference it within your RCP build then you can always replace
the jars under there.  I guess I am not sure what you need.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
On Fri, Jun 8, 2012 at 1:46 PM, masa <[hidden email]> wrote:
[del]
> I guess I am not sure what you need.

That's my problem too, I dont know what i need.
I'm slowly transitioning the embedded libraries by leeching the ones
from jboss and re-deploying them into our Internal Nexus so that the
p2 metadata gets generated.
This saves me the step of using maven-bundle-plugin to wrap these myself.
I should only have a few weird dependencies left that I will need to wrap.

This then leave dependencies that are from the project currently being built.
I'm not sure how Ecalipse (via the *.target file) is going to resolve
them since it will require them being available at the Nexus Proxy,
which obviously does not have my latest changes.
I'm not sure what Tycho does in the scenario.

Once I get up to this step, I will find out.
That's why a more complicated RCP application as a demo would be a
useful contribution.

If I'm lucky and everything just works, that will be the end of it.
If (as I suspect) it is not going to work out, then it will make sense
for me to spend some time investigating a more complicated RCP demo as
at least Tycho developers can have a look at it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

masa

From the eclipse stand point if you have the dependency project within the same
workspace then it will usually try to use that instead of the one on nexus.  
When you do the run configuration from eclipse and go to the plugin tab you can
always specify the dependencies you want to run with directly.  I am going to be
working on my tycho project tomorrow and this weekend so if I get anywhere I'll
try to let you know or see if I can contribute in any way.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
On Fri, Jun 8, 2012 at 2:27 PM, masa <[hidden email]> wrote:
>
> From the eclipse stand point if you have the dependency project within the same
> workspace then it will usually try to use that instead of the one on nexus.
> When you do the run configuration from eclipse and go to the plugin tab you can
> always specify the dependencies you want to run with directly.  I am going to be
> working on my tycho project tomorrow and this weekend so if I get anywhere I'll
> try to let you know or see if I can contribute in any way.

I have one Eclipse RCP Plugin, which requires 3 other project related bundles.
They are just plain OSGi projects (or will be when I convert them) so
I am not sure that Eclipse will know to use them.
I will soon find out.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

masa
Within eclipse:
1: I created an osgi bundle project.
2: I created a RCP application project that
depended on the osgi bundleproject.
3: I created a feature project for my application.
4: I created a plain project with the product configuration.  
Everything went fine.  

For my tycho build I will just refer to the
osgi bundle from the nexus p2 repository.
 
What do you think?  Am I missing something?



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
In reply to this post by Barrie Treloar
On Fri, Jun 8, 2012 at 2:01 PM, Barrie Treloar <[hidden email]> wrote:
> That's my problem too, I dont know what i need.
> I'm slowly transitioning the embedded libraries by leeching the ones
> from jboss and re-deploying them into our Internal Nexus so that the
> p2 metadata gets generated.
> This saves me the step of using maven-bundle-plugin to wrap these myself.
> I should only have a few weird dependencies left that I will need to wrap.

I didn't use JBoss, I have used instead SpringSource Enterprise Bundle
Repository (EBR) at http://ebr.springsource.com/repository/app/

This probably belongs over on Tycho, but I'll probably write a wiki
page instead.

This is what I did.

I created a new folder "EBR to Nexus/P2" with a pom that just copies
the dependencies (and their poms) usigin maven-dependency-plugin.
I will use the "EBR to Nexus/P2" pom to automate the downloading of
the artifacts (and any transitive dependencies) so I can manually
upload these into Nexus to generate P2 metadata.

I manually scanned through each dependency in my RCP Plugin pom.xml
and checked EBR for an equivalent OSGi-fied version.

Sidebar:
This looks like a dumbed down repository manager.  Is there anyone at
Sonatype talking to SpringSource about getting them a decent
repository manager, one with Experimental Plugin enabled :)
This would save me work.
I'll start a new thread with this question.

If I found a match in the EBR, I copied the dependency stanza into the
"EBR to Nexus/P2"
I then ran "mvn process-resources" (as that's the phase I attached
maven-dependency-plugin to) to get the OSGi artifacts.
In Nexus I created a separate repository to publish these artifacts
into, making sure I had enabled the "P2 Metadata Generator capability"
and "P2 Repository Aggregator capability" on that repository.
I uploaded the OSGi artifact and its pom to this repository.

I can now delete the depedency from my RCP Plugin pom.xml, delete the
entry in .classpath referencing the embedded artifact
("lib/<artifact>.jar"), and remove it from the build.properties.
The *.target file can be updated with a new location that points to
the .meta/p2 for the above repository and add a new unit referencing
the artifact just deployed.
After remembering to click the "Set as Target Platform" button so the
dependency cache is rebuilt, I can edit the RCP Plugin's MANIFEST.MF
to include as a dependency the artifact.
Now Eclipse and Tycho will build my app using the newly installed OSGi
bundles with P2 metadata from Nexus.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does OSGi Experimental feature generaete P2 Metadata for existing bundles (i.e. already deployed)?

Barrie Treloar
On Wed, Jun 13, 2012 at 2:47 PM, Barrie Treloar <[hidden email]> wrote:

> On Fri, Jun 8, 2012 at 2:01 PM, Barrie Treloar <[hidden email]> wrote:
>> That's my problem too, I dont know what i need.
>> I'm slowly transitioning the embedded libraries by leeching the ones
>> from jboss and re-deploying them into our Internal Nexus so that the
>> p2 metadata gets generated.
>> This saves me the step of using maven-bundle-plugin to wrap these myself.
>> I should only have a few weird dependencies left that I will need to wrap.
>
> I didn't use JBoss, I have used instead SpringSource Enterprise Bundle
> Repository (EBR) at http://ebr.springsource.com/repository/app/
>
> This probably belongs over on Tycho, but I'll probably write a wiki
> page instead.
>
> This is what I did.
>
> I created a new folder "EBR to Nexus/P2" with a pom that just copies
> the dependencies (and their poms) usigin maven-dependency-plugin.
> I will use the "EBR to Nexus/P2" pom to automate the downloading of
> the artifacts (and any transitive dependencies) so I can manually
> upload these into Nexus to generate P2 metadata.
>
> I manually scanned through each dependency in my RCP Plugin pom.xml
> and checked EBR for an equivalent OSGi-fied version.
>
> Sidebar:
> This looks like a dumbed down repository manager.  Is there anyone at
> Sonatype talking to SpringSource about getting them a decent
> repository manager, one with Experimental Plugin enabled :)
> This would save me work.
> I'll start a new thread with this question.
>
> If I found a match in the EBR, I copied the dependency stanza into the
> "EBR to Nexus/P2"
> I then ran "mvn process-resources" (as that's the phase I attached
> maven-dependency-plugin to) to get the OSGi artifacts.
> In Nexus I created a separate repository to publish these artifacts
> into, making sure I had enabled the "P2 Metadata Generator capability"
> and "P2 Repository Aggregator capability" on that repository.
> I uploaded the OSGi artifact and its pom to this repository.
>
> I can now delete the depedency from my RCP Plugin pom.xml, delete the
> entry in .classpath referencing the embedded artifact
> ("lib/<artifact>.jar"), and remove it from the build.properties.
> The *.target file can be updated with a new location that points to
> the .meta/p2 for the above repository and add a new unit referencing
> the artifact just deployed.
> After remembering to click the "Set as Target Platform" button so the
> dependency cache is rebuilt, I can edit the RCP Plugin's MANIFEST.MF
> to include as a dependency the artifact.
> Now Eclipse and Tycho will build my app using the newly installed OSGi
> bundles with P2 metadata from Nexus.

And dont forget to delete the MANIFEST.MF Bundle-ClassPath entry.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...