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

java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • maven-plugin
    • None
    • Jenkins 2.46.1
      Maven 3.5.0

      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
       

       

          [JENKINS-43446] java.lang.NoSuchFieldError: DEFAULT_USER_SETTINGS_FILE

          Giacomo Boccardo created issue -

          Dejan Stojadinović added a comment - - edited

          jhack 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:

           

           

          Dejan Stojadinović added a comment - - edited jhack 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      

          Tomer Cohen added a comment -

          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 made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Oleg Nenashev made changes -
          Assignee New: Tomer Cohen [ tcohen ]
          Oleg Nenashev made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

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

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

          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.

          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.

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

              Created:
              Updated:
              Resolved: