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

The JAR produced by Tycho are standard Maven artifacts so if you run mvn deploy when your run them, you will be able to deploy them on a standard M2 repository.
So import them in your Mojo project using the Maven coordinates they have and this should be ok.

Regards
Jeff



On Wed, Oct 30, 2013 at 1:53 PM, Henrik Rentz-Reichert <hrr@xxxxxxxxx> 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




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Back to the top