You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2009/10/04 18:08:03 UTC
[jira] Closed: (MNG-4382) NullPointerException in
ModelUtils.cloneProperties
[ http://jira.codehaus.org/browse/MNG-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MNG-4382.
----------------------------------
Assignee: Benjamin Bentmann
Resolution: Not A Bug
This is a bug in the Nuxeo code. From [AbstractNuxeoAssembler.java|http://svn.nuxeo.org/nuxeo/org.nuxeo.build/maven-nuxeo-plugin/trunk/src/main/java/org/nuxeo/build/assembler/AbstractNuxeoAssembler.java]:
{code:java}
public Properties getProperties() {
if (props == null) {
props = project.getProperties();
props.put("project.version", project.getVersion());
props.put("basedir", project.getBasedir());
props.put("outputDirectory",
project.getBuild().getOutputDirectory());
props.put("buildDirectory", project.getBuild().getDirectory());
}
return props;
}
{code}
Note in particular {{props.put("basedir", project.getBasedir());}}. However, {{MavenProject.getBasedir()}} returns a {{java.io.File}} which is not a valid value for a {{Properties}} as per its API docs.
Last but not least, it looks dangerous that the plugin pollutes the properties object of the current project, i.e. does not make a copy of the properties before the modification.
> NullPointerException in ModelUtils.cloneProperties
> --------------------------------------------------
>
> Key: MNG-4382
> URL: http://jira.codehaus.org/browse/MNG-4382
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.2.1
> Environment: linux ubuntu 9.04 on intel platform
> Reporter: Olivier Grisel
> Assignee: Benjamin Bentmann
>
> While exececuting "mvn install" in the nuxeo-distribution project:
> hg clone http://hg.nuxeo.org/nuxeo/nuxeo-distribution/
> cd nuxeo-distribution/platform-ear/
> mvn install
> Complete stacktrace to be attached in the first comment to avoid spammy jira email notifications.
> This is error does not happen with maven 2.0.10.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira