// configures the build repo
String resolver = subModule.getProperty(EasyAntMagicNames.EASYANT_BUILD_REPOSITORY);
subModule.log("Publishing in build scoped repository", Project.MSG_INFO);
// Publish on build scoped repository
IvyPublish ivyPublish = new IvyPublish();
ivyPublish.setSettingsRef(IvyInstanceHelper.buildProjectIvyReference(subModule));
ivyPublish.setResolver(resolver);
// TODO: this should be more flexible!
ivyPublish.setArtifactspattern(artifactsDir.getAbsolutePath()
+ "/[artifact](-[classifier]).[ext]");
// not all sub-build targets will generate ivy
// artifacts. we don't want to fail
// a successful build just because there's nothing to
// publish.
ivyPublish.setWarnonmissing(false);
ivyPublish.setHaltonmissing(false);
ivyPublish.setProject(subModule);
ivyPublish.setOwningTarget(getOwningTarget());
ivyPublish.setLocation(getLocation());
ivyPublish.setOverwrite(overwrite);
ivyPublish.setTaskName("publish-buildscoped-repository");
ivyPublish.execute();
} else {
subModule.log("Skipping publish because " + artifactsDir.getPath() + " is not a directory",
Project.MSG_VERBOSE);
}
}