Search in sources :

Example 6 with ArtifactoryClientConfiguration

use of org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration in project build-info by JFrogDev.

the class ResolutionHelper method init.

public void init(Properties allMavenProps) {
    if (internalConfiguration != null) {
        return;
    }
    Maven3BuildInfoLogger log = new Maven3BuildInfoLogger(logger);
    Properties allProps = BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile(allMavenProps, log);
    internalConfiguration = new ArtifactoryClientConfiguration(log);
    internalConfiguration.fillFromProperties(allProps);
    initialized = true;
}
Also used : ArtifactoryClientConfiguration(org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration) Maven3BuildInfoLogger(org.jfrog.build.extractor.maven.Maven3BuildInfoLogger) Properties(java.util.Properties)

Example 7 with ArtifactoryClientConfiguration

use of org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration in project build-info by JFrogDev.

the class BuildInfoRecorderLifecycleParticipant method getConfiguration.

private ArtifactoryClientConfiguration getConfiguration(MavenSession session) {
    if (internalConfiguration != null) {
        return internalConfiguration;
    }
    Properties allMavenProps = new Properties();
    allMavenProps.putAll(session.getSystemProperties());
    allMavenProps.putAll(session.getUserProperties());
    Maven3BuildInfoLogger log = new Maven3BuildInfoLogger(logger);
    Properties allProps = BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile(allMavenProps, log);
    internalConfiguration = new ArtifactoryClientConfiguration(log);
    internalConfiguration.fillFromProperties(allProps);
    return internalConfiguration;
}
Also used : ArtifactoryClientConfiguration(org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration) BuildInfoConfigProperties(org.jfrog.build.api.BuildInfoConfigProperties) Properties(java.util.Properties)

Example 8 with ArtifactoryClientConfiguration

use of org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration 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

ArtifactoryClientConfiguration (org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration)8 IOException (java.io.IOException)3 Properties (java.util.Properties)2 DeployDetails (org.jfrog.build.client.DeployDetails)2 IncludeExcludePatterns (org.jfrog.build.extractor.clientConfiguration.IncludeExcludePatterns)2 ArtifactoryBuildInfoClient (org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient)2 IvyBuildInfoLog (org.jfrog.build.util.IvyBuildInfoLog)2 Closure (groovy.lang.Closure)1 File (java.io.File)1 ExecutionListener (org.apache.maven.execution.ExecutionListener)1 DefaultTask (org.gradle.api.DefaultTask)1 Project (org.gradle.api.Project)1 Task (org.gradle.api.Task)1 Build (org.jfrog.build.api.Build)1 BuildInfoConfigProperties (org.jfrog.build.api.BuildInfoConfigProperties)1 BuildInfoBuilder (org.jfrog.build.api.builder.BuildInfoBuilder)1 BuildContext (org.jfrog.build.context.BuildContext)1 BuildInfoExtractorUtils.getModuleIdString (org.jfrog.build.extractor.BuildInfoExtractorUtils.getModuleIdString)1 BuildInfoExtractorUtils.getTypeString (org.jfrog.build.extractor.BuildInfoExtractorUtils.getTypeString)1 Maven3BuildInfoLogger (org.jfrog.build.extractor.maven.Maven3BuildInfoLogger)1