You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Joseph Walton (JIRA)" <ji...@apache.org> on 2015/06/07 15:14:00 UTC

[jira] [Commented] (MNG-5680) java.lang.UnsupportedOperationException on DefaultProjectBuilder.build

    [ https://issues.apache.org/jira/browse/MNG-5680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14576233#comment-14576233 ] 

Joseph Walton commented on MNG-5680:
------------------------------------

It looks like [this commit|https://github.com/apache/maven/commit/ce6f0bfdb527e20c3afbd76b9c742e07b13d25b2#diff-9037bac1b0c7ac509f2f375f84d60f8d] in 3.2.4 for MNG-5727 may fix this.

> java.lang.UnsupportedOperationException on DefaultProjectBuilder.build
> ----------------------------------------------------------------------
>
>                 Key: MNG-5680
>                 URL: https://issues.apache.org/jira/browse/MNG-5680
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap & Build
>    Affects Versions: 3.2.3
>            Reporter: George Gastaldi
>            Priority: Critical
>         Attachments: pom.xml
>
>
> {code}
> ProjectBuildingRequest request = ...
> ProjectBuilder builder = plexus.lookup(ProjectBuilder.class);
> builder.build(file, request);
> {code}
> When the build method is called, the following exception is thrown: 
> {code}
> 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)
> {code}
> The code should be reviewed. This is the offending code inside DefaultProjectBuilder: 
> {code}
>                     Artifact artifact = repositorySystem.createDependencyArtifact( d );
>                     if ( artifact == null )
>                     {
>                         map = Collections.emptyMap();
>                     }
>                     map.put( d.getManagementKey(), artifact );
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)