Quantcast

<scope>provided</scope>

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

<scope>provided</scope>

John A Pershing Jr
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Never mind: <scope>provided</scope>

John A Pershing Jr
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: [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
|  
Report Content as Inappropriate

Re: <scope>provided</scope>

Nick_S
In reply to this post by John A Pershing Jr
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
<[hidden email]>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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Loading...