• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • 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

 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic