File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes synchronizing files in maven 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 "synchronizing files in maven" Watch "synchronizing files in maven" New topic

synchronizing files in maven

Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
Normally, I google and download needed java archive files, then copy them to server folder, and then include the new file into the project and finally I need to google again about what to write in the maven xml file so that maven will have that same file. Is there a way to achieve these three steps in one go?
Jayesh A Lalwani
Saloon Keeper

Joined: Jan 17, 2008
Posts: 2746

Which server are you deploying to? How are you packaging your application

Is it a war that you are deploying to the web server? If you use maven to pacakge your war, it should download all the jars from the dependency tree and put them in the lib folder of the war. You shouldn't need to manually copy the jar into the server
Peter Johnson

Joined: May 14, 2008
Posts: 5852

A few suggestions:

1) What IDE are you using? With Eclipse and the m2e plugin, I can open the pom.xml file, go the the dependencies tab in the POM editor, and click the Add button, This gives me a dialog where I can do a search. I type in part of the artifact name and get a list or artifacts and their versions that match. I then pick the one I want.

2) Maven Central has a search feature. Go to and type in a search term and it will find the artifact you need and provide the necessary dependency information.

3) If you development team has a local Maven repository run by Nexus or Artifactory, they also have search functions that you can use to look up artifacts and get the dependency clause.

JBoss In Action
I agree. Here's the link:
subject: synchronizing files in maven
jQuery in Action, 3rd edition