Discussion:
Packaging type for EMF standalone (CLI) app?
(too old to reply)
Stefan Sobernig
2015-03-02 22:15:32 UTC
Permalink
I am working on a EMF-based app which allows to execute QVTo
transformations from the command line ("EMF + QVTo standalone"),
packaged as a single fat jar.
What would be an adequate packaging type to maintain this app using Tycho?

1) An ordinary Maven project (resolving the deps from Maven central)
does not appear as an option, as at least the QVTo dependencies are not
provided (and EMF is not guaranteed to be kept up to date).
2) For me, as a Tycho novice, none of the packaging types appears to be
a candidate for this scenario; at the same time, if I understood
correctly, I cannot benefit from Tycho's p2 dependency resolution from
any other, non-Tycho packaging type (e.g. "jar").

Any hints would be highly appreciated!

Stefan

P.S.: When screening the tycho-user archives, I read sth. about using
"eclipse-feature" and keep a dummy feature around.
Stefan Sobernig
2015-03-03 11:28:58 UTC
Permalink
Post by Stefan Sobernig
What would be an adequate packaging type to maintain this app using Tycho?
By now, I noticed the recipe discussed over at stackexchange: P2
repackaging + multi-module setup.

See
http://stackoverflow.com/questions/12240401/how-can-i-use-eclipse-p2-repositories-from-maven

Is this authoritative approach, or is there anything more straightforward?

Best,
Stefan
Mickael Istria
2015-03-09 18:44:11 UTC
Permalink
Here is a possible way to do it:
* Create your application as an "eclipse-product" (so you get all the
happiness provided by p2)
* Create a module that would be build after your eclipse-product and
that would collect the content of the plugins/ folder of your
eclipse-product and zip it (so you get a fat jar)

HTH
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets
<http://twitter.com/mickaelistria>
Stefan Sobernig
2015-03-24 14:55:11 UTC
Permalink
Hi Mickael!
Post by Mickael Istria
* Create your application as an "eclipse-product" (so you get all the
happiness provided by p2)
* Create a module that would be build after your eclipse-product and
that would collect the content of the plugins/ folder of your
eclipse-product and zip it (so you get a fat jar)
Thx for your response!

For the time being, I realized an approach which works for me (but
appears most probably arcane to Maven and Tycho pros):

https://github.com/mrcalvin/qvto-cli

I am not very happy with certain decisions baked into my solution (eg.
all the mess just to preserve the Jar-in-Jar loader throughout the Maven
processing chain). But I needed something to get started.

I had no time dig deep into the reasons why the QVTo standalone
execution fails unless preserving the jars as they come in P2 etc (which
is a different story, as it also fails when creating executable jars
from within Eclipse also).

It will certainly improve over time. Any feedback is welcome.

Stefan
Stefan Sobernig
2016-02-09 14:54:45 UTC
Permalink
Dear all,

Is there a way to turn each plugin jar, obtained from my Eclipse product
[1], into a separate maven artifact (rather than a fat jar), which can
then be referenced as a (group) dependency from another maven project?

The reason is that as a (repackaged) fat jar another maven project
cannot properly use the fat-jar maven artifact as a dependency: mvn
compile, java:exec, test, etc. will not be aware of the jars-in-jar
structure.

Thanks for any hints!

Stefan

[1] https://github.com/mrcalvin/qvto-cli/blob/master/qvt-bundle/qvto.product
Post by Stefan Sobernig
Hi Mickael!
Post by Mickael Istria
* Create your application as an "eclipse-product" (so you get all the
happiness provided by p2)
* Create a module that would be build after your eclipse-product and
that would collect the content of the plugins/ folder of your
eclipse-product and zip it (so you get a fat jar)
Thx for your response!
For the time being, I realized an approach which works for me (but
https://github.com/mrcalvin/qvto-cli
I am not very happy with certain decisions baked into my solution (eg.
all the mess just to preserve the Jar-in-Jar loader throughout the
Maven processing chain). But I needed something to get started.
I had no time dig deep into the reasons why the QVTo standalone
execution fails unless preserving the jars as they come in P2 etc
(which is a different story, as it also fails when creating executable
jars from within Eclipse also).
It will certainly improve over time. Any feedback is welcome.
Stefan
Sievers, Jan
2016-02-09 16:24:22 UTC
Permalink
not sure if I got your scenario right.

If what you have are bundles with nested jars: get rid of the nested jars by inlining them into the bundle jar.
Nested jars are legacy from pre-eclipse 3.0 days and can cause various problems down the line [1].

Regards
Jan

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=111238#c11
Post by Stefan Sobernig
Dear all,
Is there a way to turn each plugin jar, obtained from my Eclipse product [1], into a separate maven artifact (rather than a fat jar), which can then be referenced as a (group) dependency from another maven project?
The reason is that as a (repackaged) fat jar another maven project cannot properly use the fat-jar maven artifact as a dependency: mvn compile, java:exec, test, etc. will not be aware of the jars-in-jar structure.
Thanks for any hints!
Stefan
[1]
https://github.com/mrcalvin/qvto-cli/blob/master/qvt-bundle/qvto.product <https://github.com/mrcalvin/qvto-cli/blob/master/qvt-bundle/qvto.product>
Hi Mickael!
* Create your application as an "eclipse-product" (so you get all the happiness provided by p2)
* Create a module that would be build after your eclipse-product and that would collect the content of the plugins/ folder of your eclipse-product and zip it (so you get a fat jar)
Thx for your response!
https://github.com/mrcalvin/qvto-cli
I am not very happy with certain decisions baked into my solution (eg. all the mess just to preserve the Jar-in-Jar loader throughout the Maven processing chain). But I needed something to get started.
I had no time dig deep into the reasons why the QVTo standalone execution fails unless preserving the jars as they come in P2 etc (which is a different story, as it also fails when creating executable jars from within Eclipse also).
It will certainly improve over time. Any feedback is welcome.
Stefan
Stefan Sobernig
2016-02-09 17:22:28 UTC
Permalink
Hi Jan,
Post by Sievers, Jan
If what you have are bundles with nested jars: get rid of the nested jars by inlining them into the bundle jar.
Well, what I build using Tycho and following Mickael's suggestions below ...
Post by Sievers, Jan
Post by Stefan Sobernig
* Create your application as an "eclipse-product" (so you get all the happiness provided by p2)
* Create a module that would be build after your eclipse-product and that would collect the content of the plugins/ folder of your eclipse-product and zip it (so you get a fat jar)
Thx for your response!
is a fat jar including X jars taken from the product's plugin/ directory:

superjar.jar
`- plugin1.jar
`- plugin2.jar
`- *.jar
`- org.eclipse.jdt.internal.jarinjarloader.*

I am not so confident that simply inlining them into one, flattened jar
is a viable solution as the plugins come with per-plugin resources
(plugin.properties etc.) which do not necessarily merge easily, don't they?

Thx, Stefan

Loading...