File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Needs to Import Other JAR Files to My Spring Web Services Project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Needs to Import Other JAR Files to My Spring Web Services Project" Watch "Needs to Import Other JAR Files to My Spring Web Services Project" New topic
Author

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

Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
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

Joined: Nov 27, 2006
Posts: 423

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

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Needs to Import Other JAR Files to My Spring Web Services Project