aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven : deploy libraries to WEB-INF/lib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven : deploy libraries to WEB-INF/lib" Watch "Maven : deploy libraries to WEB-INF/lib" New topic
Author

Maven : deploy libraries to WEB-INF/lib

Swerrgy Smith
Ranch Hand

Joined: Mar 26, 2010
Posts: 91
Dear all,

I have some libraries which existe in .m2/repository. But when I start my Tomcat server, I always get the errors that the application did not find these libraries. I have to copy manually these libraries to WEB-INF/lib folder.

How can these libraries be deployed automatically to WEB-INF/lib folder?

Thank you.
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Have you declared your libraries as dependencies in your pom.xml? If not: you should because then Maven will take care copying your libs.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

In your Maven dependencies, what scope did you use? For a "compile" scope, Mavne places the JAR into WEB-INF/lib, for "provided" it does not place the JARs there.


JBoss In Action
Swerrgy Smith
Ranch Hand

Joined: Mar 26, 2010
Posts: 91
Peter Johnson wrote:In your Maven dependencies, what scope did you use? For a "compile" scope, Mavne places the JAR into WEB-INF/lib, for "provided" it does not place the JARs there.


Hi Peter, how can I check what scope I am using?
Adrabi Abderrahim
Greenhorn

Joined: Jan 23, 2011
Posts: 8

hello,

if you've Maven configured, you can just execute command

mvn compile


in root of your maven project (folder that contains pom.xml), but if you're using like eclipse plugin for maven :
- Run As
- Run Configuration
- New Maven Build
- in "Goals" type "compile"
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Swerrgy Smith wrote:
Hi Peter, how can I check what scope I am using?


In your pom you define your dependency e.g. like:


If you are ommitting the scope-tag the default scope (=compile) is used. See also here.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven : deploy libraries to WEB-INF/lib