You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by John A Pershing Jr <pe...@alum.mit.edu> on 2009/10/08 23:44:07 UTC

provided

Pardon my ignorance, but I'm trying to wade through / debug the 
Hibernate tutorial, and it more-or-less requires the use of Maven to 
build and package the example applications.  I have only figured out 
enough about Maven to be dangerous.

 From reading the documentation, it sounds like the dependency:

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

should make the 'servlet-api' jar available at compile time, but *not* 
package it up into the resulting war file.  However, it *is* including 
this jar in the output war file, which causes Apache to complain.

Do I need some other clause in my pom.xml file to tell Maven that (1) 
the jar really is provided by the runtime, so that (2) I don't want it 
included in the packaged war file?

  -jp


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


Never mind: provided

Posted by John A Pershing Jr <pe...@alum.mit.edu>.
Never mind; I figured it out.

Prior attempts at 'mvn clean' had reported an error, due to an open log 
file in the target directory subtree (due, I think, to a running 
instance of hsqldb that had been launched thru Maven).  What apparently 
happened is that the error caused Maven to totally abort the clean 
process, rather than cleaning everything that it could delete.  This 
left a copy of the 'servlet-api' jar in the target directory tree, which 
then got jarred up into the war file.  After killing hsqldb, 'mvn clean' 
blew away the entire target subtree, so that a subsequent 'mvn package' 
then worked correctly.

Sorry for the interruption -- we now return you to you regular 
programming...

  -jp

John A Pershing Jr wrote:
> Pardon my ignorance, but I'm trying to wade through / debug the 
> Hibernate tutorial, and it more-or-less requires the use of Maven to 
> build and package the example applications.  I have only figured out 
> enough about Maven to be dangerous.
>
> From reading the documentation, it sounds like the dependency:
>
>        <dependency>
>            <groupId>javax.servlet</groupId>
>            <artifactId>servlet-api</artifactId>
>            <version>2.5</version>
>            <scope>provided</scope>
>        </dependency>
>
> should make the 'servlet-api' jar available at compile time, but *not* 
> package it up into the resulting war file.  However, it *is* including 
> this jar in the output war file, which causes Apache to complain.
>
> Do I need some other clause in my pom.xml file to tell Maven that (1) 
> the jar really is provided by the runtime, so that (2) I don't want it 
> included in the packaged war file?
>
>  -jp
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>


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


Re: provided

Posted by Nick Stolwijk <ni...@gmail.com>.
Could it be that you build once without scope provided and so the jar
resides in your target directory? Try a mvn clean install to see if that
clears the problem.

If that doesn't work take a look at the output of mvn dependency:tree to see
where it comes from.

Hth,

Nick Stolwijk
~Java Developer~

IPROFS BV.
Claus Sluterweg 125
2012 WS Haarlem
http://www.iprofs.nl


On Thu, Oct 8, 2009 at 11:44 PM, John A Pershing Jr
<pe...@alum.mit.edu>wrote:

> Pardon my ignorance, but I'm trying to wade through / debug the Hibernate
> tutorial, and it more-or-less requires the use of Maven to build and package
> the example applications.  I have only figured out enough about Maven to be
> dangerous.
>
> From reading the documentation, it sounds like the dependency:
>
>       <dependency>
>           <groupId>javax.servlet</groupId>
>           <artifactId>servlet-api</artifactId>
>           <version>2.5</version>
>           <scope>provided</scope>
>       </dependency>
>
> should make the 'servlet-api' jar available at compile time, but *not*
> package it up into the resulting war file.  However, it *is* including this
> jar in the output war file, which causes Apache to complain.
>
> Do I need some other clause in my pom.xml file to tell Maven that (1) the
> jar really is provided by the runtime, so that (2) I don't want it included
> in the packaged war file?
>
>  -jp
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>