Jenkins pipeline build microservice

34 views Asked by At

good day, I have the following problem I have a microservice that in the pom.xml reference a library that is uploaded in artefactory jfrog called logs and is generating this certificate error "KIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target ->" but I do not know how I can solve the problem I share the pipeline and other settings

pipeline {
  agent { label 'microservicios'}

  stages {

    stage('Integración Continua'){
      steps{
        script{
            container('maven'){
            compile()
                }
        }
      }
    }
  }
}

def compile(){
  configFileProvider([configFile(fileId: 'settings.xml', targetLocation: '.')]) {

      sh "mvn clean --settings settings.xml  install -Prelease -X -Dmaven.wagon.http.ssl.insecure=true"
     
  }
}

and the settings.xml file which is in jenkins Config File Management

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <activeProfiles>
    <activeProfile>librerias</activeProfile>
  </activeProfiles>
  <profiles>
     <profile>
      <id>librerias</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
        </repository>
        <repository>
          <id>artifactory-cloud</id>
          <url>https://devops/jfrog/librerias</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>
  <servers>
     <server>
      <id>artifactory-cloud</id>
      <username>admin</username>
      <password>*****</password>
    </server>
  </servers>
</settings>

when compiling the microservice, the following error occurs

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.548 s
[INFO] Finished at: 2024-03-25T13:29:22Z
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "release" could not be activated because it does not exist.
[ERROR] Failed to execute goal on project prueba-mensajes-java: Could not resolve dependencies for project com.librerias:prueba-mensajes-java:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.librerias:logs-java:jar:develop: Failed to read artifact descriptor for com.librerias:logs-java:jar:develop: Could not transfer artifact com.librerias:logs:pom:develop from/to artifactory-cloud (https://devops/jfrog/librerias): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
0

There are 0 answers