Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] how to use OSGi bundles as plain jars in a MOJO

There are two ways:
1) you download the jars directly into your plugin
2) if the etrice build artifacts have been published to a maven repo (like jgit and other projects do it), then you can add dependencies to those artifacts using Maven dependencies. However you will need to each and every single jar you need because the pom.xml don't carry the inter-bundle dependencies.

Pascal

On 10/30/2013 08:53 AM, Henrik Rentz-Reichert wrote:
Hi Pascal,

the point is that my mojo has dependencies to jars which are eTrice and other bundles.
To be able to refer to them in my mojo's pom they have to be installed as Maven artifacts, right?

The question is now: how can I install the needed artifacts (OSGi bundles)?
As I said, I need just the class contents of the jars. No OSGi environment is needed to execute the generator.

Thanks,
Henrik

Am 30.10.2013 13:20, schrieb Pascal Rapicault:
Hi,

As far as I tell, your Maven plugin does not have any tycho specific dependencies, as such you just need to write a standard mojo (Mojo is the name for maven plugins).
To get started as this from the IDE. Install m2e, then create a new "Maven project", press next, next again. Now you see a page called "Select an Archetype", in this list find the item whose artifact-id is maven-archetype-mojo, select it and complete the wizard.
You now have a new project all setup.

To build it, proceed like for any Maven project (which includes Tycho) and do mvn install.

HTH

Pascal

On 10/30/2013 08:07 AM, Henrik wrote:
Hi,

I'm co-project lead of the Eclipse eTrice project.
We have a code generator that produces Java code from our ROOM models.
The generator is an OSGi bundle that has dependencies to other eTrice bundles and to framework bundles like EMF, platform and the like.
Currently we can invoke the generator from a launcher or we call it from the command line without OSGi having the required jars on the class path.

Now we would like to wrap the generator in a Maven plug-in to participate in the generate-sources phase.

I assume we should create Maven artifacts from the involved eTrice plug-ins to be able to consume them in the mojo build.
Does Tycho help to produce standard Maven artifacts or does it only produce p2 repositories?

I would be grateful for an answer to my question and possibly some hints how to set up my generator-mojo.

-Henrik



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top