Discussion:
Running TPD to Target before actual build
(too old to reply)
Eugen Neufeld
2018-03-19 17:28:46 UTC
Permalink
Hi,

I would like to use a tpd file (
https://github.com/mbarbero/fr.obeo.releng.targetplatform) for my target
definition.
The Readme of the TPD Project also describes a way of generating the target
file using maven.
I would like to use this, but fail as tycho is trying to resolve the target
before my transformation kicks in.

I know I could run two dedicated mvn commands, but I would like to still be
able to call "mvn clean install" once.

Do you have a suggestion for a possible solution?

Thank you.

Cheers,
Eugen
--
Eugen Neufeld, M.Sc.

Software Engineer / Consultant
EclipseSource Munich

Email: ***@eclipsesource.com
Web: http://eclipsesource.com/munich
Mobil: +49 176 22 85 11 50
Phone: +49 89 21 555 30 - 13
Fax: +49 89 21 555 30 - 19

EclipseSource Muenchen GmbH
Agnes-Pockels-Bogen 1
80992 Muenchen

General Managers: Dr. Jonas Helming, Dr. Maximilian Koegel
Registered Office: Agnes-Pockels-Bogen 1, 80992 Muenchen, Commercial
Register Muenchen, HRB 191789
Pierre-Charles David
2018-03-20 07:14:46 UTC
Permalink
Post by Eugen Neufeld
Hi,
I would like to use a tpd file
(https://github.com/mbarbero/fr.obeo.releng.targetplatform) for my
target definition.
The Readme of the TPD Project also describes a way of generating the
target file using maven.
I would like to use this, but fail as tycho is trying to resolve the
target before my transformation kicks in.
I know I could run two dedicated mvn commands, but I would like to
still be able to call "mvn clean install" once.
Do you have a suggestion for a possible solution?
I'm no expert on the internals of Maven or Tycho, but from what I read
at https://github.com/mbarbero/fr.obeo.releng.targetplatform/issues/73,
Mickael (author of the TPD DSL) seems to think that this is not
possible: "Tycho uses maven extension mechanism to hook up very early in
the maven dependencies resolution mechanism, so
there are little chances you can use a generated .target from the same
maven run."
Sandra Parsick
2018-03-20 07:20:25 UTC
Permalink
Hi,

I ran in the same issue. My workaround was

cd module-where-the-target-definition-is
mvn clean install
cd ..
mvn clean install

Firstly, I generate the TPD and install it in my local M2 Repository,
then I build the whole project and Maven Tycho use the previously
generated TPD.

Best regards,

Sandra
Post by Pierre-Charles David
Post by Eugen Neufeld
Hi,
I would like to use a tpd file
(https://github.com/mbarbero/fr.obeo.releng.targetplatform) for my
target definition.
The Readme of the TPD Project also describes a way of generating the
target file using maven.
I would like to use this, but fail as tycho is trying to resolve the
target before my transformation kicks in.
I know I could run two dedicated mvn commands, but I would like to
still be able to call "mvn clean install" once.
Do you have a suggestion for a possible solution?
I'm no expert on the internals of Maven or Tycho, but from what I read
at https://github.com/mbarbero/fr.obeo.releng.targetplatform/issues/73,
Mickael (author of the TPD DSL) seems to think that this is not
possible: "Tycho uses maven extension mechanism to hook up very early in
the maven dependencies resolution mechanism, so
there are little chances you can use a generated .target from the same
maven run."
_______________________________________________
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
Eugen Neufeld
2018-03-20 08:48:29 UTC
Permalink
Hi,
thank you for the replies.

I hoped that one of the Tycho developers could help with this. I was hoping
for a undocumented life-cycle phase one could use.

Cheers,
Eugen
Post by Sandra Parsick
Hi,
I ran in the same issue. My workaround was
cd module-where-the-target-definition-is
mvn clean install
cd ..
mvn clean install
Firstly, I generate the TPD and install it in my local M2 Repository,
then I build the whole project and Maven Tycho use the previously
generated TPD.
Best regards,
Sandra
Post by Pierre-Charles David
Post by Eugen Neufeld
Hi,
I would like to use a tpd file
(https://github.com/mbarbero/fr.obeo.releng.targetplatform) for my
target definition.
The Readme of the TPD Project also describes a way of generating the
target file using maven.
I would like to use this, but fail as tycho is trying to resolve the
target before my transformation kicks in.
I know I could run two dedicated mvn commands, but I would like to
still be able to call "mvn clean install" once.
Do you have a suggestion for a possible solution?
I'm no expert on the internals of Maven or Tycho, but from what I read
at https://github.com/mbarbero/fr.obeo.releng.targetplatform/issues/73,
Mickael (author of the TPD DSL) seems to think that this is not
possible: "Tycho uses maven extension mechanism to hook up very early in
the maven dependencies resolution mechanism, so
there are little chances you can use a generated .target from the same
maven run."
_______________________________________________
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
--
Eugen Neufeld, M.Sc.

Software Engineer / Consultant
EclipseSource Munich

Email: ***@eclipsesource.com
Web: http://eclipsesource.com/munich
Mobil: +49 176 22 85 11 50
Phone: +49 89 21 555 30 - 13
Fax: +49 89 21 555 30 - 19

EclipseSource Muenchen GmbH
Agnes-Pockels-Bogen 1
80992 Muenchen

General Managers: Dr. Jonas Helming, Dr. Maximilian Koegel
Registered Office: Agnes-Pockels-Bogen 1, 80992 Muenchen, Commercial
Register Muenchen, HRB 191789
Mickael Istria
2018-03-20 08:59:18 UTC
Permalink
Hi,

Mikael's documentation is right.
This is actually a consequence of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=353889 . This is a very hard
bug to fix and since there are decent workarounds for every flavor of it,
it's not one that receive much actual contributions.
For your use-case, there is currently nothing better than what Mikael's
suggests in TPD documentation. Note that it's actually not that bad as it
allows the generated .target file to be published on Nexus, which usually
turns into a good practices when project scales up in number of modules and
developers. So in the end, you're already starting to adopt a best
practice, isn't it cool? ;)
If you'd like to improve this story and contribute code, I suggest you
first audit what makes you use the .tpd files instead of the .target
directly; and instead of tweaking Tycho you may be able to contribute the
support for what you need in .target directly in PDE and Tycho to get rid
of the .tpd and all the complexity brought by the layer of generation.

Cheers,

Loading...