java.lang.NoSuchFieldError:gradle artifactoryPublish任务期间发生INSTANCE错误

时间:2019-08-26 11:47:58

标签: gradle plugins dependencies war artifactory

我们正在尝试将配置了gradle 4.0的项目迁移到gradle 5.6(最新)。看起来与httpclient(apache)组件存在依赖关系问题,该组件在war软件包的发布期间生成此异常。

这是一个gradle项目,root(容器)项目包含用于包装的war插件,jfrog制品4.9.8用于发布,所有子项目都是Java项目,并提供了其依赖项列表(包括httpclient 4.5.9和httpcore 4.4 .11)。

-- root
plugins {
    id 'war'
    id 'maven-publish'
    id 'org.sonarqube' version '2.7'
    id 'net.researchgate.release' version '2.6.0'
    id 'com.github.spotbugs' version '2.0.0' apply false
    id 'com.jfrog.artifactory' version '4.9.8'
}

-- subprojects
dependencies {
      ..
      compile 'org.apache.httpcomponents:httpclient:4.5.9'
      ..
      configurations.all {
            force 'org.apache.httpcomponents:httpcore:4.4.11'
            force 'org.apache.httpcomponents:httpclient:4.5.9'
      }
}

./ gradlew人工制品发布

  • 出了什么问题: 任务':artifactoryDe​​ploy'的执行失败。
      

    实例

Caused by: java.lang.NoSuchFieldError: INSTANCE
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.getDefaultRegistry(PoolingHttpClientConnectionManager.java:109)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:116)
        at org.jfrog.build.client.PreemptiveHttpClient.<init>(PreemptiveHttpClient.java:57)
        at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:145)
        at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:140)
        at org.jfrog.build.client.ArtifactoryHttpClient.executeGetRequest(ArtifactoryHttpClient.java:184)
        at org.jfrog.build.client.ArtifactoryHttpClient.getVersion(ArtifactoryHttpClient.java:154)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBaseClient.getArtifactoryVersion(ArtifactoryBaseClient.java:109)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.tryChecksumDeploy(ArtifactoryBuildInfoClient.java:705)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:664)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.doDeployArtifact(ArtifactoryBuildInfoClient.java:367)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:355)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:340)
        at org.jfrog.gradle.plugin.artifactory.task.DeployTask.deployArtifacts(DeployTask.java:262)
        at org.jfrog.gradle.plugin.artifactory.task.DeployTask.prepareAndDeploy(DeployTask.java:113)
        at org.jfrog.gradle.plugin.artifactory.task.DeployTask.collectProjectBuildInfo(DeployTask.java:50)
        at org.jfrog.gradle.plugin.artifactory.task.DeployTask.taskAction(DeployTask.java:44)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)

0 个答案:

没有答案