Discussion:
Need info about mirroring maven artifacts in a p2 mirror with Nexus
(too old to reply)
David M. Karr
2016-03-08 17:53:51 UTC
Permalink
A while ago, I asked questions in here (and other channels) about my
Eclipse plugin build, using Tycho, which was "hard-storing" some maven
artifacts in the project instead of specifying them "declaratively". I
tried for quite a while to figure out how to specify them as Maven
dependencies, but I never got it to work.

I started to understand that the only way to get this to work was to be
able to access those artifacts in a p2 repository, so I can specify
those dependencies in my target platform. The administrator of the
Nexus server that I use has been working on this, but he's telling me
that the artifacts mirrored in this repository have to be OSGi bundles.
A "plain" Maven artifact jar won't work.

I'm now understanding that it's straightforward to "augment" an existing
Maven artifact with the appropriate META-INF/MANIFEST.MF file to have it
be recognized and properly used as an OSGi bundle. This can be done at
build time with the "maven-bundle-plugin", but Nexus also has the
ability (I don't know the details yet) to semi-automatically add
manifest info to artifacts so they can be used in a p2 repo.

However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to make
them usable in an Eclipse plugin build as repository targets in a target
platform specification?
Dirk Fauth
2016-03-08 18:16:40 UTC
Permalink
Not quite sure what you mean. But you can add maven dependencies to your
Tycho build using pomDependecies=consider. But yes they need to be osgi
bundles.

I wrote about that some time ago. Maybe that helps.

http://blog.vogella.com/2013/01/03/tycho-advanced/
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about my
Eclipse plugin build, using Tycho, which was "hard-storing" some maven
artifacts in the project instead of specifying them "declaratively". I
tried for quite a while to figure out how to specify them as Maven
dependencies, but I never got it to work.
I started to understand that the only way to get this to work was to be
able to access those artifacts in a p2 repository, so I can specify those
dependencies in my target platform. The administrator of the Nexus server
that I use has been working on this, but he's telling me that the artifacts
mirrored in this repository have to be OSGi bundles. A "plain" Maven
artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an existing
Maven artifact with the appropriate META-INF/MANIFEST.MF file to have it be
recognized and properly used as an OSGi bundle. This can be done at build
time with the "maven-bundle-plugin", but Nexus also has the ability (I
don't know the details yet) to semi-automatically add manifest info to
artifacts so they can be used in a p2 repo.
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to make them
usable in an Eclipse plugin build as repository targets in a target
platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
David M. Karr
2016-03-08 18:35:12 UTC
Permalink
Post by Dirk Fauth
Not quite sure what you mean. But you can add maven dependencies to
your Tycho build using pomDependecies=consider. But yes they need to
be osgi bundles.
I wrote about that some time ago. Maybe that helps.
http://blog.vogella.com/2013/01/03/tycho-advanced/
Ah, right. That is likely why this wasn't working before (or at least
one of the reasons).
Post by Dirk Fauth
Am 08.03.2016 18:54 schrieb "David M. Karr"
A while ago, I asked questions in here (and other channels) about
my Eclipse plugin build, using Tycho, which was "hard-storing"
some maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was
to be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working on
this, but he's telling me that the artifacts mirrored in this
repository have to be OSGi bundles. A "plain" Maven artifact jar
won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-INF/MANIFEST.MF
file to have it be recognized and properly used as an OSGi
bundle. This can be done at build time with the
"maven-bundle-plugin", but Nexus also has the ability (I don't
know the details yet) to semi-automatically add manifest info to
artifacts so they can be used in a p2 repo.
However, I'm also hearing that even if the artifact is a valid
OSGi bundle, it won't properly work in a p2 repo unless it can
somehow see "features". What do I have to do to plain Maven
artifact jars to make them usable in an Eclipse plugin build as
repository targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Tom Bryan (tombry)
2016-03-08 18:28:50 UTC
Permalink
I don't remember your original use case, but is the problem you're hitting
similar to this user's situation?
http://stackoverflow.com/questions/35346113/using-third-party-libraries-in-
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of affairs
and the problem bridging between Eclipse and Tycho on one hand and normal
Maven artifacts and dependencies on the other.

The problem is that even if you could automatically convert a JAR to an
Eclipse plug-in and add it to the Maven repository, you're still going to
have to reference that specific plug-in in your Eclipse plug-in that uses
that library, right? Are you just hoping to create some automation that
follows the Maven dependency tree for some specific artifact and then
creates an equivalent set of Eclipse "library plug-ins" with the correct
transitive references? Once you do that, your developers will still need
all of those plug-ins in their local development environments, right?

Tycho is great for handling Eclipse bundles, but as soon as you try to
include a complex third party (JAR) library into your RCP application,
you hit this problem. It would be great if Tycho users could help
articulate what a workable solution would look like. That way, maybe
someone can solve that problem so that we don't have a bunch of different
software teams having to work around this disconnect between the Maven
world and the Eclipse-tycho world.

---Tom
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about my
Eclipse plugin build, using Tycho, which was "hard-storing" some maven
artifacts in the project instead of specifying them "declaratively". I
tried for quite a while to figure out how to specify them as Maven
dependencies, but I never got it to work.
I started to understand that the only way to get this to work was to be
able to access those artifacts in a p2 repository, so I can specify
those dependencies in my target platform. The administrator of the
Nexus server that I use has been working on this, but he's telling me
that the artifacts mirrored in this repository have to be OSGi bundles.
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an existing
Maven artifact with the appropriate META-INF/MANIFEST.MF file to have it
be recognized and properly used as an OSGi bundle. This can be done at
build time with the "maven-bundle-plugin", but Nexus also has the
ability (I don't know the details yet) to semi-automatically add
manifest info to artifacts so they can be used in a p2 repo.
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to make
them usable in an Eclipse plugin build as repository targets in a target
platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
David M. Karr
2016-03-08 18:48:51 UTC
Permalink
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're hitting
similar to this user's situation?
http://stackoverflow.com/questions/35346113/using-third-party-libraries-in-
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of affairs
and the problem bridging between Eclipse and Tycho on one hand and normal
Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.

The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove them
from the project itself and replace them with some sort of declarative
dependencies, as I can't store jars in our git repo (it's a project
policy, but I agree with it).
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to an
Eclipse plug-in and add it to the Maven repository, you're still going to
have to reference that specific plug-in in your Eclipse plug-in that uses
that library, right? Are you just hoping to create some automation that
follows the Maven dependency tree for some specific artifact and then
creates an equivalent set of Eclipse "library plug-ins" with the correct
transitive references? Once you do that, your developers will still need
all of those plug-ins in their local development environments, right?
I had assumed that once the jars I need are properly OSGi-configured
into the Nexus p2 repo, I can specify that repo in my target platform,
along with the dependencies I need, and then my code will be able to use
those classes.

Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try to
include a complex third party (JAR) library into your RCP application,
you hit this problem. It would be great if Tycho users could help
articulate what a workable solution would look like. That way, maybe
someone can solve that problem so that we don't have a bunch of different
software teams having to work around this disconnect between the Maven
world and the Eclipse-tycho world.
---Tom
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about my
Eclipse plugin build, using Tycho, which was "hard-storing" some maven
artifacts in the project instead of specifying them "declaratively". I
tried for quite a while to figure out how to specify them as Maven
dependencies, but I never got it to work.
I started to understand that the only way to get this to work was to be
able to access those artifacts in a p2 repository, so I can specify
those dependencies in my target platform. The administrator of the
Nexus server that I use has been working on this, but he's telling me
that the artifacts mirrored in this repository have to be OSGi bundles.
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an existing
Maven artifact with the appropriate META-INF/MANIFEST.MF file to have it
be recognized and properly used as an OSGi bundle. This can be done at
build time with the "maven-bundle-plugin", but Nexus also has the
ability (I don't know the details yet) to semi-automatically add
manifest info to artifacts so they can be used in a p2 repo.
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to make
them usable in an Eclipse plugin build as repository targets in a target
platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Dirk Fauth
2016-03-08 19:09:45 UTC
Permalink
A target platform only works with p2 repositories in conjunction with Tycho.
Post by David M. Karr
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're hitting
similar to this user's situation?
http://stackoverflow.com/questions/35346113/using-third-party-libraries-in-
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of affairs
and the problem bridging between Eclipse and Tycho on one hand and normal
Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove them
from the project itself and replace them with some sort of declarative
dependencies, as I can't store jars in our git repo (it's a project policy,
but I agree with it).
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to an
Eclipse plug-in and add it to the Maven repository, you're still going to
have to reference that specific plug-in in your Eclipse plug-in that uses
that library, right? Are you just hoping to create some automation that
follows the Maven dependency tree for some specific artifact and then
creates an equivalent set of Eclipse "library plug-ins" with the correct
transitive references? Once you do that, your developers will still need
all of those plug-ins in their local development environments, right?
I had assumed that once the jars I need are properly OSGi-configured into
the Nexus p2 repo, I can specify that repo in my target platform, along
with the dependencies I need, and then my code will be able to use those
classes.
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try to
include a complex third party (JAR) library into your RCP application,
you hit this problem. It would be great if Tycho users could help
articulate what a workable solution would look like. That way, maybe
someone can solve that problem so that we don't have a bunch of different
software teams having to work around this disconnect between the Maven
world and the Eclipse-tycho world.
---Tom
A while ago, I asked questions in here (and other channels) about my
Post by David M. Karr
Eclipse plugin build, using Tycho, which was "hard-storing" some maven
artifacts in the project instead of specifying them "declaratively". I
tried for quite a while to figure out how to specify them as Maven
dependencies, but I never got it to work.
I started to understand that the only way to get this to work was to be
able to access those artifacts in a p2 repository, so I can specify
those dependencies in my target platform. The administrator of the
Nexus server that I use has been working on this, but he's telling me
that the artifacts mirrored in this repository have to be OSGi bundles.
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an existing
Maven artifact with the appropriate META-INF/MANIFEST.MF file to have it
be recognized and properly used as an OSGi bundle. This can be done at
build time with the "maven-bundle-plugin", but Nexus also has the
ability (I don't know the details yet) to semi-automatically add
manifest info to artifacts so they can be used in a p2 repo.
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to make
them usable in an Eclipse plugin build as repository targets in a target
platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
David M. Karr
2016-03-08 19:16:58 UTC
Permalink
Post by Dirk Fauth
A target platform only works with p2 repositories in conjunction with Tycho.
Yes, I figured that. My build uses Tycho. Are you trying to make some
other point that is not obvious to me?
Post by Dirk Fauth
Am 08.03.2016 19:49 schrieb "David M. Karr"
I don't remember your original use case, but is the problem you're hitting
similar to this user's situation?
http://stackoverflow.com/questions/35346113/using-third-party-libraries-in-
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of affairs
and the problem bridging between Eclipse and Tycho on one hand and normal
Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove
them from the project itself and replace them with some sort of
declarative dependencies, as I can't store jars in our git repo
(it's a project policy, but I agree with it).
The problem is that even if you could automatically convert a JAR to an
Eclipse plug-in and add it to the Maven repository, you're still going to
have to reference that specific plug-in in your Eclipse plug-in that uses
that library, right? Are you just hoping to create some automation that
follows the Maven dependency tree for some specific artifact and then
creates an equivalent set of Eclipse "library plug-ins" with the correct
transitive references? Once you do that, your developers will still need
all of those plug-ins in their local development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that repo in
my target platform, along with the dependencies I need, and then
my code will be able to use those classes.
Is there anything else I need?
Tycho is great for handling Eclipse bundles, but as soon as you try to
include a complex third party (JAR) library into your RCP application,
you hit this problem. It would be great if Tycho users could help
articulate what a workable solution would look like. That way, maybe
someone can solve that problem so that we don't have a bunch of different
software teams having to work around this disconnect between the Maven
world and the Eclipse-tycho world.
---Tom
A while ago, I asked questions in here (and other
channels) about my
Eclipse plugin build, using Tycho, which was
"hard-storing" some maven
artifacts in the project instead of specifying them
"declaratively". I
tried for quite a while to figure out how to specify them as Maven
dependencies, but I never got it to work.
I started to understand that the only way to get this to
work was to be
able to access those artifacts in a p2 repository, so I can specify
those dependencies in my target platform. The
administrator of the
Nexus server that I use has been working on this, but he's
telling me
that the artifacts mirrored in this repository have to be
OSGi bundles.
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to
"augment" an existing
Maven artifact with the appropriate META-INF/MANIFEST.MF
file to have it
be recognized and properly used as an OSGi bundle. This
can be done at
build time with the "maven-bundle-plugin", but Nexus also has the
ability (I don't know the details yet) to
semi-automatically add
manifest info to artifacts so they can be used in a p2 repo.
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can
somehow see
"features". What do I have to do to plain Maven artifact
jars to make
them usable in an Eclipse plugin build as repository
targets in a target
platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password,
or unsubscribe
Post by David M. Karr
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Dirk Fauth
2016-03-08 20:08:47 UTC
Permalink
I understood your last question as "how to add a non-osgi jar to my target
platform" which is not possible. So either you are searching some
workarounds to dynamically making that non-osgi jar an osgi bundle, which
is nothing I would suggest. Or you make the jar an osgi bundle by adding
the osgi meta-data. This can be done using the maven-bundle-plugin which
you already mentioned. But then you need to deploy it somewhere. And I am
not familiar with Maven Nexus. If that is possible and Nexus is also able
to provide a p2 repo, go that way. In our company we are working with
Artifactory where this works in the newest version.

The other way is to either include that jar in your bundle or even create a
bundle from an existing jar
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Fproject_wizards%2Fplugin_from_archives.htm
and include that into your build. That would be the least complicated
solution.
Post by Dirk Fauth
A target platform only works with p2 repositories in conjunction with Tycho.
Yes, I figured that. My build uses Tycho. Are you trying to make some
other point that is not obvious to me?
Post by David M. Karr
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're hitting
similar to this user's situation?
http://stackoverflow.com/questions/35346113/using-third-party-libraries-in-
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of affairs
and the problem bridging between Eclipse and Tycho on one hand and normal
Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove them
from the project itself and replace them with some sort of declarative
dependencies, as I can't store jars in our git repo (it's a project policy,
but I agree with it).
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to an
Eclipse plug-in and add it to the Maven repository, you're still going to
have to reference that specific plug-in in your Eclipse plug-in that uses
that library, right? Are you just hoping to create some automation that
follows the Maven dependency tree for some specific artifact and then
creates an equivalent set of Eclipse "library plug-ins" with the correct
transitive references? Once you do that, your developers will still need
all of those plug-ins in their local development environments, right?
I had assumed that once the jars I need are properly OSGi-configured into
the Nexus p2 repo, I can specify that repo in my target platform, along
with the dependencies I need, and then my code will be able to use those
classes.
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try to
include a complex third party (JAR) library into your RCP application,
you hit this problem. It would be great if Tycho users could help
articulate what a workable solution would look like. That way, maybe
someone can solve that problem so that we don't have a bunch of different
software teams having to work around this disconnect between the Maven
world and the Eclipse-tycho world.
---Tom
A while ago, I asked questions in here (and other channels) about my
Post by David M. Karr
Eclipse plugin build, using Tycho, which was "hard-storing" some maven
artifacts in the project instead of specifying them "declaratively". I
tried for quite a while to figure out how to specify them as Maven
dependencies, but I never got it to work.
I started to understand that the only way to get this to work was to be
able to access those artifacts in a p2 repository, so I can specify
those dependencies in my target platform. The administrator of the
Nexus server that I use has been working on this, but he's telling me
that the artifacts mirrored in this repository have to be OSGi bundles.
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an existing
Maven artifact with the appropriate META-INF/MANIFEST.MF file to have it
be recognized and properly used as an OSGi bundle. This can be done at
build time with the "maven-bundle-plugin", but Nexus also has the
ability (I don't know the details yet) to semi-automatically add
manifest info to artifacts so they can be used in a p2 repo.
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to make
them usable in an Eclipse plugin build as repository targets in a target
platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
To change your delivery options, retrieve your password, or unsubscribe from this list, visithttps://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Justin Georgeson
2016-03-08 19:20:55 UTC
Permalink
You could use the maven-dependency-plugin to dynamically pull those dependencies from a standard M2 repo, and then package them into your bundle jar with a Bundle-Classpath header to include those extra jar files. This also requires setting Eclipse-BundleShape header to "dir" in your manifest so your plugin is extracted into a folder when installed into a product.

The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of an OSGi compliant bundle or feature jar. It reads the metadata in the jar files and publishes them to a P2 repo inside the Maven repo. It doesn't support extra p2.inf requirements though (at least it didn't in my case), and the bug I field was closed as WONTFIX because that functionality was only beta and the comment implied a big internal rewrite that would obviate it. However they wouldn't provide any further information.

To use pomDependencies=consider the dependencies in the Maven repo have to already be OSGi bundle jars. You can have a separate Maven project which depends on the non-OSGI jar, uses bundle-maven-plugin to produce an OSGi version, 'mvn deploy' that, and then your eclipse-plugin project can list the modified version as a standard maven pom dependency in conjunction with pomDependencies=consider. There is no transitive resolution of these dependencies, and you'll still have to list the dependency in your manifest too.
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're
hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
Post by Tom Bryan (tombry)
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of
affairs and the problem bridging between Eclipse and Tycho on one hand
and normal Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and references
them in the classpath in the manifest. I need to remove them from the
project itself and replace them with some sort of declarative dependencies,
as I can't store jars in our git repo (it's a project policy, but I agree with it).
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to
an Eclipse plug-in and add it to the Maven repository, you're still
going to have to reference that specific plug-in in your Eclipse
plug-in that uses that library, right? Are you just hoping to create
some automation that follows the Maven dependency tree for some
specific artifact and then creates an equivalent set of Eclipse
"library plug-ins" with the correct transitive references? Once you
do that, your developers will still need all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly OSGi-configured into
the Nexus p2 repo, I can specify that repo in my target platform, along with
the dependencies I need, and then my code will be able to use those classes.
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try to
include a complex third party (JAR) library into your RCP application,
you hit this problem. It would be great if Tycho users could help
articulate what a workable solution would look like. That way, maybe
someone can solve that problem so that we don't have a bunch of
different software teams having to work around this disconnect between
the Maven world and the Eclipse-tycho world.
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about my
Eclipse plugin build, using Tycho, which was "hard-storing" some
maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was to
be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The administrator
of the Nexus server that I use has been working on this, but he's
telling me that the artifacts mirrored in this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-INF/MANIFEST.MF
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin", but
Nexus also has the ability (I don't know the details yet) to
semi-automatically add manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to
make them usable in an Eclipse plugin build as repository targets in
a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.org_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
David M. Karr
2016-03-08 19:24:20 UTC
Permalink
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those dependencies from a standard M2 repo, and then package them into your bundle jar with a Bundle-Classpath header to include those extra jar files. This also requires setting Eclipse-BundleShape header to "dir" in your manifest so your plugin is extracted into a folder when installed into a product.
I've heard of this option before, but I've never fully understood the
details well enough to move forward with it. Are there existing simple
(but complete) examples that I can reference for this?
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of an OSGi compliant bundle or feature jar. It reads the metadata in the jar files and publishes them to a P2 repo inside the Maven repo. It doesn't support extra p2.inf requirements though (at least it didn't in my case), and the bug I field was closed as WONTFIX because that functionality was only beta and the comment implied a big internal rewrite that would obviate it. However they wouldn't provide any further information.
To use pomDependencies=consider the dependencies in the Maven repo have to already be OSGi bundle jars. You can have a separate Maven project which depends on the non-OSGI jar, uses bundle-maven-plugin to produce an OSGi version, 'mvn deploy' that, and then your eclipse-plugin project can list the modified version as a standard maven pom dependency in conjunction with pomDependencies=consider. There is no transitive resolution of these dependencies, and you'll still have to list the dependency in your manifest too.
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're
hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
Post by Tom Bryan (tombry)
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of
affairs and the problem bridging between Eclipse and Tycho on one hand
and normal Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and references
them in the classpath in the manifest. I need to remove them from the
project itself and replace them with some sort of declarative dependencies,
as I can't store jars in our git repo (it's a project policy, but I agree with it).
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to
an Eclipse plug-in and add it to the Maven repository, you're still
going to have to reference that specific plug-in in your Eclipse
plug-in that uses that library, right? Are you just hoping to create
some automation that follows the Maven dependency tree for some
specific artifact and then creates an equivalent set of Eclipse
"library plug-ins" with the correct transitive references? Once you
do that, your developers will still need all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly OSGi-configured into
the Nexus p2 repo, I can specify that repo in my target platform, along with
the dependencies I need, and then my code will be able to use those classes.
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try to
include a complex third party (JAR) library into your RCP application,
you hit this problem. It would be great if Tycho users could help
articulate what a workable solution would look like. That way, maybe
someone can solve that problem so that we don't have a bunch of
different software teams having to work around this disconnect between
the Maven world and the Eclipse-tycho world.
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about my
Eclipse plugin build, using Tycho, which was "hard-storing" some
maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was to
be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The administrator
of the Nexus server that I use has been working on this, but he's
telling me that the artifacts mirrored in this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-INF/MANIFEST.MF
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin", but
Nexus also has the ability (I don't know the details yet) to
semi-automatically add manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow see
"features". What do I have to do to plain Maven artifact jars to
make them usable in an Eclipse plugin build as repository targets in
a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.org_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Justin Georgeson
2016-03-08 19:36:45 UTC
Permalink
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into your
bundle jar with a Bundle-Classpath header to include those extra jar files.
This also requires setting Eclipse-BundleShape header to "dir" in your
manifest so your plugin is extracted into a folder when installed into a
product.
I've heard of this option before, but I've never fully understood the details
well enough to move forward with it. Are there existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is documented here

http://wiki.osgi.org/wiki/Bundle-ClassPath

The dependency plugin I would suggest using the copy goal

https://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html
https://maven.apache.org/plugins/maven-dependency-plugin/usage.html

Put all the jar files in a folder like "libs", at the root instead of the target folder. This is because of how the bin.includes entries in the build.properties file are handled. In the bin.includes property you'll need to include the "libs" folder. Then in your Manifest you can have something like 'Bundle-Classpath: libs/*' and 'Eclipse-Bundle-Shape: dir'.

Your bundle jar should end up with the "libs" folder at the root, and P2 will install your bundle as an expanded folder instead of the jar file. It needs to be expanded for the jar file(s) in the "libs" folder to be loaded at runtime when the bundle is started.
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in the jar files
and publishes them to a P2 repo inside the Maven repo. It doesn't support
extra p2.inf requirements though (at least it didn't in my case), and the bug I
field was closed as WONTFIX because that functionality was only beta and
the comment implied a big internal rewrite that would obviate it. However
they wouldn't provide any further information.
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven repo
have to already be OSGi bundle jars. You can have a separate Maven project
which depends on the non-OSGI jar, uses bundle-maven-plugin to produce
an OSGi version, 'mvn deploy' that, and then your eclipse-plugin project can
list the modified version as a standard maven pom dependency in
conjunction with pomDependencies=consider. There is no transitive
resolution of these dependencies, and you'll still have to list the dependency
in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're
hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
Post by Tom Bryan (tombry)
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of
affairs and the problem bridging between Eclipse and Tycho on one
hand and normal Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove
them from the project itself and replace them with some sort of
declarative dependencies, as I can't store jars in our git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to
an Eclipse plug-in and add it to the Maven repository, you're still
going to have to reference that specific plug-in in your Eclipse
plug-in that uses that library, right? Are you just hoping to
create some automation that follows the Maven dependency tree for
some specific artifact and then creates an equivalent set of Eclipse
"library plug-ins" with the correct transitive references? Once you
do that, your developers will still need all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly OSGi-configured
into the Nexus p2 repo, I can specify that repo in my target
platform, along with the dependencies I need, and then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try
to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho users
could help articulate what a workable solution would look like.
That way, maybe someone can solve that problem so that we don't have
a bunch of different software teams having to work around this
disconnect between the Maven world and the Eclipse-tycho world.
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about
my Eclipse plugin build, using Tycho, which was "hard-storing" some
maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was
to be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working on
this, but he's telling me that the artifacts mirrored in this
repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-INF/MANIFEST.MF
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin", but
Nexus also has the ability (I don't know the details yet) to
semi-automatically add manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow
see "features". What do I have to do to plain Maven artifact jars
to make them usable in an Eclipse plugin build as repository
targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.or
g_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
&e=
David M. Karr
2016-03-08 22:42:06 UTC
Permalink
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into your
bundle jar with a Bundle-Classpath header to include those extra jar files.
This also requires setting Eclipse-BundleShape header to "dir" in your
manifest so your plugin is extracted into a folder when installed into a
product.
I've heard of this option before, but I've never fully understood the details
well enough to move forward with it. Are there existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is documented here
http://wiki.osgi.org/wiki/Bundle-ClassPath
The dependency plugin I would suggest using the copy goal
https://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html
https://maven.apache.org/plugins/maven-dependency-plugin/usage.html
Put all the jar files in a folder like "libs", at the root instead of the target folder. This is because of how the bin.includes entries in the build.properties file are handled. In the bin.includes property you'll need to include the "libs" folder. Then in your Manifest you can have something like 'Bundle-Classpath: libs/*' and 'Eclipse-Bundle-Shape: dir'.
Your bundle jar should end up with the "libs" folder at the root, and P2 will install your bundle as an expanded folder instead of the jar file. It needs to be expanded for the jar file(s) in the "libs" folder to be loaded at runtime when the bundle is started.
My first attempt at this seemed to work fine, although I forgot to do
the "Eclipse-Bundle-Shape" thing. I did some simple testing, and it
seemed to work fine. Does this mean I never tested anything that
required those jars? That seems hard to believe, as I went through some
pretty core features.

I then added the property to the manifest and built it again, and I
don't see any difference in the structure of the plugin jar, but I did
verify that that property is set in the resulting plugin jar in the
update site.

I assume I'll need to configure the "maven-clean-plugin" to remove the
"libs" directory, to ensure this is cleaned up when necessary?
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in the jar files
and publishes them to a P2 repo inside the Maven repo. It doesn't support
extra p2.inf requirements though (at least it didn't in my case), and the bug I
field was closed as WONTFIX because that functionality was only beta and
the comment implied a big internal rewrite that would obviate it. However
they wouldn't provide any further information.
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven repo
have to already be OSGi bundle jars. You can have a separate Maven project
which depends on the non-OSGI jar, uses bundle-maven-plugin to produce
an OSGi version, 'mvn deploy' that, and then your eclipse-plugin project can
list the modified version as a standard maven pom dependency in
conjunction with pomDependencies=consider. There is no transitive
resolution of these dependencies, and you'll still have to list the dependency
in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're
hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
Post by Tom Bryan (tombry)
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of
affairs and the problem bridging between Eclipse and Tycho on one
hand and normal Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove
them from the project itself and replace them with some sort of
declarative dependencies, as I can't store jars in our git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to
an Eclipse plug-in and add it to the Maven repository, you're still
going to have to reference that specific plug-in in your Eclipse
plug-in that uses that library, right? Are you just hoping to
create some automation that follows the Maven dependency tree for
some specific artifact and then creates an equivalent set of Eclipse
"library plug-ins" with the correct transitive references? Once you
do that, your developers will still need all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly OSGi-configured
into the Nexus p2 repo, I can specify that repo in my target
platform, along with the dependencies I need, and then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try
to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho users
could help articulate what a workable solution would look like.
That way, maybe someone can solve that problem so that we don't have
a bunch of different software teams having to work around this
disconnect between the Maven world and the Eclipse-tycho world.
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about
my Eclipse plugin build, using Tycho, which was "hard-storing" some
maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was
to be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working on
this, but he's telling me that the artifacts mirrored in this
repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-INF/MANIFEST.MF
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin", but
Nexus also has the ability (I don't know the details yet) to
semi-automatically add manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow
see "features". What do I have to do to plain Maven artifact jars
to make them usable in an Eclipse plugin build as repository
targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.or
g_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
David M. Karr
2016-03-09 15:05:01 UTC
Permalink
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into your
bundle jar with a Bundle-Classpath header to include those extra jar files.
This also requires setting Eclipse-BundleShape header to "dir" in your
manifest so your plugin is extracted into a folder when installed into a
product.
I've heard of this option before, but I've never fully understood the details
well enough to move forward with it. Are there existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is documented here
http://wiki.osgi.org/wiki/Bundle-ClassPath
The dependency plugin I would suggest using the copy goal
https://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html
https://maven.apache.org/plugins/maven-dependency-plugin/usage.html
Put all the jar files in a folder like "libs", at the root instead of the target folder. This is because of how the bin.includes entries in the build.properties file are handled. In the bin.includes property you'll need to include the "libs" folder. Then in your Manifest you can have something like 'Bundle-Classpath: libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for
"Eclipse-Bundle-Shape", I could use some additional clarification on the
need to put this "libs" folder outside of the "target" folder. You
indicate this is because of how "bin.includes" works, but I'd
appreciate a full explanation.
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will install your bundle as an expanded folder instead of the jar file. It needs to be expanded for the jar file(s) in the "libs" folder to be loaded at runtime when the bundle is started.
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in the jar files
and publishes them to a P2 repo inside the Maven repo. It doesn't support
extra p2.inf requirements though (at least it didn't in my case), and the bug I
field was closed as WONTFIX because that functionality was only beta and
the comment implied a big internal rewrite that would obviate it. However
they wouldn't provide any further information.
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven repo
have to already be OSGi bundle jars. You can have a separate Maven project
which depends on the non-OSGI jar, uses bundle-maven-plugin to produce
an OSGi version, 'mvn deploy' that, and then your eclipse-plugin project can
list the modified version as a standard maven pom dependency in
conjunction with pomDependencies=consider. There is no transitive
resolution of these dependencies, and you'll still have to list the dependency
in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're
hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
Post by Tom Bryan (tombry)
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of
affairs and the problem bridging between Eclipse and Tycho on one
hand and normal Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove
them from the project itself and replace them with some sort of
declarative dependencies, as I can't store jars in our git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR to
an Eclipse plug-in and add it to the Maven repository, you're still
going to have to reference that specific plug-in in your Eclipse
plug-in that uses that library, right? Are you just hoping to
create some automation that follows the Maven dependency tree for
some specific artifact and then creates an equivalent set of Eclipse
"library plug-ins" with the correct transitive references? Once you
do that, your developers will still need all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly OSGi-configured
into the Nexus p2 repo, I can specify that repo in my target
platform, along with the dependencies I need, and then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you try
to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho users
could help articulate what a workable solution would look like.
That way, maybe someone can solve that problem so that we don't have
a bunch of different software teams having to work around this
disconnect between the Maven world and the Eclipse-tycho world.
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about
my Eclipse plugin build, using Tycho, which was "hard-storing" some
maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was
to be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working on
this, but he's telling me that the artifacts mirrored in this
repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-INF/MANIFEST.MF
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin", but
Nexus also has the ability (I don't know the details yet) to
semi-automatically add manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid OSGi
bundle, it won't properly work in a p2 repo unless it can somehow
see "features". What do I have to do to plain Maven artifact jars
to make them usable in an Eclipse plugin build as repository
targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.or
g_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Justin Georgeson
2016-03-09 15:51:05 UTC
Permalink
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into your
bundle jar with a Bundle-Classpath header to include those extra jar files.
This also requires setting Eclipse-BundleShape header to "dir" in
your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully understood the
details well enough to move forward with it. Are there existing
simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org_wiki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root instead of the target
folder. This is because of how the bin.includes entries in the build.properties
file are handled. In the bin.includes property you'll need to include the "libs"
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for "Eclipse-
Bundle-Shape", I could use some additional clarification on the need to put
this "libs" folder outside of the "target" folder. You indicate this is because of
how "bin.includes" works, but I'd appreciate a full explanation.
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar into a product, it should expand the contents. You build produces a jar, your software site holds it as a jar, but at runtime (open Eclipse IDE, Help -> Install New Software, install your feature) it will be a folder instead of jar (${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of ${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).

http://eclipsesource.com/blogs/2009/01/20/tip-eclipse-bundleshape/

In regards to the bin.includes, with the exception of the compiled classes (the '.' in bin.includes) I believe all the other entries are relative to ${project.basedir}. So if you put the jar files in target/libs and added "target/libs" to your bin.includes, your bundle will have "target/libs" instead of "libs".
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file. It needs to
be expanded for the jar file(s) in the "libs" folder to be loaded at runtime
when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in the
jar files and publishes them to a P2 repo inside the Maven repo. It
doesn't support extra p2.inf requirements though (at least it didn't
in my case), and the bug I field was closed as WONTFIX because that
functionality was only beta and the comment implied a big internal
rewrite that would obviate it. However they wouldn't provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate Maven
project which depends on the non-OSGI jar, uses bundle-maven-plugin
to produce an OSGi version, 'mvn deploy' that, and then your
eclipse-plugin project can list the modified version as a standard
maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and you'll
still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're
hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
Post by Tom Bryan (tombry)
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of
affairs and the problem bridging between Eclipse and Tycho on one
hand and normal Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove
them from the project itself and replace them with some sort of
declarative dependencies, as I can't store jars in our git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR
to an Eclipse plug-in and add it to the Maven repository, you're
still going to have to reference that specific plug-in in your
Eclipse plug-in that uses that library, right? Are you just
hoping to create some automation that follows the Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an equivalent set
of Eclipse "library plug-ins" with the correct transitive
references? Once you do that, your developers will still need all
of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that repo in
my target platform, along with the dependencies I need, and then my
code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you
try to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho
users could help articulate what a workable solution would look like.
That way, maybe someone can solve that problem so that we don't
have a bunch of different software teams having to work around
this disconnect between the Maven world and the Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about
my Eclipse plugin build, using Tycho, which was "hard-storing"
some maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was
to be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working on
this, but he's telling me that the artifacts mirrored in this
repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin",
but Nexus also has the ability (I don't know the details yet) to
semi-automatically add manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid
OSGi bundle, it won't properly work in a p2 repo unless it can
somehow see "features". What do I have to do to plain Maven
artifact jars to make them usable in an Eclipse plugin build as
repository targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Fv2fmKIE&e=
David M. Karr
2016-03-09 18:56:29 UTC
Permalink
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into your
bundle jar with a Bundle-Classpath header to include those extra jar files.
This also requires setting Eclipse-BundleShape header to "dir" in
your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully understood the
details well enough to move forward with it. Are there existing
simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org_wiki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root instead of the target
folder. This is because of how the bin.includes entries in the build.properties
file are handled. In the bin.includes property you'll need to include the "libs"
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for "Eclipse-
Bundle-Shape", I could use some additional clarification on the need to put
this "libs" folder outside of the "target" folder. You indicate this is because of
how "bin.includes" works, but I'd appreciate a full explanation.
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar into a product, it should expand the contents. You build produces a jar, your software site holds it as a jar, but at runtime (open Eclipse IDE, Help -> Install New Software, install your feature) it will be a folder instead of jar (${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of ${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).
http://eclipsesource.com/blogs/2009/01/20/tip-eclipse-bundleshape/
In regards to the bin.includes, with the exception of the compiled classes (the '.' in bin.includes) I believe all the other entries are relative to ${project.basedir}. So if you put the jar files in target/libs and added "target/libs" to your bin.includes, your bundle will have "target/libs" instead of "libs".
Well, ok, but I still have no understanding of why these things matter.

For Eclipse-Bundle-Shape, I first built and installed it without it, and
I saw no obvious issues, and then I did the same with that property, and
the only difference I saw was seeing that property set in the manifest.
What is the actual impact of setting or not setting that property?

Similarly, for the location of where the jars are copied to, why does it
matter that my "bin.includes" will have "target/libs" instead of "libs"?
Is the point that that former path will not exist at runtime?
Post by Justin Georgeson
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file. It needs to
be expanded for the jar file(s) in the "libs" folder to be loaded at runtime
when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in the
jar files and publishes them to a P2 repo inside the Maven repo. It
doesn't support extra p2.inf requirements though (at least it didn't
in my case), and the bug I field was closed as WONTFIX because that
functionality was only beta and the comment implied a big internal
rewrite that would obviate it. However they wouldn't provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate Maven
project which depends on the non-OSGI jar, uses bundle-maven-plugin
to produce an OSGi version, 'mvn deploy' that, and then your
eclipse-plugin project can list the modified version as a standard
maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and you'll
still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem you're
hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
Post by Tom Bryan (tombry)
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state of
affairs and the problem bridging between Eclipse and Tycho on one
hand and normal Maven artifacts and dependencies on the other.
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to remove
them from the project itself and replace them with some sort of
declarative dependencies, as I can't store jars in our git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a JAR
to an Eclipse plug-in and add it to the Maven repository, you're
still going to have to reference that specific plug-in in your
Eclipse plug-in that uses that library, right? Are you just
hoping to create some automation that follows the Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an equivalent set
of Eclipse "library plug-ins" with the correct transitive
references? Once you do that, your developers will still need all
of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that repo in
my target platform, along with the dependencies I need, and then my
code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you
try to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho
users could help articulate what a workable solution would look like.
That way, maybe someone can solve that problem so that we don't
have a bunch of different software teams having to work around
this disconnect between the Maven world and the Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels) about
my Eclipse plugin build, using Tycho, which was "hard-storing"
some maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how to
specify them as Maven dependencies, but I never got it to work.
I started to understand that the only way to get this to work was
to be able to access those artifacts in a p2 repository, so I can
specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working on
this, but he's telling me that the artifacts mirrored in this
repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin",
but Nexus also has the ability (I don't know the details yet) to
semi-automatically add manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid
OSGi bundle, it won't properly work in a p2 repo unless it can
somehow see "features". What do I have to do to plain Maven
artifact jars to make them usable in an Eclipse plugin build as
repository targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Fv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Justin Georgeson
2016-03-09 19:16:11 UTC
Permalink
Top-posting now because it's getting harder to find the chunk of new text in the middle.

I was under the impression that nested jars could not be loaded without unpacking the plugin, hence the Eclipse-BundleShape header. Maybe I'm wrong about it being required.

The folder structure of target/libs/ vs libs/ being in your bundle has no functional impact. It just subjectively felt more correct to not package the transient build-tool folder structure into the packaged jar.
-----Original Message-----
Sent: Wednesday, March 09, 2016 12:56 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into
your bundle jar with a Bundle-Classpath header to include those extra
jar files.
Post by Justin Georgeson
Post by Justin Georgeson
This also requires setting Eclipse-BundleShape header to "dir" in
your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully understood
the details well enough to move forward with it. Are there
existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is
documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org_wi
ki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Post by Justin Georgeson
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root instead of the target
folder. This is because of how the bin.includes entries in the
build.properties file are handled. In the bin.includes property you'll need
to include the "libs"
Post by Justin Georgeson
folder. Then in your Manifest you can have something like 'Bundle-
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for
"Eclipse- Bundle-Shape", I could use some additional clarification on
the need to put this "libs" folder outside of the "target" folder.
You indicate this is because of how "bin.includes" works, but I'd
appreciate a full explanation.
Post by Justin Georgeson
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar
into a product, it should expand the contents. You build produces a jar, your
software site holds it as a jar, but at runtime (open Eclipse IDE, Help -> Install
New Software, install your feature) it will be a folder instead of jar
(${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of
${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).
Post by Justin Georgeson
https://urldefense.proofpoint.com/v2/url?u=http-
3A__eclipsesource.com_
Post by Justin Georgeson
blogs_2009_01_20_tip-2Declipse-
2Dbundleshape_&d=CwICAg&c=PskvixtEUDK7w
Post by Justin Georgeson
uWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCj
CmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=XGaDb
xkvAaGxoa-
Post by Justin Georgeson
H1wzRKwSMqOscFiiEenj0w3g3fl0&e=
In regards to the bin.includes, with the exception of the compiled classes
(the '.' in bin.includes) I believe all the other entries are relative to
${project.basedir}. So if you put the jar files in target/libs and added
"target/libs" to your bin.includes, your bundle will have "target/libs" instead
of "libs".
Well, ok, but I still have no understanding of why these things matter.
For Eclipse-Bundle-Shape, I first built and installed it without it, and I saw no
obvious issues, and then I did the same with that property, and the only
difference I saw was seeing that property set in the manifest.
What is the actual impact of setting or not setting that property?
Similarly, for the location of where the jars are copied to, why does it matter
that my "bin.includes" will have "target/libs" instead of "libs"?
Is the point that that former path will not exist at runtime?
Post by Justin Georgeson
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file. It
needs to be expanded for the jar file(s) in the "libs" folder to be
loaded at runtime when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in
the jar files and publishes them to a P2 repo inside the Maven
repo. It doesn't support extra p2.inf requirements though (at least
it didn't in my case), and the bug I field was closed as WONTFIX
because that functionality was only beta and the comment implied a
big internal rewrite that would obviate it. However they wouldn't
provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate Maven
project which depends on the non-OSGI jar, uses bundle-maven-plugin
to produce an OSGi version, 'mvn deploy' that, and then your
eclipse-plugin project can list the modified version as a standard
maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and you'll
still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem
you're hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state
of affairs and the problem bridging between Eclipse and Tycho on
one hand and normal Maven artifacts and dependencies on the
other.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to
remove them from the project itself and replace them with some
sort of declarative dependencies, as I can't store jars in our
git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a
JAR to an Eclipse plug-in and add it to the Maven repository,
you're still going to have to reference that specific plug-in in
your Eclipse plug-in that uses that library, right? Are you
just hoping to create some automation that follows the Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an equivalent
set of Eclipse "library plug-ins" with the correct transitive
references? Once you do that, your developers will still need
all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that repo
in my target platform, along with the dependencies I need, and
then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you
try to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho
users could help articulate what a workable solution would look
like.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
That way, maybe someone can solve that problem so that we don't
have a bunch of different software teams having to work around
this disconnect between the Maven world and the Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels)
about my Eclipse plugin build, using Tycho, which was "hard-
storing"
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
some maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how
to specify them as Maven dependencies, but I never got it to
work.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
I started to understand that the only way to get this to work
was to be able to access those artifacts in a p2 repository, so
I can specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working
on this, but he's telling me that the artifacts mirrored in
this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin",
but Nexus also has the ability (I don't know the details yet)
to semi-automatically add manifest info to artifacts so they
can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid
OSGi bundle, it won't properly work in a p2 repo unless it can
somehow see "features". What do I have to do to plain Maven
artifact jars to make them usable in an Eclipse plugin build as
repository targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by Justin Georgeson
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Post by Justin Georgeson
Fv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=PWDjkoTl
zkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9tQa9t0dDKghFvCDIG_wBaZ
_GfAsO8EQ
Post by Justin Georgeson
GC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9t
Qa9t0dDKghFvCDIG_wBaZ_GfAsO8EQGC5sW_1c_qk&e=
David M. Karr
2016-03-09 19:29:22 UTC
Permalink
Post by Justin Georgeson
Top-posting now because it's getting harder to find the chunk of new text in the middle.
Good choice. I was finding that challenging myself. :)
Post by Justin Georgeson
I was under the impression that nested jars could not be loaded without unpacking the plugin, hence the Eclipse-BundleShape header. Maybe I'm wrong about it being required.
One of the hazards of properties file driven development. When a
property becomes obsolete, nothing tells you it's not required anymore.
Post by Justin Georgeson
The folder structure of target/libs/ vs libs/ being in your bundle has no functional impact. It just subjectively felt more correct to not package the transient build-tool folder structure into the packaged jar.
As these are "generated files", they are inherently transient no matter
where I put them. If there's no technical impact to specifying a path in
the "target" directory, it seems cleaner to me to use that, instead of
outside of it, and then also augmenting the "clean" target to manually
clean those up.
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 12:56 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into
your bundle jar with a Bundle-Classpath header to include those extra
jar files.
Post by Justin Georgeson
Post by Justin Georgeson
This also requires setting Eclipse-BundleShape header to "dir" in
your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully understood
the details well enough to move forward with it. Are there
existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is
documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org_wi
ki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Post by Justin Georgeson
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root instead of the target
folder. This is because of how the bin.includes entries in the
build.properties file are handled. In the bin.includes property you'll need
to include the "libs"
Post by Justin Georgeson
folder. Then in your Manifest you can have something like 'Bundle-
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for
"Eclipse- Bundle-Shape", I could use some additional clarification on
the need to put this "libs" folder outside of the "target" folder.
You indicate this is because of how "bin.includes" works, but I'd
appreciate a full explanation.
Post by Justin Georgeson
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar
into a product, it should expand the contents. You build produces a jar, your
software site holds it as a jar, but at runtime (open Eclipse IDE, Help -> Install
New Software, install your feature) it will be a folder instead of jar
(${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of
${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).
Post by Justin Georgeson
https://urldefense.proofpoint.com/v2/url?u=http-
3A__eclipsesource.com_
Post by Justin Georgeson
blogs_2009_01_20_tip-2Declipse-
2Dbundleshape_&d=CwICAg&c=PskvixtEUDK7w
Post by Justin Georgeson
uWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCj
CmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=XGaDb
xkvAaGxoa-
Post by Justin Georgeson
H1wzRKwSMqOscFiiEenj0w3g3fl0&e=
In regards to the bin.includes, with the exception of the compiled classes
(the '.' in bin.includes) I believe all the other entries are relative to
${project.basedir}. So if you put the jar files in target/libs and added
"target/libs" to your bin.includes, your bundle will have "target/libs" instead
of "libs".
Well, ok, but I still have no understanding of why these things matter.
For Eclipse-Bundle-Shape, I first built and installed it without it, and I saw no
obvious issues, and then I did the same with that property, and the only
difference I saw was seeing that property set in the manifest.
What is the actual impact of setting or not setting that property?
Similarly, for the location of where the jars are copied to, why does it matter
that my "bin.includes" will have "target/libs" instead of "libs"?
Is the point that that former path will not exist at runtime?
Post by Justin Georgeson
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file. It
needs to be expanded for the jar file(s) in the "libs" folder to be
loaded at runtime when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in
the jar files and publishes them to a P2 repo inside the Maven
repo. It doesn't support extra p2.inf requirements though (at least
it didn't in my case), and the bug I field was closed as WONTFIX
because that functionality was only beta and the comment implied a
big internal rewrite that would obviate it. However they wouldn't
provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate Maven
project which depends on the non-OSGI jar, uses bundle-maven-plugin
to produce an OSGi version, 'mvn deploy' that, and then your
eclipse-plugin project can list the modified version as a standard
maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and you'll
still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem
you're hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state
of affairs and the problem bridging between Eclipse and Tycho on
one hand and normal Maven artifacts and dependencies on the
other.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to
remove them from the project itself and replace them with some
sort of declarative dependencies, as I can't store jars in our
git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a
JAR to an Eclipse plug-in and add it to the Maven repository,
you're still going to have to reference that specific plug-in in
your Eclipse plug-in that uses that library, right? Are you
just hoping to create some automation that follows the Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an equivalent
set of Eclipse "library plug-ins" with the correct transitive
references? Once you do that, your developers will still need
all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that repo
in my target platform, along with the dependencies I need, and
then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you
try to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho
users could help articulate what a workable solution would look
like.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
That way, maybe someone can solve that problem so that we don't
have a bunch of different software teams having to work around
this disconnect between the Maven world and the Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels)
about my Eclipse plugin build, using Tycho, which was "hard-
storing"
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
some maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how
to specify them as Maven dependencies, but I never got it to
work.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
I started to understand that the only way to get this to work
was to be able to access those artifacts in a p2 repository, so
I can specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working
on this, but he's telling me that the artifacts mirrored in
this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin",
but Nexus also has the ability (I don't know the details yet)
to semi-automatically add manifest info to artifacts so they
can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid
OSGi bundle, it won't properly work in a p2 repo unless it can
somehow see "features". What do I have to do to plain Maven
artifact jars to make them usable in an Eclipse plugin build as
repository targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by Justin Georgeson
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Post by Justin Georgeson
Fv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=PWDjkoTl
zkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9tQa9t0dDKghFvCDIG_wBaZ
_GfAsO8EQ
Post by Justin Georgeson
GC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9t
Qa9t0dDKghFvCDIG_wBaZ_GfAsO8EQGC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
David M. Karr
2016-03-10 22:39:12 UTC
Permalink
Post by Justin Georgeson
Top-posting now because it's getting harder to find the chunk of new text in the middle.
I was under the impression that nested jars could not be loaded without unpacking the plugin, hence the Eclipse-BundleShape header. Maybe I'm wrong about it being required.
The folder structure of target/libs/ vs libs/ being in your bundle has no functional impact. It just subjectively felt more correct to not package the transient build-tool folder structure into the packaged jar.
I discovered an additional problem, although I think this issue is
really entirely in the Maven domain, so I posed a question on that list,
but I'll briefly mention the issue I'm seeing.

The first time I ran the build with the maven-dependency-plugin
configured, it worked perfectly. I tested the results of that for a
while. At one point I tried writing the jars into "target/libs", but
for some reason that wasn't doing anything, and I didn't understand why,
so I changed it back to "libs" in the meantime.

I then proceeded to augment the "clean" plugin to remove the "libs"
folder. This also worked fine on the first try.

What I then found is that the build is silently refusing to copy the
jars again. It doesn't create the folder, and it doesn't copy the
jars. I tried manually creating the folder, but that made no
difference. I added "--debug" and that told me nothing.

If it matters, here is the structure I ended up with (eliding the
details of each artifact):
-----------------------------
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
---------------------

Any idea why this might be (not) happening?
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 12:56 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into
your bundle jar with a Bundle-Classpath header to include those extra
jar files.
Post by Justin Georgeson
Post by Justin Georgeson
This also requires setting Eclipse-BundleShape header to "dir" in
your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully understood
the details well enough to move forward with it. Are there
existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is
documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org_wi
ki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Post by Justin Georgeson
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root instead of the target
folder. This is because of how the bin.includes entries in the
build.properties file are handled. In the bin.includes property you'll need
to include the "libs"
Post by Justin Georgeson
folder. Then in your Manifest you can have something like 'Bundle-
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for
"Eclipse- Bundle-Shape", I could use some additional clarification on
the need to put this "libs" folder outside of the "target" folder.
You indicate this is because of how "bin.includes" works, but I'd
appreciate a full explanation.
Post by Justin Georgeson
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar
into a product, it should expand the contents. You build produces a jar, your
software site holds it as a jar, but at runtime (open Eclipse IDE, Help -> Install
New Software, install your feature) it will be a folder instead of jar
(${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of
${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).
Post by Justin Georgeson
https://urldefense.proofpoint.com/v2/url?u=http-
3A__eclipsesource.com_
Post by Justin Georgeson
blogs_2009_01_20_tip-2Declipse-
2Dbundleshape_&d=CwICAg&c=PskvixtEUDK7w
Post by Justin Georgeson
uWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCj
CmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=XGaDb
xkvAaGxoa-
Post by Justin Georgeson
H1wzRKwSMqOscFiiEenj0w3g3fl0&e=
In regards to the bin.includes, with the exception of the compiled classes
(the '.' in bin.includes) I believe all the other entries are relative to
${project.basedir}. So if you put the jar files in target/libs and added
"target/libs" to your bin.includes, your bundle will have "target/libs" instead
of "libs".
Well, ok, but I still have no understanding of why these things matter.
For Eclipse-Bundle-Shape, I first built and installed it without it, and I saw no
obvious issues, and then I did the same with that property, and the only
difference I saw was seeing that property set in the manifest.
What is the actual impact of setting or not setting that property?
Similarly, for the location of where the jars are copied to, why does it matter
that my "bin.includes" will have "target/libs" instead of "libs"?
Is the point that that former path will not exist at runtime?
Post by Justin Georgeson
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file. It
needs to be expanded for the jar file(s) in the "libs" folder to be
loaded at runtime when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in
the jar files and publishes them to a P2 repo inside the Maven
repo. It doesn't support extra p2.inf requirements though (at least
it didn't in my case), and the bug I field was closed as WONTFIX
because that functionality was only beta and the comment implied a
big internal rewrite that would obviate it. However they wouldn't
provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate Maven
project which depends on the non-OSGI jar, uses bundle-maven-plugin
to produce an OSGi version, 'mvn deploy' that, and then your
eclipse-plugin project can list the modified version as a standard
maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and you'll
still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem
you're hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state
of affairs and the problem bridging between Eclipse and Tycho on
one hand and normal Maven artifacts and dependencies on the
other.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to
remove them from the project itself and replace them with some
sort of declarative dependencies, as I can't store jars in our
git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a
JAR to an Eclipse plug-in and add it to the Maven repository,
you're still going to have to reference that specific plug-in in
your Eclipse plug-in that uses that library, right? Are you
just hoping to create some automation that follows the Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an equivalent
set of Eclipse "library plug-ins" with the correct transitive
references? Once you do that, your developers will still need
all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that repo
in my target platform, along with the dependencies I need, and
then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you
try to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho
users could help articulate what a workable solution would look
like.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
That way, maybe someone can solve that problem so that we don't
have a bunch of different software teams having to work around
this disconnect between the Maven world and the Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels)
about my Eclipse plugin build, using Tycho, which was "hard-
storing"
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
some maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how
to specify them as Maven dependencies, but I never got it to
work.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
I started to understand that the only way to get this to work
was to be able to access those artifacts in a p2 repository, so
I can specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working
on this, but he's telling me that the artifacts mirrored in
this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin",
but Nexus also has the ability (I don't know the details yet)
to semi-automatically add manifest info to artifacts so they
can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid
OSGi bundle, it won't properly work in a p2 repo unless it can
somehow see "features". What do I have to do to plain Maven
artifact jars to make them usable in an Eclipse plugin build as
repository targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by Justin Georgeson
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Post by Justin Georgeson
Fv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=PWDjkoTl
zkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9tQa9t0dDKghFvCDIG_wBaZ
_GfAsO8EQ
Post by Justin Georgeson
GC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9t
Qa9t0dDKghFvCDIG_wBaZ_GfAsO8EQGC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
David M. Karr
2016-03-11 17:31:45 UTC
Permalink
Post by David M. Karr
Post by Justin Georgeson
Top-posting now because it's getting harder to find the chunk of new text in the middle.
I was under the impression that nested jars could not be loaded
without unpacking the plugin, hence the Eclipse-BundleShape header.
Maybe I'm wrong about it being required.
The folder structure of target/libs/ vs libs/ being in your bundle
has no functional impact. It just subjectively felt more correct to
not package the transient build-tool folder structure into the
packaged jar.
I discovered an additional problem, although I think this issue is
really entirely in the Maven domain, so I posed a question on that
list, but I'll briefly mention the issue I'm seeing.
The first time I ran the build with the maven-dependency-plugin
configured, it worked perfectly. I tested the results of that for a
while. At one point I tried writing the jars into "target/libs", but
for some reason that wasn't doing anything, and I didn't understand
why, so I changed it back to "libs" in the meantime.
I then proceeded to augment the "clean" plugin to remove the "libs"
folder. This also worked fine on the first try.
What I then found is that the build is silently refusing to copy the
jars again. It doesn't create the folder, and it doesn't copy the
jars. I tried manually creating the folder, but that made no
difference. I added "--debug" and that told me nothing.
If it matters, here is the structure I ended up with (eliding the
-----------------------------
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
---------------------
Any idea why this might be (not) happening?
I made a "head-smack" discovery this morning, but I still need a little
more information to get the right fix.

The problem is that I declared this for the "package" phase. These
dependencies are actually required to compile the source files in this
project, and the Tycho compiler uses the classpath specified in the
manifest as opposed to the maven dependencies. If these jars are put
into the expected location in the "package" phase, that is after the
"compile" phase, so the source files fail to compile and the build
fails, so it never copies the jars.

So, I have to determine the correct phase to configure this for. I
thought immediately it would be "pre-compile", but that made no
difference. I tried "validate" and that worked, although I think it
makes more sense to make this happen "just in time", in a phase where
this kind of thing should be done. The "validate" phase feels "too
early" to me.

Because the Tycho compiler is in play, does Tycho use a custom phase
that would make more sense here?
Post by David M. Karr
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 12:56 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them into
your bundle jar with a Bundle-Classpath header to include those extra
jar files.
Post by Justin Georgeson
Post by Justin Georgeson
This also requires setting Eclipse-BundleShape header to "dir" in
your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully understood
the details well enough to move forward with it. Are there
existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header is
documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org_wi
ki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Post by Justin Georgeson
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root instead of the target
folder. This is because of how the bin.includes entries in the
build.properties file are handled. In the bin.includes property you'll need
to include the "libs"
Post by Justin Georgeson
folder. Then in your Manifest you can have something like 'Bundle-
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for
"Eclipse- Bundle-Shape", I could use some additional clarification on
the need to put this "libs" folder outside of the "target" folder.
You indicate this is because of how "bin.includes" works, but I'd
appreciate a full explanation.
Post by Justin Georgeson
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar
into a product, it should expand the contents. You build produces a jar, your
software site holds it as a jar, but at runtime (open Eclipse IDE, Help -> Install
New Software, install your feature) it will be a folder instead of jar
(${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of
${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).
Post by Justin Georgeson
https://urldefense.proofpoint.com/v2/url?u=http-
3A__eclipsesource.com_
Post by Justin Georgeson
blogs_2009_01_20_tip-2Declipse-
2Dbundleshape_&d=CwICAg&c=PskvixtEUDK7w
Post by Justin Georgeson
uWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCj
CmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=XGaDb
xkvAaGxoa-
Post by Justin Georgeson
H1wzRKwSMqOscFiiEenj0w3g3fl0&e=
In regards to the bin.includes, with the exception of the compiled classes
(the '.' in bin.includes) I believe all the other entries are relative to
${project.basedir}. So if you put the jar files in target/libs and added
"target/libs" to your bin.includes, your bundle will have
"target/libs" instead
of "libs".
Well, ok, but I still have no understanding of why these things matter.
For Eclipse-Bundle-Shape, I first built and installed it without it, and I saw no
obvious issues, and then I did the same with that property, and the only
difference I saw was seeing that property set in the manifest.
What is the actual impact of setting or not setting that property?
Similarly, for the location of where the jars are copied to, why does it matter
that my "bin.includes" will have "target/libs" instead of "libs"?
Is the point that that former path will not exist at runtime?
Post by Justin Georgeson
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file. It
needs to be expanded for the jar file(s) in the "libs" folder to be
loaded at runtime when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata in
the jar files and publishes them to a P2 repo inside the Maven
repo. It doesn't support extra p2.inf requirements though (at least
it didn't in my case), and the bug I field was closed as WONTFIX
because that functionality was only beta and the comment implied a
big internal rewrite that would obviate it. However they wouldn't
provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the Maven
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate Maven
project which depends on the non-OSGI jar, uses bundle-maven-plugin
to produce an OSGi version, 'mvn deploy' that, and then your
eclipse-plugin project can list the modified version as a standard
maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and you'll
still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem
you're hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current state
of affairs and the problem bridging between Eclipse and Tycho on
one hand and normal Maven artifacts and dependencies on the
other.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project and
references them in the classpath in the manifest. I need to
remove them from the project itself and replace them with some
sort of declarative dependencies, as I can't store jars in our
git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a
JAR to an Eclipse plug-in and add it to the Maven repository,
you're still going to have to reference that specific plug-in in
your Eclipse plug-in that uses that library, right? Are you
just hoping to create some automation that follows the Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an equivalent
set of Eclipse "library plug-ins" with the correct transitive
references? Once you do that, your developers will still need
all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that repo
in my target platform, along with the dependencies I need, and
then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as you
try to include a complex third party (JAR) library into your RCP
application, you hit this problem. It would be great if Tycho
users could help articulate what a workable solution would look
like.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
That way, maybe someone can solve that problem so that we don't
have a bunch of different software teams having to work around
this disconnect between the Maven world and the Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels)
about my Eclipse plugin build, using Tycho, which was "hard-
storing"
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
some maven artifacts in the project instead of specifying them
"declaratively". I tried for quite a while to figure out how
to specify them as Maven dependencies, but I never got it to
work.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
I started to understand that the only way to get this to work
was to be able to access those artifacts in a p2 repository, so
I can specify those dependencies in my target platform. The
administrator of the Nexus server that I use has been working
on this, but he's telling me that the artifacts mirrored in
this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment" an
existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the "maven-bundle-plugin",
but Nexus also has the ability (I don't know the details yet)
to semi-automatically add manifest info to artifacts so they
can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a valid
OSGi bundle, it won't properly work in a p2 repo unless it can
somehow see "features". What do I have to do to plain Maven
artifact jars to make them usable in an Eclipse plugin build as
repository targets in a target platform specification?
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by Justin Georgeson
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by Justin Georgeson
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by Justin Georgeson
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Post by Justin Georgeson
Fv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
m=PWDjkoTl
zkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9tQa9t0dDKghFvCDIG_wBaZ
_GfAsO8EQ
Post by Justin Georgeson
GC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9t
Qa9t0dDKghFvCDIG_wBaZ_GfAsO8EQGC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Justin Georgeson
2016-03-11 19:15:55 UTC
Permalink
If you need them for doing any code generation then initialize would probably be better than validate. If you don't need them for code generation then there's generate-resources and process-resources, both happen before compile.

https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
-----Original Message-----
Sent: Friday, March 11, 2016 11:32 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by David M. Karr
Post by Justin Georgeson
Top-posting now because it's getting harder to find the chunk of new
text in the middle.
I was under the impression that nested jars could not be loaded
without unpacking the plugin, hence the Eclipse-BundleShape header.
Maybe I'm wrong about it being required.
The folder structure of target/libs/ vs libs/ being in your bundle
has no functional impact. It just subjectively felt more correct to
not package the transient build-tool folder structure into the
packaged jar.
I discovered an additional problem, although I think this issue is
really entirely in the Maven domain, so I posed a question on that
list, but I'll briefly mention the issue I'm seeing.
The first time I ran the build with the maven-dependency-plugin
configured, it worked perfectly. I tested the results of that for a
while. At one point I tried writing the jars into "target/libs", but
for some reason that wasn't doing anything, and I didn't understand
why, so I changed it back to "libs" in the meantime.
I then proceeded to augment the "clean" plugin to remove the "libs"
folder. This also worked fine on the first try.
What I then found is that the build is silently refusing to copy the
jars again. It doesn't create the folder, and it doesn't copy the
jars. I tried manually creating the folder, but that made no
difference. I added "--debug" and that told me nothing.
If it matters, here is the structure I ended up with (eliding the
-----------------------------
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
---------------------
Any idea why this might be (not) happening?
I made a "head-smack" discovery this morning, but I still need a little more
information to get the right fix.
The problem is that I declared this for the "package" phase. These
dependencies are actually required to compile the source files in this project,
and the Tycho compiler uses the classpath specified in the manifest as
opposed to the maven dependencies. If these jars are put into the expected
location in the "package" phase, that is after the "compile" phase, so the
source files fail to compile and the build fails, so it never copies the jars.
So, I have to determine the correct phase to configure this for. I thought
immediately it would be "pre-compile", but that made no difference. I tried
"validate" and that worked, although I think it makes more sense to make
this happen "just in time", in a phase where this kind of thing should be
done. The "validate" phase feels "too early" to me.
Because the Tycho compiler is in play, does Tycho use a custom phase that
would make more sense here?
Post by David M. Karr
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 12:56 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about
mirroring maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them
into
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
your bundle jar with a Bundle-Classpath header to include those extra
jar files.
Post by Justin Georgeson
Post by Justin Georgeson
This also requires setting Eclipse-BundleShape header to "dir"
in your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully
understood the details well enough to move forward with it. Are
there existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header
is documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org
_wi
ki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root
instead of the target
folder. This is because of how the bin.includes entries in the
build.properties file are handled. In the bin.includes property you'll need
to include the "libs"
Post by Justin Georgeson
folder. Then in your Manifest you can have something like 'Bundle-
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for
"Eclipse- Bundle-Shape", I could use some additional clarification
on the need to put this "libs" folder outside of the "target" folder.
You indicate this is because of how "bin.includes" works, but I'd
appreciate a full explanation.
Post by Justin Georgeson
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar
into a product, it should expand the contents. You build produces a
jar, your software site holds it as a jar, but at runtime (open
Eclipse IDE, Help -> Install New Software, install your feature) it
will be a folder instead of jar
(${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of
${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).
Post by Justin Georgeson
https://urldefense.proofpoint.com/v2/url?u=http-
3A__eclipsesource.com_
Post by Justin Georgeson
blogs_2009_01_20_tip-2Declipse-
2Dbundleshape_&d=CwICAg&c=PskvixtEUDK7w
Post by Justin Georgeson
uWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
mBCj
CmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=XGaDb
Post by David M. Karr
Post by Justin Georgeson
xkvAaGxoa-
Post by Justin Georgeson
H1wzRKwSMqOscFiiEenj0w3g3fl0&e=
In regards to the bin.includes, with the exception of the compiled classes
(the '.' in bin.includes) I believe all the other entries are
relative to ${project.basedir}. So if you put the jar files in
target/libs and added "target/libs" to your bin.includes, your
bundle will have "target/libs" instead of "libs".
Well, ok, but I still have no understanding of why these things matter.
For Eclipse-Bundle-Shape, I first built and installed it without it,
and I saw no obvious issues, and then I did the same with that
property, and the only difference I saw was seeing that property set
in the manifest.
What is the actual impact of setting or not setting that property?
Similarly, for the location of where the jars are copied to, why
does it matter that my "bin.includes" will have "target/libs"
instead of "libs"?
Is the point that that former path will not exist at runtime?
Post by Justin Georgeson
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file.
It needs to be expanded for the jar file(s) in the "libs" folder
to be loaded at runtime when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata
in the jar files and publishes them to a P2 repo inside the
Maven repo. It doesn't support extra p2.inf requirements though
(at least it didn't in my case), and the bug I field was closed
as WONTFIX because that functionality was only beta and the
comment implied a big internal rewrite that would obviate it.
However they wouldn't provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the
Maven
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate
Maven project which depends on the non-OSGI jar, uses
bundle-maven-plugin to produce an OSGi version, 'mvn deploy'
that, and then your eclipse-plugin project can list the modified
version as a standard maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and
you'll still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem
you're hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current
state of affairs and the problem bridging between Eclipse and
Tycho on one hand and normal Maven artifacts and
dependencies
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
on the
other.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project
and references them in the classpath in the manifest. I need
to remove them from the project itself and replace them with
some sort of declarative dependencies, as I can't store jars
in our git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a
JAR to an Eclipse plug-in and add it to the Maven repository,
you're still going to have to reference that specific plug-in
in your Eclipse plug-in that uses that library, right? Are
you just hoping to create some automation that follows the
Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an
equivalent set of Eclipse "library plug-ins" with the correct
transitive references? Once you do that, your developers
will still need all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that
repo in my target platform, along with the dependencies I
need, and then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as
you try to include a complex third party (JAR) library into
your RCP application, you hit this problem. It would be
great if Tycho users could help articulate what a workable
solution would look
like.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
That way, maybe someone can solve that problem so that we
don't have a bunch of different software teams having to work
around this disconnect between the Maven world and the
Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
behalf of David
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels)
about my Eclipse plugin build, using Tycho, which was "hard-
storing"
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
some maven artifacts in the project instead of specifying
them "declaratively". I tried for quite a while to figure
out how to specify them as Maven dependencies, but I never
got it to
work.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
I started to understand that the only way to get this to
work was to be able to access those artifacts in a p2
repository, so I can specify those dependencies in my target
platform. The administrator of the Nexus server that I use
has been working on this, but he's telling me that the
artifacts mirrored in this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment"
an existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the
"maven-bundle-plugin", but Nexus also has the ability (I
don't know the details yet) to semi-automatically add
manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a
valid OSGi bundle, it won't properly work in a p2 repo
unless it can somehow see "features". What do I have to do
to plain Maven artifact jars to make them usable in an
Eclipse plugin build as repository targets in a target platform
specification?
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Fv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
m=PWDjkoTl
zkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9tQa9t0dDKghFvCDIG_wBaZ
Post by David M. Karr
Post by Justin Georgeson
_GfAsO8EQ
Post by Justin Georgeson
GC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9t
Post by David M. Karr
Post by Justin Georgeson
Qa9t0dDKghFvCDIG_wBaZ_GfAsO8EQGC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.org_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
&m=sSQFN
k5tf38Hv8QS1ABSVN7IjST9I6W0t499ixNAcRo&s=SQ3KmET5fHzvsvtV7HlfiGnb
qL4c
Post by David M. Karr
Post by Justin Georgeson
H7zbJLfO8N80Qcw&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=sSQFNk5tf38Hv8QS1ABSVN7IjST9I6W0t499ixNAcRo&s=SQ3
KmET5fHzvsvtV7HlfiGnbqL4cH7zbJLfO8N80Qcw&e=
David M. Karr
2016-03-11 19:38:26 UTC
Permalink
Post by Justin Georgeson
If you need them for doing any code generation then initialize would probably be better than validate. If you don't need them for code generation then there's generate-resources and process-resources, both happen before compile.
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
Odd. I thought I had tried process-resources, and it didn't appear to
work. I just tried it now, and it looks fine. I'll move forward with this.

Thanks.
Post by Justin Georgeson
-----Original Message-----
Sent: Friday, March 11, 2016 11:32 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring maven
artifacts in a p2 mirror with Nexus
Post by David M. Karr
Post by Justin Georgeson
Top-posting now because it's getting harder to find the chunk of new
text in the middle.
I was under the impression that nested jars could not be loaded
without unpacking the plugin, hence the Eclipse-BundleShape header.
Maybe I'm wrong about it being required.
The folder structure of target/libs/ vs libs/ being in your bundle
has no functional impact. It just subjectively felt more correct to
not package the transient build-tool folder structure into the
packaged jar.
I discovered an additional problem, although I think this issue is
really entirely in the Maven domain, so I posed a question on that
list, but I'll briefly mention the issue I'm seeing.
The first time I ran the build with the maven-dependency-plugin
configured, it worked perfectly. I tested the results of that for a
while. At one point I tried writing the jars into "target/libs", but
for some reason that wasn't doing anything, and I didn't understand
why, so I changed it back to "libs" in the meantime.
I then proceeded to augment the "clean" plugin to remove the "libs"
folder. This also worked fine on the first try.
What I then found is that the build is silently refusing to copy the
jars again. It doesn't create the folder, and it doesn't copy the
jars. I tried manually creating the folder, but that made no
difference. I added "--debug" and that told me nothing.
If it matters, here is the structure I ended up with (eliding the
-----------------------------
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
<artifactItem>
...
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
---------------------
Any idea why this might be (not) happening?
I made a "head-smack" discovery this morning, but I still need a little more
information to get the right fix.
The problem is that I declared this for the "package" phase. These
dependencies are actually required to compile the source files in this project,
and the Tycho compiler uses the classpath specified in the manifest as
opposed to the maven dependencies. If these jars are put into the expected
location in the "package" phase, that is after the "compile" phase, so the
source files fail to compile and the build fails, so it never copies the jars.
So, I have to determine the correct phase to configure this for. I thought
immediately it would be "pre-compile", but that made no difference. I tried
"validate" and that worked, although I think it makes more sense to make
this happen "just in time", in a phase where this kind of thing should be
done. The "validate" phase feels "too early" to me.
Because the Tycho compiler is in play, does Tycho use a custom phase that
would make more sense here?
Post by David M. Karr
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 12:56 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Wednesday, March 09, 2016 9:05 AM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 1:24 PM
To: Tycho user list
Subject: Re: [tycho-user] [EXTERNAL] Re: Need info about
mirroring maven artifacts in a p2 mirror with Nexus
Post by Justin Georgeson
You could use the maven-dependency-plugin to dynamically pull those
dependencies from a standard M2 repo, and then package them
into
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
your bundle jar with a Bundle-Classpath header to include those extra
jar files.
Post by Justin Georgeson
Post by Justin Georgeson
This also requires setting Eclipse-BundleShape header to "dir"
in your manifest so your plugin is extracted into a folder when
installed into a product.
I've heard of this option before, but I've never fully
understood the details well enough to move forward with it. Are
there existing simple (but
complete) examples that I can reference for this?
Don't know about public examples, but the Bundle-Classpath header
is documented here
https://urldefense.proofpoint.com/v2/url?u=http-3A__wiki.osgi.org
_wi
ki
_Bundle-2DClassPath&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0
UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=4I8tMYY2
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
k40ggyQRL
Post by Justin Georgeson
-
_8ChDDwhTU1CPSSkR9NeONVlE&s=IuB_2BnZ09zY4B_sDxEIhhi4U6U2RXhAP
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Rm5DoTgM
Post by Justin Georgeson
wM&e=
The dependency plugin I would suggest using the copy goal
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-2Dplugin_copy-
2Dmojo.html&d=CwICAg&c=Pskvix
Post by Justin Georgeson
tEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
QoEmBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=gQb0B-Wx
Post by Justin Georgeson
rhgh7Z0Dob1NxoCpI6f-j_3EY7RNChZhXVw&e=
https://urldefense.proofpoint.com/v2/url?u=https-
3A__maven.apache.org_
Post by Justin Georgeson
plugins_maven-2Ddependency-
2Dplugin_usage.html&d=CwICAg&c=PskvixtEUDK7
Post by Justin Georgeson
wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
mBC
Post by Justin Georgeson
jCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=9LrgEVu4vE3zWk
Post by Justin Georgeson
OmQRiirzRMmkbmjjNshGzM2rl4hwo&e=
Put all the jar files in a folder like "libs", at the root
instead of the target
folder. This is because of how the bin.includes entries in the
build.properties file are handled. In the bin.includes property you'll need
to include the "libs"
Post by Justin Georgeson
folder. Then in your Manifest you can have something like 'Bundle-
libs/*' and 'Eclipse-Bundle-Shape: dir'.
In addition to my pending question about the purpose and need for
"Eclipse- Bundle-Shape", I could use some additional clarification
on the need to put this "libs" folder outside of the "target" folder.
You indicate this is because of how "bin.includes" works, but I'd
appreciate a full explanation.
Post by Justin Georgeson
The Eclipse-BundleShape header tells P2 that when it installs the plugin jar
into a product, it should expand the contents. You build produces a
jar, your software site holds it as a jar, but at runtime (open
Eclipse IDE, Help -> Install New Software, install your feature) it
will be a folder instead of jar
(${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444/ instead of
${ECLIPSE}/plugins/com.example.plugin_1.2.3.4444.jar).
Post by Justin Georgeson
https://urldefense.proofpoint.com/v2/url?u=http-
3A__eclipsesource.com_
Post by Justin Georgeson
blogs_2009_01_20_tip-2Declipse-
2Dbundleshape_&d=CwICAg&c=PskvixtEUDK7w
Post by Justin Georgeson
uWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
mBCj
CmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=XGaDb
Post by David M. Karr
Post by Justin Georgeson
xkvAaGxoa-
Post by Justin Georgeson
H1wzRKwSMqOscFiiEenj0w3g3fl0&e=
In regards to the bin.includes, with the exception of the compiled classes
(the '.' in bin.includes) I believe all the other entries are
relative to ${project.basedir}. So if you put the jar files in
target/libs and added "target/libs" to your bin.includes, your
bundle will have "target/libs" instead of "libs".
Well, ok, but I still have no understanding of why these things matter.
For Eclipse-Bundle-Shape, I first built and installed it without it,
and I saw no obvious issues, and then I did the same with that
property, and the only difference I saw was seeing that property set
in the manifest.
What is the actual impact of setting or not setting that property?
Similarly, for the location of where the jars are copied to, why
does it matter that my "bin.includes" will have "target/libs"
instead of "libs"?
Is the point that that former path will not exist at runtime?
Post by Justin Georgeson
Post by Justin Georgeson
Your bundle jar should end up with the "libs" folder at the root, and P2 will
install your bundle as an expanded folder instead of the jar file.
It needs to be expanded for the jar file(s) in the "libs" folder
to be loaded at runtime when the bundle is started.
Post by Justin Georgeson
Post by Justin Georgeson
The Nexus P2 metadata feature is useful if you're doing a 'mvn deploy' of
an OSGi compliant bundle or feature jar. It reads the metadata
in the jar files and publishes them to a P2 repo inside the
Maven repo. It doesn't support extra p2.inf requirements though
(at least it didn't in my case), and the bug I field was closed
as WONTFIX because that functionality was only beta and the
comment implied a big internal rewrite that would obviate it.
However they wouldn't provide any further
information.
Post by Justin Georgeson
Post by Justin Georgeson
To use pomDependencies=consider the dependencies in the
Maven
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
repo
Post by Justin Georgeson
have to already be OSGi bundle jars. You can have a separate
Maven project which depends on the non-OSGI jar, uses
bundle-maven-plugin to produce an OSGi version, 'mvn deploy'
that, and then your eclipse-plugin project can list the modified
version as a standard maven pom dependency in conjunction with
pomDependencies=consider.
Post by Justin Georgeson
There is no transitive resolution of these dependencies, and
you'll still have to list the dependency in your manifest too.
Post by Justin Georgeson
-----Original Message-----
Sent: Tuesday, March 08, 2016 12:49 PM
To: Tycho user list
Subject: [EXTERNAL] Re: [tycho-user] Need info about mirroring
maven artifacts in a p2 mirror with Nexus
Post by Tom Bryan (tombry)
I don't remember your original use case, but is the problem
you're hitting similar to this user's situation?
https://urldefense.proofpoint.com/v2/url?u=http-
3A__stackoverflow.com_
Post by Tom Bryan (tombry)
questions_35346113_using-2Dthird-2Dparty-2Dlibraries-2Din-
2D&d=CwICAg&
Post by Tom Bryan (tombry)
c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OV
ZL1uyui4QoEmBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cixX8Rplgy4&s=
Post by Tom Bryan (tombry)
lXkou9wjJu-b6MRCwKJbKLpLF0QCXw3WlFT0f-iiuto&e=
eclipse-rcp-tycho-app/
I think that my reply on that thread explains the current
state of affairs and the problem bridging between Eclipse and
Tycho on one hand and normal Maven artifacts and
dependencies
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
on the
other.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
I guess my situation is similar to that, yes.
The present build just "hard-stores" the jars in the project
and references them in the classpath in the manifest. I need
to remove them from the project itself and replace them with
some sort of declarative dependencies, as I can't store jars
in our git repo (it's a project
policy, but I agree with it).
Post by Justin Georgeson
Post by Tom Bryan (tombry)
The problem is that even if you could automatically convert a
JAR to an Eclipse plug-in and add it to the Maven repository,
you're still going to have to reference that specific plug-in
in your Eclipse plug-in that uses that library, right? Are
you just hoping to create some automation that follows the
Maven
dependency
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
tree for some specific artifact and then creates an
equivalent set of Eclipse "library plug-ins" with the correct
transitive references? Once you do that, your developers
will still need all of those plug-ins in their local
development environments, right?
I had assumed that once the jars I need are properly
OSGi-configured into the Nexus p2 repo, I can specify that
repo in my target platform, along with the dependencies I
need, and then my code will be
able to use those classes.
Post by Justin Georgeson
Is there anything else I need?
Post by Tom Bryan (tombry)
Tycho is great for handling Eclipse bundles, but as soon as
you try to include a complex third party (JAR) library into
your RCP application, you hit this problem. It would be
great if Tycho users could help articulate what a workable
solution would look
like.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
That way, maybe someone can solve that problem so that we
don't have a bunch of different software teams having to work
around this disconnect between the Maven world and the
Eclipse-tycho
world.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
---Tom
behalf of David
M.
Post by Tom Bryan (tombry)
Post by David M. Karr
A while ago, I asked questions in here (and other channels)
about my Eclipse plugin build, using Tycho, which was "hard-
storing"
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
some maven artifacts in the project instead of specifying
them "declaratively". I tried for quite a while to figure
out how to specify them as Maven dependencies, but I never
got it to
work.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
I started to understand that the only way to get this to
work was to be able to access those artifacts in a p2
repository, so I can specify those dependencies in my target
platform. The administrator of the Nexus server that I use
has been working on this, but he's telling me that the
artifacts mirrored in this repository have to be OSGi
bundles.
Post by Tom Bryan (tombry)
Post by David M. Karr
A "plain" Maven artifact jar won't work.
I'm now understanding that it's straightforward to "augment"
an existing Maven artifact with the appropriate META-
INF/MANIFEST.MF
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
file to have it be recognized and properly used as an OSGi bundle.
This can be done at build time with the
"maven-bundle-plugin", but Nexus also has the ability (I
don't know the details yet) to semi-automatically add
manifest info to artifacts so they can be used in a
p2 repo.
Post by Tom Bryan (tombry)
Post by David M. Karr
However, I'm also hearing that even if the artifact is a
valid OSGi bundle, it won't properly work in a p2 repo
unless it can somehow see "features". What do I have to do
to plain Maven artifact jars to make them usable in an
Eclipse plugin build as repository targets in a target platform
specification?
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe
from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.
Post by Justin Georgeson
Post by Justin Georgeson
Post by Tom Bryan (tombry)
Post by David M. Karr
or
g_
mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&m=5Khxh
Post by Tom Bryan (tombry)
Post by David M. Karr
nQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZ
Post by Tom Bryan (tombry)
Post by David M. Karr
vWVu6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Tom Bryan (tombry)
ailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=5KhxhnQh
Post by Tom Bryan (tombry)
nyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu
Post by Tom Bryan (tombry)
6ULTBdsWOeg&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=5KhxhnQhnyctf3V1EaF89bva189AfbJ-
cixX8Rplgy4&s=ni2u4HPqgrBZTJ7T0YDLFXCOOBsZvWVu6ULTBdsWOeg&e=
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
m=MJuWCGW7
Post by Justin Georgeson
LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662m
Post by Justin Georgeson
FjIoDYpWWWY&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=MJuWCGW7LT6lrT2I3SN1QD4asTdVy-
ZnrfCPp5OnJG0&s=w5vtyzy3eMOAszEoz1mdV4rO6_hU662mFjIoDYpWWWY
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
m=4I8tMYY2
Post by Justin Georgeson
k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLr
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Post by Justin Georgeson
cGIFv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
mBCjCmEiTk&m=4I8tMYY2k40ggyQRL-
_8ChDDwhTU1CPSSkR9NeONVlE&s=igbqvgJ6FWIlM36UrlL5tCha7yrpBhLrcGI
Post by David M. Karr
Post by Justin Georgeson
Post by Justin Georgeson
Fv2fmKIE&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_m
Post by Justin Georgeson
ailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&
Post by David M. Karr
Post by Justin Georgeson
m=PWDjkoTl
zkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9tQa9t0dDKghFvCDIG_wBaZ
Post by David M. Karr
Post by Justin Georgeson
_GfAsO8EQ
Post by Justin Georgeson
GC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=PWDjkoTlzkl4TAo_MaNS9v1DltsaUCYCZpwH3yRpd_w&s=9t
Post by David M. Karr
Post by Justin Georgeson
Qa9t0dDKghFvCDIG_wBaZ_GfAsO8EQGC5sW_1c_qk&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://urldefense.proofpoint.com/v2/url?u=https-3A__dev.eclipse.org_
mailman_listinfo_tycho-2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBR
brMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk
&m=sSQFN
k5tf38Hv8QS1ABSVN7IjST9I6W0t499ixNAcRo&s=SQ3KmET5fHzvsvtV7HlfiGnb
qL4c
Post by David M. Karr
Post by Justin Georgeson
H7zbJLfO8N80Qcw&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit https://urldefense.proofpoint.com/v2/url?u=https-
3A__dev.eclipse.org_mailman_listinfo_tycho-
2Duser&d=CwICAg&c=PskvixtEUDK7wuWU-
tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoE
mBCjCmEiTk&m=sSQFNk5tf38Hv8QS1ABSVN7IjST9I6W0t499ixNAcRo&s=SQ3
KmET5fHzvsvtV7HlfiGnbqL4cH7zbJLfO8N80Qcw&e=
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Jens Reimann
2016-03-09 07:26:47 UTC
Permalink
_______________________________________________
tycho-user mailing list
tycho-***@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Continue reading on narkive:
Loading...