Search in sources :

Example 1 with BuildContext

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;
    }
}
Also used : ArtifactoryClientConfiguration(org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration) BuildContext(org.jfrog.build.context.BuildContext) IvyBuildInfoLog(org.jfrog.build.util.IvyBuildInfoLog) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 BuildContext (org.jfrog.build.context.BuildContext)1 ArtifactoryClientConfiguration (org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration)1 IvyBuildInfoLog (org.jfrog.build.util.IvyBuildInfoLog)1