my dog learned polymorphism*
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "synchronizing files in maven" Watch "synchronizing files in maven" New topic
Author

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
Bartender

Joined: Jan 17, 2008
Posts: 2414
    
  28

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
author
Bartender

Joined: May 14, 2008
Posts: 5838
    
    7

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 http://repo1.maven.org/maven2/ 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
 
Don't get me started about those stupid light bulbs.
 
subject: synchronizing files in maven