Search code examples
jenkinsartifactorylarge-files

Jenkins hangs while deploying large files to Artifactory


When our Jenkins project pipelines produce jar files with sizes close to 60 MB or more and try to deploy them to Artifactory, they just hang and never finish.

For smaller jar files - below 10 MB - there is no problem.

We are using Jenkins version 2.414.1 and Artifactory Commercial License version 7.68.7 rev 76807900. Jenkins uses Artifactory Plugin 3.18.9, Maven Integration Plugin 3.23 and JFrog Plugin 1.5.0.

We have configured the Artifactory tomcat like this:

tomcat: connector: extraConfig: "maxPostSize='-1' connectionTimeout='1500000'"

There is no logging in Artifactory or Jenkins indicating a problem.

We have searched for similar problems posted on stackoverflow and similar sites, but we haven't found any.

Most developers using this type of setup have had it working without problems for large WAR files. Our applications are based on Spring Boot 3 that produces very large jar files. Could our problem be caused by either Jenkins or Artifactory being confused by the very large jar files?


Solution

  • I found a solution.

    First, you should install JFrog Cli on Jenkins. In the jenkinsfile of your project, you should add:

    jfrog 'jfrog-cli'
    

    to tools. I the deployment stages, you should have the following steps:

    jf 'rt mvn-config'
    jf 'rt mvn clean install -DskipTests -DskipITs  deploy:deploy' // build & deploy artifacts
    jf 'rt bp' // publish build info
    

    Finally, in your pom.xml, you should add:

        <distributionManagement>
            <repository>
                <id>libs-release-local</id>
                <url>artifactory-server-url/artifactory/libs-release-local</url>
            </repository>
            <snapshotRepository>
                <id>libs-snapshot-local</id>
                <url>artifactory-server-url/artifactory/libs-snapshot-local</url>
            </snapshotRepository>
        </distributionManagement>
    

    Rememeber to add Artifactory credentials for your repository id's in the maven settings.xml.