maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From João Pedro <pedro.j...@gmail.com>
Subject Re: How to install the impl module for a api dependency in maven
Date Tue, 05 Nov 2013 13:08:45 GMT
Thanks, i think that i can use the compiler scopes to resolve the
dependencies.

But in order to have one war per "flavor" i have to move all my resources,
like jsp's, out of my war and into a child war project rigth? and create
more than one top level war with the dependencies to the diferente impl
modules.

was this what you meant by one project per "flavour"?


On Tue, Nov 5, 2013 at 12:00 PM, Anders Hammar <anders@hammar.net> wrote:

> I don't fully understand what you want to accomplish, but, as you point
> out, profiles is not the right path. It almost never is. :-)
>
> What I think you want to do is to have compile scope dependencies to your
> api artifacts from the impl projects. And then in the war project
> ("presentation module") you declare deps to the artifacts you need (you
> have a dependency to), which should include impl artifacts as they are
> needed. In your war project I would assume that you have some kind of
> compile time dependency to your impl code, and if so you need to declare
> that. If you don't have a compile time dependency, then you have a runtime
> dependency and then specify that (scope 'runtime').
>
> If you want different flavors of your webapp, then you create one war
> project per "flavor".
>
> /Anders
>
>
> On Tue, Nov 5, 2013 at 11:50 AM, João Pedro <pedro.joao@gmail.com> wrote:
>
> > I have a multi-module maven project structured in something like this:
> >
> > parent
> >    |
> >    |-presentation
> >    |+services
> >    |    |-services-api
> >    |    |-services-impl
> >    |+data-access
> >    |    |-data-access-api
> >    |    |-data-access-impl
> >    |-+connector
> >    |    |-connector-api
> >    |    |-connector-implA
> >    |    |-connector-implB
> >    |-...
> >
> > The presentation module is packaged in a war and it depends only on the
> api
> > modules.
> >
> > When i run the install goal the only dependencies that the war installs
> are
> > the api modules. To choose wich impl modules to install in the
> presentation
> > module i'm using profiles that add the dependency to the impl modules at
> > build time depending on the profiles selected.
> >
> > From what i've been reading i don't think that this is correct usage for
> > the maven profiles.
> >
> > What is the best way to tell maven to add the chosen impl to the
> > presentation module?
> >
> >
> > I would like to keep the dependency to only the api module but with the
> > usage of profiles, if the profile is active, the dependency is there and
> no
> > compilation errors will happen when i reference a class of the impl
> > module...
> > thanks
> > --
> > Cumprimentos,
> > João Pedro
> >
>



-- 
Cumprimentos,
João Pedro

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