On Mon, 13 Mar 2006, Stephen Duncan wrote:

(I'm cc-ing the dev list, maybe continue there?)

> It's Maven's decision: http://jira.codehaus.org/browse/MNG-1978
>
> Brett still hasn't been convinced that provided status should be
> transitive.  I don't have any particular use case to argue one way or
> another...

I do. The compiler requires it.

Maybe the semantics of 'provided' need to be changed; it should
indicate 'provided in the RUNTIME environment'. Maven itself is NOT the
runtime environment (except when running plugins perhaps).
Dependencies _could_ end up in the runtime environment, for instance,
dependencies of plugins. In that case, maven _is_ the runtime environment,
and it can simply discard all provided dependencie when building a runtime
classpath for the plugin.

Provided deps, like j2ee api's, when not transitive,
cause compilation errors - Sun's Javac even reports an 'Internal Compiler
Error' in this case. It's because the binaries, that depend on that
'provided' dependency, either use the dep in their api's, in annotations,
or extend from it, or use it in any other way.

The compiler must be able to resolve those classes.

Provided scope simply tells maven that the runtime environment,
whatever that may be, already has that jar in the classpath. So
when maven has to PACKAGE something, like a war or ear, it shouldn't
include that dependency. But it is still very much needed for compilation
(build-time).

I've argued this case several times before in the past, and I certainly
hope we can convince the rest of the team anytime soon.. :)

Splitting up the scope system into 2 scopes: 'compile' and
'runtime', and a set of flags:
- transitive
- test

will allow people to decide wheter a dependency should be transitive or not.
This might cover all the possible use-cases.

(perhaps even add a 'build' scope which maps nicely to the current
'extensions' scheme so we can keep dependencies in one neat list.).


-- Kenney

>
> -Stephen
>
> On 3/13/06, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
> > Hi!
> >
> > I started using maven 2 to build our project and maybe hit a bug now.
> >
> > The project layout is:
> >
> > project
> > +-project-app
> > +-project-web
> >
> > where "project-web" depends on "project-app".
> >
> > One of the dependency is jfreechart which itself depends on e.g. "gnujaxp".
> > Now I dont want to package the gnujaxp and so I though I override its
> > scope to "provided" in "project-app".
> > But "project-web" still package it. Other dependencies defined as
> > "provided" work, it looks like its only a problem if a dependency
> > declares it.
> >
> > I worked around this problem by defining the dependency "gnujaxp" in
> > "project-web" too as "provided" and not its not packaged any more.
> > I think this should not be necessary, no?
> >
> > Is it my or mavens fault?
> >
> > Thanks!
> > Ciao,
> > Mario
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to