private boolean haltOnFailure = true;
private boolean installOriginalMetadata = false;
public void doExecute() throws BuildException {
Ivy ivy = getIvyInstance();
IvySettings settings = ivy.getSettings();
if (organisation == null) {
throw new BuildException("no organisation provided for ivy publish task: "
+ "It can either be set explicitely via the attribute 'organisation' "
+ "or via 'ivy.organisation' property or a prior call to <resolve/>");
}
if (module == null && PatternMatcher.EXACT.equals(matcher)) {
throw new BuildException("no module name provided for ivy publish task: "
+ "It can either be set explicitely via the attribute 'module' "
+ "or via 'ivy.module' property or a prior call to <resolve/>");
} else if (module == null && !PatternMatcher.EXACT.equals(matcher)) {
module = PatternMatcher.ANY_EXPRESSION;
}
if (revision == null && PatternMatcher.EXACT.equals(matcher)) {
throw new BuildException("no module revision provided for ivy publish task: "
+ "It can either be set explicitely via the attribute 'revision' "
+ "or via 'ivy.revision' property or a prior call to <resolve/>");
} else if (revision == null && !PatternMatcher.EXACT.equals(matcher)) {
revision = PatternMatcher.ANY_EXPRESSION;
}
if (branch == null && PatternMatcher.EXACT.equals(matcher)) {
branch = settings.getDefaultBranch(ModuleId.newInstance(organisation, module));
} else if (branch == null && !PatternMatcher.EXACT.equals(matcher)) {
branch = PatternMatcher.ANY_EXPRESSION;
}
if (from == null) {
throw new BuildException(
"no from resolver name: please provide it through parameter 'from'");
}
if (to == null) {
throw new BuildException(
"no to resolver name: please provide it through parameter 'to'");
}
ModuleRevisionId mrid = ModuleRevisionId
.newInstance(organisation, module, branch, revision);
ResolveReport report;
try {
report = ivy.install(
mrid,
from,
to,
new InstallOptions().setTransitive(transitive).setValidate(doValidate(settings))
.setOverwrite(overwrite).setConfs(conf.split(","))