• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maven : deploy libraries to WEB-INF/lib

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you declared your libraries as dependencies in your pom.xml? If not: you should because then Maven will take care copying your libs.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Swerrgy Smith
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Greenhorn
Posts: 8
Eclipse IDE Opera Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic