[m2] Excluding dependencies from the runtime classpath

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[m2] Excluding dependencies from the runtime classpath

McGarr, Joseph M.
Hi all,

I have used Maven 1 in my free time and have been trying to migrate my
client to the product as well.  I have just started using M2 and like what I
see but I have a few questions, the first of which is, how do I tell M2 to
include a dependency only in the compile scope and not the runtime scope.

The details of the problem are I am building a war, but I do not want
dependencies like the Servlet API to be bundled in the jar, since the
application server will already provide this.  Any suggestions?  I am
assuming that I have missed something.

Thanks,
Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [m2] Excluding dependencies from the runtime classpath

Jason van Zyl
On Thu, 2005-06-02 at 07:46 -0400, McGarr, Joseph M. wrote:

> Hi all,
>
> I have used Maven 1 in my free time and have been trying to migrate my
> client to the product as well.  I have just started using M2 and like what I
> see but I have a few questions, the first of which is, how do I tell M2 to
> include a dependency only in the compile scope and not the runtime scope.
>
> The details of the problem are I am building a war, but I do not want
> dependencies like the Servlet API to be bundled in the jar, since the
> application server will already provide this.  Any suggestions?  I am
> assuming that I have missed something.

What's your specific use case? Does it happen to be a case where a
container provides the dependency at runtime?

We're trying to collect these use cases now as we're doing design and
implementing in this phase of development i.e. for the alpha-3 release.

> Thanks,
> Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
--
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [m2] Excluding dependencies from the runtime classpath

McGarr, Joseph M.
In reply to this post by McGarr, Joseph M.
Thanks for the response.  To answer your questions plainly, yes, this
happens to be a case where the container is providing the dependency at
runtime.  So my resulting use case would be that I need a method to exclude
a dependency from the runtime classpath, which means it should not be
packaged with that dependency.  Do you need more information?



-----Original Message-----
From: Jason van Zyl [mailto:[hidden email]]
Sent: Thursday, June 02, 2005 10:23 AM
To: Maven Users List
Subject: Re: [m2] Excluding dependencies from the runtime classpath


On Thu, 2005-06-02 at 07:46 -0400, McGarr, Joseph M. wrote:
> Hi all,
>
> I have used Maven 1 in my free time and have been trying to migrate my
> client to the product as well.  I have just started using M2 and like what
I
> see but I have a few questions, the first of which is, how do I tell M2 to
> include a dependency only in the compile scope and not the runtime scope.
>
> The details of the problem are I am building a war, but I do not want
> dependencies like the Servlet API to be bundled in the jar, since the
> application server will already provide this.  Any suggestions?  I am
> assuming that I have missed something.

What's your specific use case? Does it happen to be a case where a
container provides the dependency at runtime?

We're trying to collect these use cases now as we're doing design and
implementing in this phase of development i.e. for the alpha-3 release.

> Thanks,
> Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
--
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [m2] Excluding dependencies from the runtime classpath

Jason van Zyl
On Thu, 2005-06-02 at 10:44 -0400, McGarr, Joseph M. wrote:
> Thanks for the response.  To answer your questions plainly, yes, this
> happens to be a case where the container is providing the dependency at
> runtime.  So my resulting use case would be that I need a method to exclude
> a dependency from the runtime classpath, which means it should not be
> packaged with that dependency.  Do you need more information?

No that's great. This appears to be the case so far where people are
developing container applications and they need to compile artifacts
provided by the container environment but you obviously don't need to
bundle them.

>
>
> -----Original Message-----
> From: Jason van Zyl [mailto:[hidden email]]
> Sent: Thursday, June 02, 2005 10:23 AM
> To: Maven Users List
> Subject: Re: [m2] Excluding dependencies from the runtime classpath
>
>
> On Thu, 2005-06-02 at 07:46 -0400, McGarr, Joseph M. wrote:
> > Hi all,
> >
> > I have used Maven 1 in my free time and have been trying to migrate my
> > client to the product as well.  I have just started using M2 and like what
> I
> > see but I have a few questions, the first of which is, how do I tell M2 to
> > include a dependency only in the compile scope and not the runtime scope.
> >
> > The details of the problem are I am building a war, but I do not want
> > dependencies like the Servlet API to be bundled in the jar, since the
> > application server will already provide this.  Any suggestions?  I am
> > assuming that I have missed something.
>
> What's your specific use case? Does it happen to be a case where a
> container provides the dependency at runtime?
>
> We're trying to collect these use cases now as we're doing design and
> implementing in this phase of development i.e. for the alpha-3 release.
>
> > Thanks,
> > Mike
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
--
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

Simplex sigillum veri. (Simplicity is the seal of truth.)


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [m2] Excluding dependencies from the runtime classpath

Eric Giguere
In reply to this post by Jason van Zyl
Hello guys
I would have a suggestion concerning this.
Right now, my uber-dist plugin allows that. In fact, its implemented the
other way around. You specify using dependencies properties if this
dependency must be deployed or not. If it is, you can override the
deployment directory (so that it can be put in a sub-directory) and
using another property, you can override its deployment name.

The use case...
When we have a project that is deployed on an existing framework,
usually, your project will need the framework libraries to compile, but
of course, you won't have to deploy those libraries since they are
usually part of the framework uppon which your services will get
installed. The frameword installation program takes care of putting all
necessary files where they belong, and it will also (most of the time)
indicate exactly where you must put your own libraries that extends its
functionnalities.

There must be other situations but this one describes in the first place
why I needed the new plugin.

Cheers!
Eric.

Jason van Zyl wrote:

>On Thu, 2005-06-02 at 07:46 -0400, McGarr, Joseph M. wrote:
>  
>
>>Hi all,
>>
>>I have used Maven 1 in my free time and have been trying to migrate my
>>client to the product as well.  I have just started using M2 and like what I
>>see but I have a few questions, the first of which is, how do I tell M2 to
>>include a dependency only in the compile scope and not the runtime scope.
>>
>>The details of the problem are I am building a war, but I do not want
>>dependencies like the Servlet API to be bundled in the jar, since the
>>application server will already provide this.  Any suggestions?  I am
>>assuming that I have missed something.
>>    
>>
>
>What's your specific use case? Does it happen to be a case where a
>container provides the dependency at runtime?
>
>We're trying to collect these use cases now as we're doing design and
>implementing in this phase of development i.e. for the alpha-3 release.
>
>  
>
>>Thanks,
>>Mike
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>
>>    
>>

Reply | Threaded
Open this post in threaded view
|

Re: [m2] Excluding dependencies from the runtime classpath

Bart Selders
In reply to this post by Jason van Zyl
I have another reason for excluding dependencies from the classpath (m2).

I am currently using the concept to specify an external resource (for
example a packaged CSS style library) as a dependency in my pom, and
then using a plugin to process that resource - possibly extract it in my
webapp. For that reason I need a way to tell that this dependency should
*not* be included in any of the current scopes, as this dependency is
not something for on the classpath.

This dependency is i.m.o. not part of the plugin; Rather I want the pom
to specify/overrride which version of this resource must be used.

But may be you see a better solution for this use case...

Bart


Jason van Zyl wrote:

> On Thu, 2005-06-02 at 10:44 -0400, McGarr, Joseph M. wrote:
>
>>Thanks for the response.  To answer your questions plainly, yes, this
>>happens to be a case where the container is providing the dependency at
>>runtime.  So my resulting use case would be that I need a method to exclude
>>a dependency from the runtime classpath, which means it should not be
>>packaged with that dependency.  Do you need more information?
>
>
> No that's great. This appears to be the case so far where people are
> developing container applications and they need to compile artifacts
> provided by the container environment but you obviously don't need to
> bundle them.
>
>


*************************************************************************
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication
without the authority of iBanx bv. iBanx bv is neither liable for
the proper and complete transmission of the information has been maintained
nor that the communication is free of viruses, interceptions or
interference.

If you are not the intended recipient of this communication please return
the communication to the sender and delete and destroy all copies.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [m2] Excluding dependencies from the runtime classpath

Brett Porter
Are these dependencies part of a JAR, or some other type?

There should definitely be a way to generically exclude - but if they
are not in a jar, then it won't be anyway. Maybe a zip is more useful
if it is not intended to be on the classpath and instead just be
extracted?

- Brett

On 6/3/05, Bart Selders <[hidden email]> wrote:

> I have another reason for excluding dependencies from the classpath (m2).
>
> I am currently using the concept to specify an external resource (for
> example a packaged CSS style library) as a dependency in my pom, and
> then using a plugin to process that resource - possibly extract it in my
> webapp. For that reason I need a way to tell that this dependency should
> *not* be included in any of the current scopes, as this dependency is
> not something for on the classpath.
>
> This dependency is i.m.o. not part of the plugin; Rather I want the pom
> to specify/overrride which version of this resource must be used.
>
> But may be you see a better solution for this use case...
>
> Bart
>
>
> Jason van Zyl wrote:
> > On Thu, 2005-06-02 at 10:44 -0400, McGarr, Joseph M. wrote:
> >
> >>Thanks for the response.  To answer your questions plainly, yes, this
> >>happens to be a case where the container is providing the dependency at
> >>runtime.  So my resulting use case would be that I need a method to exclude
> >>a dependency from the runtime classpath, which means it should not be
> >>packaged with that dependency.  Do you need more information?
> >
> >
> > No that's great. This appears to be the case so far where people are
> > developing container applications and they need to compile artifacts
> > provided by the container environment but you obviously don't need to
> > bundle them.
> >
> >
>
>
> *************************************************************************
> The information contained in this communication is confidential and is
> intended solely for the use of the individual or entity to  whom it is
> addressed.You should not copy, disclose or distribute this communication
> without the authority of iBanx bv. iBanx bv is neither liable for
> the proper and complete transmission of the information has been maintained
> nor that the communication is free of viruses, interceptions or
> interference.
>
> If you are not the intended recipient of this communication please return
> the communication to the sender and delete and destroy all copies.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [m2] Excluding dependencies from the runtime classpath

Bart Selders
Brett Porter wrote:
> Are these dependencies part of a JAR, or some other type?

In my current case: yes, they are part of a jar file. There was a time
(long time ago) in maven 1 that zip dependencies were not working, so we
packaged everything in jar files. But you are right this can be handled
  by treating them as zip files.

Bart

> There should definitely be a way to generically exclude - but if they
> are not in a jar, then it won't be anyway. Maybe a zip is more useful
> if it is not intended to be on the classpath and instead just be
> extracted?
>
> - Brett
>
> On 6/3/05, Bart Selders <[hidden email]> wrote:
>
>>I have another reason for excluding dependencies from the classpath (m2).
>>
>>I am currently using the concept to specify an external resource (for
>>example a packaged CSS style library) as a dependency in my pom, and
>>then using a plugin to process that resource - possibly extract it in my
>>webapp. For that reason I need a way to tell that this dependency should
>>*not* be included in any of the current scopes, as this dependency is
>>not something for on the classpath.
>>
>>This dependency is i.m.o. not part of the plugin; Rather I want the pom
>>to specify/overrride which version of this resource must be used.
>>
>>But may be you see a better solution for this use case...
>>
>>Bart
>>
>>
>>Jason van Zyl wrote:
>>
>>>On Thu, 2005-06-02 at 10:44 -0400, McGarr, Joseph M. wrote:
>>>
>>>
>>>>Thanks for the response.  To answer your questions plainly, yes, this
>>>>happens to be a case where the container is providing the dependency at
>>>>runtime.  So my resulting use case would be that I need a method to exclude
>>>>a dependency from the runtime classpath, which means it should not be
>>>>packaged with that dependency.  Do you need more information?
>>>
>>>
>>>No that's great. This appears to be the case so far where people are
>>>developing container applications and they need to compile artifacts
>>>provided by the container environment but you obviously don't need to
>>>bundle them.
>>>
>>


*************************************************************************
The information contained in this communication is confidential and is
intended solely for the use of the individual or entity to  whom it is
addressed.You should not copy, disclose or distribute this communication
without the authority of iBanx bv. iBanx bv is neither liable for
the proper and complete transmission of the information has been maintained
nor that the communication is free of viruses, interceptions or
interference.

If you are not the intended recipient of this communication please return
the communication to the sender and delete and destroy all copies.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]