Eclipse jars now in Maven repository

After some time trying to figure out what the best conversion from Eclipse plugins / OSGi bundles naming conventions to Maven naming I had finally put many Eclipse plugins in the central Maven repository (see only the Eclipse plugins that got copied in this batch). It’s sometimes a bit tricky, but the main goal was a bidirectional automated translation from Bundle-SymbolicName and Bundle-Version to groupId, artifactId and version in Maven.

Basically you take the BundleId and use the dots to split it. The last section is the artifactId, the rest is the groupId. For the versions they are pretty much the same, only changing dashes and underscores. There’s a maven-osgi library very light that you can use to do these conversions, used by the Maven Eclipse and Felix bundle plugins.

This improves the support for building Eclipse plugins from Maven, although you can do some things already, or using Eclipse libraries from Maven projects. We’ll see more activity in these two fields soon.

Some people complained that you get weird jar names like net-1.0.0-I20070531.jar. Something I’d like to point out is that the repository is just an interface, the way artifacts are stored internally shouldn’t matter to the clients (Maven, Ivy,…). Plugins that generate a flat directory with jars (like assembly, war,…) should take care of renaming the jars to groupId.artifactId, to avoid clashes in the namespace, and so you get a meaningful name out of a hierarchical directory structure.

14 thoughts on “Eclipse jars now in Maven repository

  1. great! but personally I think artifactId should be the same as Bundle-SymbolicName — I think it’s just better if the jars are not too ambigously named. groupId can still be the part of the artifactId minus the part after the last dot.

  2. Does this mean I can finally deprecate the *cough, cough* “undocumented feature” that is the EMF Maven2 site [1]?

    [1] http://download.eclipse.org/modeling/emf/emf/maven2/

    I notice you have EMF 2.1.0 and 2.3.0 in your staging site [2], but nothing in between or since. How often is this site updated?

    [2] http://repo1.maven.org/eclipse-staging/org/eclipse/emf/

    FYI, for a different way to get a Maven2 site, I start with an Eclipse update site [3], and simply reorganize it [4].

    [3] http://www.eclipse.org/modeling/emf/updates/
    [4] http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.releng/scripts/buildMaven.sh?revision=1.1&root=Modeling_Project&view=markup

  3. Please change the naming scheme to include the groupId in the JAR name (i.e. org.eclipse.emf.ecore-2.2.2 instead of ecore-2.2.2).

    In the ecore case, there is little chance of conflict but there are some 20 JARs which are named “ui”, now, and which have very similar version numbers (because of the way the Eclipse release process works). So when I create a release, I will get conflicts in my lib directory.

    I’d also argue for dropping the date from released JARs but that’s a minor issue.

  4. Hi Carlos,

    We (the Apache Directory Studio project) are currently trying to move from Ant/Ivy to Maven as build system.

    Apache Directory Studio is an Eclipse RCP application, so we were very happy when we saw that you added some eclipse jars in the repo.

    However, we experiment issues with some plugins.
    For instance, the org.eclipse.core.runtime.compatibility.registry plugin, version 3.2.100-v20070316, fails at the jar verification in Eclipse.
    I had a closer look at what’s happening and it seems the MANIFEST.MF has been modified. The line “Archiver-Version : Plexus Archiver” has been added and the SHA1-Digest of the runtime_registry_compatibilty.jar has been modified.
    The same thing happens on the org.eclipse.ui.workbench.compatibility plugin, version 3.2.0.I20070319-0010.
    Is it possible to upload a modified version of them ?

    We also wanted to know if you plan to release the latest jars included in 3.3.1.1 versions of Eclipse ?
    We depend on these ones for our RCP application.

    Thanks!

  5. umm, weird that they are modified, i dont think there’s any code for that.
    i looked a few and seems that only the ones in http://repo1.maven.org/maven2/org/eclipse/core/runtime/compatibility/registry/ are modified

    You could open an issue at http://jira.codehaus.org/browse/MECLIPSE
    I’ll try to upload new versions when I have time but probably is not going to be too soon. You could run the eclipse:to-maven goal http://maven.apache.org/plugins/maven-eclipse-plugin/to-maven-mojo.html

  6. Unfortunately I have a problem with the version ranges.

    I put this in my POM:

    org.eclipse
    jface
    3.3.0-I20070606-0010

    And I get:
    Unable to resolve artifact: Couldn’t find a version in [3.3.0-v3346, 3.2.1-v3235e] to match range [3.3.0,4.0.0)

    Are the version numbers ill-formed, is my maven too new, or too old?

    My Maven version is whatever netbeans 6.0.1 bundles.

  7. Hi,
    I am having some troubles building an RCP application with maven. I had to modify DefaultMaven2OsgiConverter. here is a brief explanation of my problem:
    * I have org.eclipse.core.commands_3.4.0.I20080509-2000.jar in my eclipse/plugins directory
    * After a mvn eclipse:to-maven, I have org/eclipse/core/commands/3.4.0-I20080509-2000/commands-3.4.0-I20080509-2000.jar in my repository.
    *Then I try to build a target platform against which I would build my application, so I run mvn eclipse:install-plugins and it generates me a org.eclipse.core.commands_3.4.0.I20080509_2000.jar (notice the _ instead of the – in the qualifier part)

    I am not sure it is a bug and I am not very familiar with maven, but I my opinion doing mvn eclipse:to-maven followed by mvn eclipse :install-plugins I should end up with the same jars, isn’t it ?

    My modifications on DefaultMaven2OsgiConverter was to remove every ‘replaceAll( “-“, “_”)’ form the getVersion(String) method. And everything worked well this way…

    I would appreciate your point of view on this problem.

  8. In regards to MECLIPSE-238 [1], what are your thoughts on the “official Eclipse repo layout” discussion [2] from the dev list?

    If I correctly understand that discussion, the conventional configuration of artifacts which are bundles should be –

    someGroupId
    ${project.groupId}.someArtifactId

    [1] – http://jira.codehaus.org/browse/MECLIPSE-238
    [2] – http://mail-archives.apache.org/mod_mbox/maven-dev/200805.mbox/%3c69ECB380-90D7-4718-BD2D-A0E22A85B555@maven.org%3e

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