Skip to content

Prototype work for aether range resolver implementation which honor osgi bounds.

Notifications You must be signed in to change notification settings

Code-House/maven-osgi-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aether OSGi Range Resolver

This project demonstrates how to customize version range resolution within aether. By default version ranges resolved by aether are not compatible with osgi specific ranges. This brings some downsides because some properties must be declared twice - one for maven and another for osgi.

To avoid troubles a small customization of version resolver has been created.

Current troubles

While this code is pretty messy and does embed osgi.core jar it does quite simple thing. Most of code comes from requirements of aether api implementations. For example maven’s DefaultVersionRangeResolver despite of its name is not meant to be extended which brought most of code to this project. Test classes (beyond OsgiVersionRangeResolverTest) is copy of aether-impl version test classe.

Usage in Maven build

To take benefit of OSGi version ranges please create in root of your multi module project .mvn/extensions.xml file and place there:

<?xml version="1.0" encoding="UTF-8"?>
<extensions>
    <extension>
        <groupId>org.code-house.maven</groupId>
        <artifactId>osgi</artifactId>
        <version>[version]</version>
    </extension>
</extensions>

Version range types

Main difference between Maven and OSGi is how they understand versioning in general and then how they treat ranges. For example both allows to specify "default" version. In case of Maven it’s RELEASE, in case of OSGi it will be 0.0.0. Maven users can also point to latest available snapshot in any version by using LATEST version on dependency. This has no effect in OSGi since it does not distinguish version types.

Strict

Strict resolver always uses OSGi logic for resolving versions.

Compatible

Compatible resolver uses OSGi range logic but keeps maven’s version types allowing to order versions in natural way (ie. SNAPSHOT < RELEASE).

Discamler

Even if maven uses Eclipse Aether (which is abandoned and being transferred to Apache Software Foundation) which uses component oriented architecture, coupling between different types is so high that changing this logic might bring side effects. Always verify your build after plugging in this extension.

This extension overrides single core component from maven core and might not work with further versions of maven. See investigation notes on [maven users](http://markmail.org/message/z6x27umabwqhdjvy) and [developers](http://markmail.org/message/r2jnrtwrio75v4zq) mailing lists.

About

Prototype work for aether range resolver implementation which honor osgi bounds.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages