简体   繁体   中英

How to specify version of an Eclipse plugin in Maven pom.xml?

I have configured a Maven build with dependencies to Eclipse plugins, which are collected through a Nexus proxy which points to Maven Central. For example, I need version 2.7.0 of the org.eclipse.emf.common jar in my build. So I added a dependency in the dependency management section of the parent pom with a version like this:

    <dependency>
        <groupId>org.eclipse.emf</groupId>
        <artifactId>org.eclipse.emf.common</artifactId>
        <version>2.7.0</version>
    </dependency>

However, Eclipse plugins usually suffix their version numbers with date and build number, so the plugin is actually org.eclipse.emf.common_2.7.0-v20110520-1406.jar - and it looks as if Maven fails because it believes that a 2.7.0-something is a smaller version than 2.7.0. When put the full version number in my pom, the builds works.

Now my question is: is there a good and maybe agreed upon way to specify a version 2.7.0 or higher, no matter if there are date or build number suffixed to it?

You can check all available versions using search on maven central: http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.emf.common

Specify dependency exists only with date and build number version, so you have to use full version... But there is another dependency (with different group id) that has exact 2.7.0 version.

Just go through all availables artifacts on search.maven.org and pick what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM