Showing posts from January, 2012

Bulk upload of maven artifacts to remote repo

If you have an artifact you want to upload to a remote repository (i.e. internal company repo) then you use the command: mvn deploy:deploy-file -Durl=file://C:\m2-repo \ \ -Dfile=your-artifact-1.0.jar \ [-DpomFile=your-pom.xml] \ However if you have more than a few files and they're in a nested directory structure (like your local repo) then this is not the way to do it. There doesn't seem to be any tool for either maven or nexus to do this, so here's a quick and dirty way I hacked together: /** * run as java Importer [dirtosearch] **/ public class Importer { private String directory; private final static String repositoryId = "repo1"; private final static String url = "http://remoteserver/nexus/content/repositories/repo1/"; private final static String mvn = "C:/java/apache-maven-3.0.3/bin/mvn.bat"; /** * @param directory */