Discussion:
[tycho-user] Can tycho pull a 3rd party (non-osgi) jar into a bundle lib dir and make sure it's on the bundle classpath?
Felix Dorner
2017-04-24 11:03:33 UTC
Permalink
Hi,

I have a plugin that needs a 3rd party (non-osgi) jar in its classpath.
Currently the jar is in a lib folder. I now have to commit the plugin, but
I don't want the .jar in git. Is there some magic maven/tycho helper/trick
that can help me download this jar into the right place on build (button
click) time?

Thanks,
Felix
Sievers, Jan
2017-04-24 11:09:38 UTC
Permalink
one option is to use the maven-dependency-plugin:copy goal, see e.g.

https://github.com/eclipse/tycho/blob/9969737355b3c7ef7db3e88961a3529214a0baa0/tycho-surefire/pom.xml#L59
https://github.com/eclipse/tycho/blob/9969737355b3c7ef7db3e88961a3529214a0baa0/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml#L34

Regards
Jan



On 24.04.17, 13:03, "tycho-user-***@eclipse.org on behalf of Felix Dorner" <tycho-user-***@eclipse.org on behalf of ***@gmail.com> wrote:

Hi,


I have a plugin that needs a 3rd party (non-osgi) jar in its classpath. Currently the jar is in a lib folder. I now have to commit the plugin, but I don't want the .jar in git. Is there some magic maven/tycho helper/trick that can help me download this jar
into the right place on build (button click) time?


Thanks,

Felix
Felix Dorner
2017-04-26 07:33:32 UTC
Permalink
Okay I see. In this case, do you manage the bundle-classpath manifest
entries manually or do you have another trick for that?
Post by Sievers, Jan
one option is to use the maven-dependency-plugin:copy goal, see e.g.
https://github.com/eclipse/tycho/blob/9969737355b3c7ef7db3e88961a352
9214a0baa0/tycho-surefire/pom.xml#L59
https://github.com/eclipse/tycho/blob/9969737355b3c7ef7db3e88961a352
9214a0baa0/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml#L34
Regards
Jan
Hi,
I have a plugin that needs a 3rd party (non-osgi) jar in its classpath.
Currently the jar is in a lib folder. I now have to commit the plugin, but
I don't want the .jar in git. Is there some magic maven/tycho helper/trick
that can help me download this jar
into the right place on build (button click) time?
Thanks,
Felix
_______________________________________________
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
--
Linux. The choice of a GNU generation.
SCHREIBER.Martin
2017-04-26 07:47:35 UTC
Permalink
Hi Felix,

The maven dependency plugin let you specify the output directory where to store the copied/downlaoded resources (in the example pom Jan sent you, that is configured in one of the parent poms):

<configuration>
<outputDirectory>jars</outputDirectory>
<artifactItems>


.
</artifactItems>
</configuration>

The jars should end up in <projectdirectory>/jars and you could add them in your Manifest.MF as you have done it before using the dependency plugin:

e.g.

Bundle-ClassPath: .,
jars/surefire-junit47-2.17.jar,
jars/common-junit48-2.17.jar,
jars/surefire-grouper-2.17.jar


hth
Martin

Von: tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] Im Auftrag von Felix Dorner
Gesendet: Mittwoch, 26. April 2017 09:34
An: Tycho user list <tycho-***@eclipse.org>
Betreff: Re: [tycho-user] Can tycho pull a 3rd party (non-osgi) jar into a bundle lib dir and make sure it's on the bundle classpath?

Okay I see. In this case, do you manage the bundle-classpath manifest entries manually or do you have another trick for that?

On Mon, Apr 24, 2017 at 1:09 PM, Sievers, Jan <***@sap.com<mailto:***@sap.com>> wrote:
one option is to use the maven-dependency-plugin:copy goal, see e.g.

https://github.com/eclipse/tycho/blob/9969737355b3c7ef7db3e88961a3529214a0baa0/tycho-surefire/pom.xml#L59
https://github.com/eclipse/tycho/blob/9969737355b3c7ef7db3e88961a3529214a0baa0/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml#L34

Regards
Jan



On 24.04.17, 13:03, "tycho-user-***@eclipse.org<mailto:tycho-user-***@eclipse.org> on behalf of Felix Dorner" <tycho-user-***@eclipse.org<mailto:tycho-user-***@eclipse.org> on behalf of ***@gmail.com<mailto:***@gmail.com>> wrote:

Hi,


I have a plugin that needs a 3rd party (non-osgi) jar in its classpath. Currently the jar is in a lib folder. I now have to commit the plugin, but I don't want the .jar in git. Is there some magic maven/tycho helper/trick that can help me download this jar
into the right place on build (button click) time?


Thanks,

Felix





_______________________________________________
tycho-user mailing list
tycho-***@eclipse.org<mailto: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
--
Linux. The choice of a GNU generation.
Felix Dorner
2017-04-26 11:09:52 UTC
Permalink
Ok, this works on the command line. Great. Can you explain how I can
'execute' this special section in eclipse/m2e in your example?

<!-- Have m2e execute the jar copy step for easy project import in Eclipse
-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
...

Thanks again for help.
Felix
Felix Dorner
2017-04-26 11:16:41 UTC
Permalink
Oh, I had to 'convert to maven project' and then the copy is executed
during eclipse build. Cool. Thank you again.
Post by Felix Dorner
Ok, this works on the command line. Great. Can you explain how I can
'execute' this special section in eclipse/m2e in your example?
<!-- Have m2e execute the jar copy step for easy project import in Eclipse
-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
...
Thanks again for help.
Felix
--
Linux. The choice of a GNU generation.
Loading...