Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43446

java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: maven-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.46.1
      Maven 3.5.0
    • Similar Issues:

      Description

      Hi, after upgrading Maven to the latest version, 3.5.0, the following error occurs during a build of a maven job:

       
      Executing Maven: -B -f [...]/pom.xml install
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
      at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
      at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      at hudson.remoting.Request$2.run(Request.java:336)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
      at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.settings(DefaultMavenExecutionRequestBuilder.java:658)
      at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:149)
      at org.jvnet.hudson.maven3.launcher.Maven33Launcher.getMavenExecutionRequest(Maven33Launcher.java:150)
      at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:127)
      ... 21 more
       

       

        Attachments

          Issue Links

            Activity

            jhack Giacomo Boccardo created issue -
            Hide
            dejan2609 Dejan Stojadinović added a comment - - edited

            Giacomo Boccardo and others:

            Work around (if you really, really want to use maven 3.5.0 ):

            Other options: revert your Jenkins job to previous Maven version and wait for a new Jenkins Maven Project Plugin version, although it seems that transition to recent maven versions for that plugin is not trivial... latest Jenkins Maven Project Plugin (tag 2.15.1 at the moment) uses not-so-recent version 3.1.0 for maven-core, maven-aether-provider, and similar libraries (I'm tempted to bite that bullet and if I managed to squeeze it to my schedule I definitely would ).

            Related links:

             

             

            Show
            dejan2609 Dejan Stojadinović added a comment - - edited Giacomo Boccardo and others: Work around (if you really, really   want to use maven 3.5.0 ): create maven wrapper for your project ( https://github.com/takari/takari-maven-plugin )  mvn -N io.takari:maven:wrapper -Dmaven=3.5.0 commit (git, hg, svn...) maven wrapper files to your project Freestyle projects : add/change Execute shell build step and use maven wrapper command: ./mvn clean install -Dsomething=something Maven projects: similar as above with these differences: use Execute shell pre-step in front of a maven build block trick your Maven build block : revert to last good know maven version (set drop list value to 3.2.5 or 3.3.9 or whatever) for Goals and options  put validate or clean or --version Pipeline projects:   (should be easy): http://stackoverflow.com/questions/36304131/jenkins-pipeline-plugin-execute-shell-and-parse-output http://stackoverflow.com/questions/36956977/how-to-execute-a-command-in-a-jenkins-2-0-pipeline-job-and-then-return-the-stdou  (disclaimer: I just recently started to play with pipelines, hence: should be ) Other options: revert your Jenkins job to previous Maven version and wait for a new Jenkins Maven Project Plugin version, although it seems that transition to recent maven versions for that plugin is not trivial... latest Jenkins Maven Project Plugin (tag 2.15.1 at the moment) uses not-so-recent version 3.1.0 for maven-core, maven-aether-provider , and similar libraries (I'm tempted to bite that bullet and if I managed to squeeze it to my schedule I definitely would ). Related links: https://github.com/jenkinsci/maven-plugin/pull/46   Upgrade maven to 3.2.5 https://github.com/jenkinsci/maven-plugin/blob/maven-plugin-2.15.1/pom.xml#L49   https://issues.apache.org/jira/browse/MNG-6110   Upgrade Aether to Maven Resolver https://maven.apache.org/docs/3.5.0/release-notes.html      
            Show
            tcohen Tomer Cohen added a comment - Opened pull requests: https://github.com/jenkinsci/maven-interceptors/pull/11 https://github.com/jenkinsci/maven-plugin/pull/94  
            oleg_nenashev Oleg Nenashev made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Tomer Cohen [ tcohen ]
            oleg_nenashev Oleg Nenashev made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            Hide
            aheritier Arnaud Héritier added a comment -

            Rebased PR for maven-plugin is https://github.com/jenkinsci/maven-plugin/pull/95

            Show
            aheritier Arnaud Héritier added a comment - Rebased PR for maven-plugin is  https://github.com/jenkinsci/maven-plugin/pull/95
            laazteca Isabelle Jarrott made changes -
            Assignee Tomer Cohen [ tcohen ] Isabelle Jarrott [ laazteca ]
            aheritier Arnaud Héritier made changes -
            Assignee Isabelle Jarrott [ laazteca ] Tomer Cohen [ tcohen ]
            Hide
            predatorvi Jeff VIncent added a comment -

            FWIW, I just installed a clean Jenkins 2.55 master server and have been seeing either:

             

                 java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

            or 

                 java.lang.NoSuchFieldError: DEFAULT_GLOBAL_SETTINGS_FILE

             

            I had to simply specify both a user and global settings file in the "Advanced" portion of the "Build" section.  If I left either of these settings in the default configuration I would get these errors.

            Show
            predatorvi Jeff VIncent added a comment - FWIW, I just installed a clean Jenkins 2.55 master server and have been seeing either:        java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE or       java.lang.NoSuchFieldError: DEFAULT_GLOBAL_SETTINGS_FILE   I had to simply specify both a user and global settings file in the "Advanced" portion of the "Build" section.  If I left either of these settings in the default configuration I would get these errors.
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is duplicated by JENKINS-43772 [ JENKINS-43772 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Tomer Cohen
            Path:
            pom.xml
            src/main/java/hudson/maven/Maven35ProcessFactory.java
            src/main/java/hudson/maven/MavenBuild.java
            src/main/java/hudson/maven/MavenModuleSetBuild.java
            src/main/java/hudson/maven/MavenUtil.java
            http://jenkins-ci.org/commit/maven-plugin/9addffc853ab178bc280ef5cecb1f4e6a07d0fe9
            Log:
            JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomer Cohen Path: pom.xml src/main/java/hudson/maven/Maven35ProcessFactory.java src/main/java/hudson/maven/MavenBuild.java src/main/java/hudson/maven/MavenModuleSetBuild.java src/main/java/hudson/maven/MavenUtil.java http://jenkins-ci.org/commit/maven-plugin/9addffc853ab178bc280ef5cecb1f4e6a07d0fe9 Log: JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Arnaud Heritier
            Path:
            pom.xml
            src/main/java/hudson/maven/Maven35ProcessFactory.java
            src/main/java/hudson/maven/MavenBuild.java
            src/main/java/hudson/maven/MavenModuleSetBuild.java
            src/main/java/hudson/maven/MavenUtil.java
            http://jenkins-ci.org/commit/maven-plugin/616f9a68801fd19b11303f34ea6b3756fb9d3c5f
            Log:
            Merge pull request #95 from tomerc/master

            JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

            Compare: https://github.com/jenkinsci/maven-plugin/compare/9807ed59d2f4...616f9a68801f

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Heritier Path: pom.xml src/main/java/hudson/maven/Maven35ProcessFactory.java src/main/java/hudson/maven/MavenBuild.java src/main/java/hudson/maven/MavenModuleSetBuild.java src/main/java/hudson/maven/MavenUtil.java http://jenkins-ci.org/commit/maven-plugin/616f9a68801fd19b11303f34ea6b3756fb9d3c5f Log: Merge pull request #95 from tomerc/master JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE Compare: https://github.com/jenkinsci/maven-plugin/compare/9807ed59d2f4...616f9a68801f
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Tomer Cohen
            Path:
            maven35-agent/pom.xml
            maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Agent.java
            maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Main.java
            maven35-agent/src/main/java/jenkins/maven3/agent/RealFilter35OutputStream.java
            maven35-agent/src/main/resources/jenkins/maven3/agent/classworlds.conf
            maven35-interceptor/pom.xml
            maven35-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java
            maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Interceptor.java
            maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Launcher.java
            pom.xml
            http://jenkins-ci.org/commit/maven-interceptors/3ee21f5e2bc450ab36158b39c1fcd47af7f6b9da
            Log:
            JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomer Cohen Path: maven35-agent/pom.xml maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Agent.java maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Main.java maven35-agent/src/main/java/jenkins/maven3/agent/RealFilter35OutputStream.java maven35-agent/src/main/resources/jenkins/maven3/agent/classworlds.conf maven35-interceptor/pom.xml maven35-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Interceptor.java maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Launcher.java pom.xml http://jenkins-ci.org/commit/maven-interceptors/3ee21f5e2bc450ab36158b39c1fcd47af7f6b9da Log: JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Tomer Cohen
            Path:
            maven35-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java
            http://jenkins-ci.org/commit/maven-interceptors/ef36853372aeff340f196bced2bdad49776dda66
            Log:
            JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomer Cohen Path: maven35-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java http://jenkins-ci.org/commit/maven-interceptors/ef36853372aeff340f196bced2bdad49776dda66 Log: JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Tomer Cohen
            Path:
            maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Launcher.java
            http://jenkins-ci.org/commit/maven-interceptors/62b24baa82ea08244aa556e9c9b33ba311e1acec
            Log:
            JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE - Maven 3.5 requires ClassWorld in the main method

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomer Cohen Path: maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Launcher.java http://jenkins-ci.org/commit/maven-interceptors/62b24baa82ea08244aa556e9c9b33ba311e1acec Log: JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE - Maven 3.5 requires ClassWorld in the main method
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Arnaud Heritier
            Path:
            maven35-agent/pom.xml
            maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Agent.java
            maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Main.java
            maven35-agent/src/main/java/jenkins/maven3/agent/RealFilter35OutputStream.java
            maven35-agent/src/main/resources/jenkins/maven3/agent/classworlds.conf
            maven35-interceptor/pom.xml
            maven35-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java
            maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Interceptor.java
            maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Launcher.java
            pom.xml
            http://jenkins-ci.org/commit/maven-interceptors/e1d712c322e8b681b8d3d115f47ca03b6ca36b37
            Log:
            Merge pull request #11 from tomerc/master

            JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

            Compare: https://github.com/jenkinsci/maven-interceptors/compare/084ed65369b2...e1d712c322e8

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Heritier Path: maven35-agent/pom.xml maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Agent.java maven35-agent/src/main/java/jenkins/maven3/agent/Maven35Main.java maven35-agent/src/main/java/jenkins/maven3/agent/RealFilter35OutputStream.java maven35-agent/src/main/resources/jenkins/maven3/agent/classworlds.conf maven35-interceptor/pom.xml maven35-interceptor/src/main/java/org/apache/maven/cli/DefaultMavenExecutionRequestBuilder.java maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Interceptor.java maven35-interceptor/src/main/java/org/jvnet/hudson/maven3/launcher/Maven35Launcher.java pom.xml http://jenkins-ci.org/commit/maven-interceptors/e1d712c322e8b681b8d3d115f47ca03b6ca36b37 Log: Merge pull request #11 from tomerc/master JENKINS-43446 - java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE Compare: https://github.com/jenkinsci/maven-interceptors/compare/084ed65369b2...e1d712c322e8
            Hide
            aheritier Arnaud Héritier added a comment -

            released in 2.16. Thx Olivier Lamy

            Show
            aheritier Arnaud Héritier added a comment - released in 2.16. Thx Olivier Lamy
            aheritier Arnaud Héritier made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            laurentperez laurent perez added a comment -

            Hi. This plugin upgrade seems to have broken CPD/PMD plugins. Jenkins 2.4.x, since switching to plugin 2.16

            The NPEe were already there before 2.16, but now the build really fails.
            [PMD] Successfully parsed file /root/.jenkins/workspace/common/common-dep/libcti-java-plugin/target/pmd.xml of module libcti-java-plugin with 0 unique warnings and 0 duplicates.
            java.io.EOFException
            at java.io.DataInputStream.readInt(DataInputStream.java:392)
            at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2827)
            at java.io.ObjectInputStream.readInt(ObjectInputStream.java:971)
            at com.google.common.collect.Serialization.readCount(Serialization.java:50)
            DRY] Successfully parsed file /root/.jenkins/workspace/exemplejar/target/cpd.xml of module exemplejar with 461 unique warnings and 0 duplicates.
            java.io.EOFException
            at java.io.DataInputStream.readInt(DataInputStream.java:392)
            at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2827)
            at java.io.ObjectInputStream.readInt(ObjectInputStream.java:971)
            at com.google.common.collect.Serialization.readCount(Serialization.java:50)

            Show
            laurentperez laurent perez added a comment - Hi. This plugin upgrade seems to have broken CPD/PMD plugins. Jenkins 2.4.x, since switching to plugin 2.16 The NPEe were already there before 2.16, but now the build really fails. [PMD] Successfully parsed file /root/.jenkins/workspace/common/common-dep/libcti-java-plugin/target/pmd.xml of module libcti-java-plugin with 0 unique warnings and 0 duplicates. java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:392) at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2827) at java.io.ObjectInputStream.readInt(ObjectInputStream.java:971) at com.google.common.collect.Serialization.readCount(Serialization.java:50) DRY] Successfully parsed file /root/.jenkins/workspace/exemplejar/target/cpd.xml of module exemplejar with 461 unique warnings and 0 duplicates. java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:392) at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2827) at java.io.ObjectInputStream.readInt(ObjectInputStream.java:971) at com.google.common.collect.Serialization.readCount(Serialization.java:50)
            laurentperez laurent perez made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Hide
            aheritier Arnaud Héritier added a comment -

            Hi laurent perez could you open another case please with more details about Jenkins core + plugins used and if possible a project to reproduce it.

            Your issue seems valid but completely different from this one.

            Thanks

            Show
            aheritier Arnaud Héritier added a comment - Hi laurent perez could you open another case please with more details about Jenkins core + plugins used and if possible a project to reproduce it. Your issue seems valid but completely different from this one. Thanks
            aheritier Arnaud Héritier made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Show
            laurentperez laurent perez added a comment - Arnaud Héritier sorry, created  https://issues.jenkins-ci.org/browse/JENKINS-44966
            Hide
            aheritier Arnaud Héritier added a comment -

            perfect. Thx laurent perez

            Show
            aheritier Arnaud Héritier added a comment - perfect. Thx laurent perez
            jamesdumay James Dumay made changes -
            Remote Link This issue links to "CloudBees Internal OSS-2241 (Web Link)" [ 18378 ]

              People

              • Assignee:
                tcohen Tomer Cohen
                Reporter:
                jhack Giacomo Boccardo
              • Votes:
                30 Vote for this issue
                Watchers:
                42 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: