felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Tepp <luol...@gmail.com>
Subject Re: OBR vs Maven
Date Sat, 06 Jun 2015 10:48:56 GMT
To my experience, the biggest difference between OBR (or P2) and Maven is
that with Maven repositories, you declare explicit dependencies between
modules/artifacts whereas in OBR you only declare what your module needs
(packages and their version ranges) in order to function, without
explicitly requestng modules by name.

A good example for this is SLF4J logging library.

With OBR, you just declare that your module depends on org.slf4j
<http://www.slf4j.org/apidocs/org/slf4j/package-summary.html> package and
as long as the runtime environment has a module that exports such a
package, it can provide you those classes. You do not need to declare or
even care at build time which actual implementation provides those packages
and you are completely free to decide it individually in your deployment
configuration.

With Maven, your only concern is your build time dependencies. To be fair,
there you can use *provided* scope to declare a dependency on SLF4 api and
trust that the deployment environment does actually provide those
libraries. Depending on the runtime of your choice, it may be easy or it
may be not

Also, when declaring explicit module level dependencies, you are creating a
hard wired dependency between two modules, that is difficult to evolve
later. This becomes a real headache when you inherit your build time
dependencies in the runtime. The realities of the runtime may be such that
they are in conflict with your build time (you assumed to use Logback
backend implementation, but the runtime platform uses Log4j)

Hard wired module level dependencies are much like class to class
dependencies in code. It makes evolving your API much harder than it should
be, necessitating several layers of compatibility modules, just to have
those so that people downstream, depending on those modules, would not
break after upgrade.

Roland

On Thu, Jun 4, 2015 at 10:02 PM Simon Kitching <simon@vonos.net> wrote:

> Hi,
>
> A maven pom declares dependencies on a set of artifacts with different
> scopes. Maven's dependencies are a pretty generic model, and scopes
> include "compile", "provided", "test" and "runtime".
>
> The "runtime" scope is used for example by the exec-maven-plugin which
> will:
> * download all the necessary dependencies (compile, provided and runtime);
> * create a classpath that points to them; and
> * launch the application's main method
> using just the information in the pom-file.
>
> It seems entirely possible to build an OSGi provisioning system based on
> Maven rather than OBR; every bundle has a pom that defines the artifacts
> it depends on and they can be found and downloaded automatically as the
> exec-maven-plugin demonstrates. Of course this would rely on having
> correct runtime-scope dependencies in maven poms which is often not the
> case, but the principle seems sound.
>
> Now I can see some possible advantages that OBR has over Maven, but I
> would have thought that somebody would already have written a blog
> article about this, or that the info would be on the Felix OBR project's
> wiki or similar. However I just cannot find anything about this topic,
> and hoped somebody here would be able to point me at the relevant info..
>
> I'm familiar with Karaf's features-files which work fine with Maven. I
> know that they also have OBR-related information in them
> (dependency="true") - but I've never understood why that is useful. The
> karaf-cave website describes what it does (how OBR works) but doesn't
> have any information about what advantages OBR-style dependencies have
> over Maven-style dependencies, which is what I was hoping to find.
>
> Thanks,
> Simon
>
> On 06/04/2015 08:32 PM, Jean-Baptiste Onofré wrote:
> > Hi Simon,
> >
> > Maven is build time, OBR is runtime.
> >
> > You can also take a look on:
> > - Karaf and features
> > - Karaf Cave OBR
> >
> > Regards
> > JB
> >
> > On 06/04/2015 08:27 PM, Simon Kitching wrote:
> >> Hi All,
> >>
> >> Can anyone provide me with a link to a comparison of OBR and Maven? I
> >> can find reasonable amounts of information about what OBR does, but
> >> nothing about the motivation to create it given that Maven already
> >> existed...
> >>
> >> Thanks,
> >> Simon
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message