• 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

Needs to Import Other JAR Files to My Spring Web Services Project

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I use the Maven to build my web services project that uses the Spring framework.

It took me quite a while to sort out all the dependencies (such as the Spring framework, logging framework, etc.) in the "pom.xml" file and my very simple test project is up and running.

I have to do the real task now.

My real project Java classes have lots of import statements such as


And I have the JAR files for those packages. My question is where I should put those JARs? My project has the standard directory structure as show below. The proper places I can think of are either the "resources" folder or the "lib" folder. I am probably not on the right track. Please advise. Thank you.

-- src
-- main
-- java
-- resources
-- webapp
-- META-INF
-- WEB-INF
-- lib

 
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
Either deploy in your local maven repository (http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html) or use a an repositoriy manager like Nexus. In both cases you will reference your JAR in your pom like any other dependency.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The maven pom file determines where to put the jars. Maven can build a war file, ear file or just a jar file. In the dependency tag, there is <scope> and the default scope will be to include it in your archive. If you use <scope>provided</scope> then the dependency will not be included in your archive. It is all a build issue.

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic