use of org.jfrog.build.context.BuildContext in project build-info by JFrogDev.
the class ArtifactoryBuildListener method assertInitialized.
private void assertInitialized(BuildEvent event) {
if (buildInfoLog != null) {
buildInfoLog.setProject(event.getProject());
return;
}
try {
buildInfoLog = new IvyBuildInfoLog(event.getProject());
ArtifactoryClientConfiguration clientConf = new ArtifactoryClientConfiguration(buildInfoLog);
Properties props = getMergedEnvAndSystemProps();
clientConf.fillFromProperties(props);
ctx = new BuildContext(clientConf);
DEPENDENCY_TRIGGER.setIvyBuildContext(ctx);
PUBLISH_TRIGGER.setIvyBuildContext(ctx);
buildInfoLog.info("[buildinfo:ant] Artifactory Build Info Listener Initialized");
} catch (Exception e) {
RuntimeException re = new RuntimeException("Fail to initialize the Ivy listeners for the Artifactory Ivy plugin, due to: " + e.getMessage(), e);
if (buildInfoLog != null && buildInfoLog.getProject() != null) {
buildInfoLog.error(re.getMessage(), e);
}
throw re;
}
}
Aggregations