in flex-maven-tools/flex-sdk-converter/deployers/maven/src/main/java/org/apache/flex/utilities/converter/deployer/maven/MavenDeployer.java [86:139]
private void doPom(File pom) throws IOException, InterruptedException {
File base = pom.getParentFile();
final String fileName = pom.getName();
String artifactName = fileName.substring(0, fileName.lastIndexOf("-"));
if (artifactName != null) {
File artifacts[] = new File(pom.getParent()).listFiles(new ArtifactFilter());
List<String> processCmdBase = new ArrayList<String>(10);
processCmdBase.add(mvn);
processCmdBase.add("deploy:deploy-file");
processCmdBase.add("-DrepositoryId=" + repositoryId);
processCmdBase.add("-Durl=" + url);
ProcessBuilder processBuilder = null;
String packaging;
String classifier = null;
List<String> processCmd = null;
if (artifacts != null && artifacts.length > 0) {
for (File artifact : artifacts) {
processCmd = new ArrayList<String>(10);
processCmd.addAll(processCmdBase);
classifier = packaging = null;
artifactName = artifact.getName();
packaging = (artifactName.endsWith("rb.swc")) ? "rb.swc" : artifactName.substring(artifactName.lastIndexOf(".") + 1);
try {
classifier = artifactName
.substring(artifactName.indexOf(base.getName()) + base.getName().length() + 1, artifactName.length() - packaging.length() - 1);
} catch (StringIndexOutOfBoundsException ex) {/*has no classifier*/}
processCmd.add("-Dfile=" + artifact.getAbsolutePath());
processCmd.add("-DpomFile=" + pom.getAbsolutePath());
if (classifier != null && classifier.length() > 0) {
processCmd.add("-Dclassifier=" + classifier);
}
processCmd.add("-Dpackaging=" + packaging);
processBuilder = new ProcessBuilder(processCmd);
exec(processBuilder.start());
}
} else {
processCmd = new ArrayList<String>(10);
processCmd.addAll(processCmdBase);
processCmd.add("-Dfile=" + pom.getAbsolutePath());
processCmd.add("-DpomFile=" + pom.getAbsolutePath());
processBuilder = new ProcessBuilder(processCmd);
exec(processBuilder.start());
}
}
}