Project Dash m4e Tools – Create Maven Artifacts From Eclipse Plug-ins

[UPDATE] There is now a testing repo which contains Eclipse 3.6.2

If you use Maven and Eclipse, you know the pain: How do I convert Eclipse plug-ins into Maven artifacts?

The simple step is to run mvn eclipse:make-artifacts (or the ill fated eclipse:to-maven).

But that’s only half of the work. A few of the plug-ins have bad dependencies (stuff isn’t declared optional, polluting your runtime classpath; versions of dependencies are missing). And a major problem is source attachments. Eclipse separates those from the binaries, so you end up with org.eclipse.core.runtime and org.eclipse.core.runtime.sources.

A few days ago, bug 337068 – “Please set up maven.eclipse.org” was fixed. The site exists and there is even a Nexus running on it.

Unfortunately, it’s a bit empty for now. We’re working on it 🙂

One of the first steps is a set of tools that takes downloads from eclipse.org and converts them into proper Maven artifacts – with source and all.

Welcome Project Dash m4e Tools. A preliminary version is available on github: https://github.com/digulla/org.eclipse.dash.m4e.tools

It consists of three tools so far:

  1. m4e-import can import downloads (archived or unpacked) into a temporary Maven 2 repository. Your own local repository (${user.home}/.m2/repository) is left untouched!
  2. m4e-merge can merge several a temporary Maven 2 repositories into one.
  3. m4e-attach-sources tries to find all source bundles, moves+renames the source JAR to the right place and name and deletes the unnecessary folder.

Next step is a tool to patch the artifacts. One open issue is: How to handle dependencies which come from Project Orbit (bundling third party libraries for Eclipse projects).

Please visit Bug 340416 – “Resolving dependencies from Project Orbit” if you have an opinion.

6 Responses to Project Dash m4e Tools – Create Maven Artifacts From Eclipse Plug-ins

  1. […] days ago, I told you about Project Dash and my new tools for it. Well, we did run them over the weekend and import a lot of stuff from Eclipse 3.6.2 into a […]

  2. Ron Pomeroy says:

    Will these “proper Maven artifacts” include a (portable) tycho build in the source?

    • digulla says:

      Not yet. The first step is to get all Eclipse JARs into a Maven repository to allow to use them from Maven itself.

      The next step is to provide some example POMs which Eclipse developers can copy to build Eclipse projects with Tycho.

      • Ron Pomeroy says:

        Thanks,

        Another quick question and I’ll let you get back to business 🙂

        How will dependencies be expressed – in Maven terms or in Manifests or some mix? My understanding is that Tycho currently only supports Manifest-first, so I’m wondering if you’re trying to bridge that gap or if you’re just trying to allow non-osgi programs to consume bundles that don’t have a strict osgi dependencies.

        Regards

        Ron

      • digulla says:

        My work just allows Maven builds to use OSGi bundles without the need to bring Tycho, p2, etc. into the picture.

        Think of it as a set of scripts to fill Maven Central with anything you can download from eclipse.org.

  3. […] Project Dash m4e Tools – Create Maven Artifacts From Eclipse Plug-ins […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s