I wrote the below code to upload artifact to nexus from Java.
ProcessBuilder pb = new ProcessBuilder(
"curl",
"-v",
"-F r=releases",
"-F hasPom=true",
"-F e=war",
"-F file=/Users/test/workspace/test/pom.xml",
"-F file=/Users/test/workspace/test/target/Test.war",
"-u test:test1234",
"http://localhost:28080/nexus/content");
pb.redirectErrorStream(true);
try {
pb.start();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Doesnt seem to work. Any clue what is the mistake? I dont see an error in console as well.