Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5680

java.lang.UnsupportedOperationException on DefaultProjectBuilder.build

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.2.3
    • Fix Version/s: 3.2.5
    • Component/s: Bootstrap & Build
    • Labels:
      None

      Description

      ProjectBuildingRequest request = ...
      ProjectBuilder builder = plexus.lookup(ProjectBuilder.class);
      builder.build(file, request);
      

      When the build method is called, the following exception is thrown:

      java.lang.UnsupportedOperationException
      	at java.util.AbstractMap.put(AbstractMap.java:209)
      	at org.apache.maven.project.DefaultProjectBuilder.initProject(DefaultProjectBuilder.java:815)
      	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:174)
      	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:118)
      

      The code should be reviewed. This is the offending code inside DefaultProjectBuilder:

                          Artifact artifact = repositorySystem.createDependencyArtifact( d );
      
                          if ( artifact == null )
                          {
                              map = Collections.emptyMap();
                          }
      
                          map.put( d.getManagementKey(), artifact );
      
      

        Attachments

        1. pom.xml
          2 kB
          George Gastaldi

          Issue Links

            Activity

              People

              • Assignee:
                schulte77 Christian Schulte
                Reporter:
                gastaldi George Gastaldi
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: