You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mario Ivankovits <ma...@ops.co.at> on 2006/03/13 09:04:48 UTC

"provided" dependendcy still packed in webapp

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: "provided" dependendcy still packed in webapp

Posted by Carlos Sanchez <ca...@apache.org>.
Just send the output of -X in the mail and we'll see

On 3/13/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
>
> > You can try running maven with the -X option an you'll see the
> > dependency resolution. If you don't find the problem just paste here
> > the output
> >
> For what I can see within the "project-app" the jar in question is
> always correctly set top "provided".
> In "project-web" this is not the case I can see that jfreechart requests
> the gnujaxp and that it will be set to scope "compile".
> "project-web" depends on "project-app" but it looks like it takes not
> its dependency overrides.
>
> If you would like to I can send you the -X output through PM (and maybe
> the poms?) - is it ok?
>
> Thanks!
> Ciao,
> Mario
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: "provided" dependendcy still packed in webapp

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!

> You can try running maven with the -X option an you'll see the
> dependency resolution. If you don't find the problem just paste here
> the output
>   
For what I can see within the "project-app" the jar in question is
always correctly set top "provided".
In "project-web" this is not the case I can see that jfreechart requests
the gnujaxp and that it will be set to scope "compile".
"project-web" depends on "project-app" but it looks like it takes not
its dependency overrides.

If you would like to I can send you the -X output through PM (and maybe
the poms?) - is it ok?

Thanks!
Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: "provided" dependendcy still packed in webapp

Posted by Carlos Sanchez <ca...@apache.org>.
You can try running maven with the -X option an you'll see the
dependency resolution. If you don't find the problem just paste here
the output

On 3/13/06, Mario Ivankovits <ma...@ops.co.at> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: "provided" dependendcy still packed in webapp

Posted by Brett Porter <br...@apache.org>.
I've no objection to reviewing provided in 2.1 - please make sure it is
in JIRA and/or the wiki roadmap. I'm not exactly sure if I have reasons
not to make it transitive (I don't think it will break things), it just
doesn't sit well with the view of what provided means - the dependency
shouldn't know or declare anything about the dependees runtime
environment - its up to the project to do that itself.

In fact, I'd very much like to see it superceded by an offshoot of
specification dependencies, as you start to be able to build your
runtime classpath up separately from the compile time classpath, and
specify what specifications an environment provides. I think the current
need to make provides transitive is just a symptom of this being missing.

I don't think we'll see the split you mention about transitivity and
test being different to the others, but it can certainly be a point for
discussion. As for build dependencies, they belong in the build section
under extensions and plugin dependencies as they are now and I'd be
against changing them.

Sorry for the late response, just catching up on some flagged mail.

Would you mind capturing the details in the wiki - since we have
discussed it before it would be good to have a document to use as a
reference point.

Cheers,
Brett

Kenney Westerhof wrote:
> 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 <ma...@ops.co.at> 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: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> --
>> Stephen Duncan Jr
>> www.stephenduncanjr.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: "provided" dependendcy still packed in webapp

Posted by Kenney Westerhof <ke...@apache.org>.
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 <ma...@ops.co.at> 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: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: "provided" dependendcy still packed in webapp

Posted by Kenney Westerhof <ke...@apache.org>.
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 <ma...@ops.co.at> 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: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: "provided" dependendcy still packed in webapp

Posted by Stephen Duncan <st...@gmail.com>.
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...

-Stephen

On 3/13/06, Mario Ivankovits <ma...@ops.co.at> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Stephen Duncan Jr
www.stephenduncanjr.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org