Uploaded image for project: 'Nuxeo ECM Build/Test Environment'
  1. Nuxeo ECM Build/Test Environment
  2. NXBT-2876

Need help with Maven issues when building the Nuxeo Platform in Jenkins X

    XMLWordPrintable

    Details

    • Type: Problem
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Jenkins X

      Description

      As a first step of NXP-27430, we want to launch mvn compile in a checkout of the nuxeo repository.

      A first try has been done in the task-NXP-27430-platorm-simple-pipeline branch with this Jenkinsfile.

      Pipeline available here: http://jenkins.platform.34.74.59.50.nip.io/job/nuxeo/job/nuxeo/job/task-NXP-27430-platorm-simple-pipeline

      We have 2 main issues to start with:

      1/ Without any Nexus configuration, the build fails with:

      ERROR] [ERROR] Some problems were encountered while processing the POMs:
      [ERROR] Unresolveable build extension: Plugin org.nuxeo.build:ant-assembly-maven-plugin:2.1.1 or one of its dependencies could not be resolved: Could not find artifact org.nuxeo.build:ant-assembly-maven-plugin:jar:2.1.1 in nexus (http://nexus/repository/maven-group/) @ 
       @ 
      [ERROR] The build could not read 1 project -> [Help 1]
      [ERROR]   
      [ERROR]   The project org.nuxeo:nuxeo-ecm:11.1-SNAPSHOT (/home/jenkins/workspace/-NXP-XXX-simple-platorm-pipeline/pom.xml) has 1 error
      [ERROR]     Unresolveable build extension: Plugin org.nuxeo.build:ant-assembly-maven-plugin:2.1.1 or one of its dependencies could not be resolved: Could not find artifact org.nuxeo.build:ant-assembly-maven-plugin:jar:2.1.1 in nexus (http://nexus/repository/maven-group/) -> [Help 2]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      

      This is because of the Maven settings on the pod based on the "maven-java11" pod template (label: "jenkins-maven-java11").
      See https://github.com/jenkins-x/jenkins-x-platform/blob/master/jenkins-x-platform/values.yaml#L2024 or connecting to a devpod:

      jx create devpod -l maven-java11
      cat ~/.m2/settings.xml
      

      So it seems that every Maven request is redirected to the local http://nexus/repository/maven-group/.
      Yet, the nuxeo public repositories don't exist in this Nexus.

      Workaround

      2/ Now the builds goes further but fails with:

       > git rev-list --no-walk 76d3a42164ee8d51c9987ef3bee624841cd97ad1 # timeout=10
      + mvn compile
      Picked up _JAVA_OPTIONS: -XX:+UnlockExperimentalVMOptions -Dsun.zip.disableMemoryMapping=true -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Xms10m -Xmx192m
      [INFO] Scanning for projects...
      [ERROR] Java heap space
      

      See http://jenkins.platform.34.74.59.50.nip.io/job/nuxeo/job/nuxeo/job/task-NXP-27430-platorm-simple-pipeline/1/console

      For now, the Maven options are set to -Xmx3g -Xms512m, done manually in the pipeline: https://github.com/nuxeo/nuxeo/blob/task-NXP-27430-platorm-simple-pipeline/Jenkinsfile#L41.
      Of course, at some point they should probably be part of the pod template definition in the Jenkins master description near the _JAVA_OPTIONS EnvVars.

      I've tried, without success, to increase the "Maven" container's CPU/memory parameters to:

      containers:
            - name: maven
              resources:
                requests:
                  cpu: 400m
                  memory: 4096Mi
                limits:
                  cpu: 4
                  memory: 4096Mi
      

      Done manually through the GCP console.
      Again, once we decide about the right options, they will have to be configured in the pod template part of the Jenkins master description.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h