You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2015/09/06 22:46:21 UTC
[jira] [Closed] (MRESOURCES-160) NPE when copy-resources set to use
the default as aspecified by documentation
[ https://issues.apache.org/jira/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Osipov closed MRESOURCES-160.
-------------------------------------
Resolution: Auto Closed
This issue has been auto closed because it has been inactive for a long period of time. If you think this issue still applies, retest your problem with the most recent version of Maven and the affected component, reopen and post your results.
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
> Key: MRESOURCES-160
> URL: https://issues.apache.org/jira/browse/MRESOURCES-160
> Project: Maven Resources Plugin
> Issue Type: Bug
> Components: copy
> Affects Versions: 2.5
> Environment: Windows 7 64 bits
> Java 1.6.0_31 x64
> maven 3.0.4
> Reporter: Laurent Malvert
> Attachments: error.log, resources-npe.tar.gz
>
>
> h2. Context and Issue
> When using the {{maven-resources-plugin}} to copy a resource to a custom directory using the {{copy-resources}} goal, it triggers an NPE without any additional information when the {{<outputDirectory>}} element is not specified:
> {noformat}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources (copy-resources) on project NPEResourcesBug: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources failed. NullPointerException -> [Help 1]
> {noformat}
> However, the documentation at: http://maven.apache.org/pom.html#Resources
> clearly states:
> {quote}
> directory: This element's value defines where the resources are to be found. The default directory for a build is ${basedir}/src/main/resources.
> {quote}
> Specifying it explictly with this value works as intended.
> _(Not sure if relevant to maven-resources-plugin or the MSHARED resources component?)_
> h2. Test Case
> Or at leat a project to reproduce.
> See the attached project for a working test case, which uses this configuration:
> {code}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-resources-plugin</artifactId>
> <version>2.5</version>
> <executions>
> <execution>
> <id>copy-resources</id>
> <phase>validate</phase>
> <goals>
> <goal>copy-resources</goal>
> </goals>
> <configuration>
> <outputDirectory>
> ${basedir}/resources
> </outputDirectory>
> <resources>
> <resource>
> <!--
> works when included explictly set,
> NPE otherwise, though documentation at:
> http://maven.apache.org/pom.html#Resources
> really mentions:
> "directory: This element's
> value defines where the
> resources are to be found. The
> default directory for a build
> is
> ${basedir}/src/main/resources."
> -->
> <!--
> <directory>${basedir}/src/main/resources</directory>
> -->
> <includes>
> <include>**/somefile.xml</include>
> </includes>
> </resource>
> </resources>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)