You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Laurent Malvert (JIRA)" <ji...@codehaus.org> on 2012/03/08 02:45:02 UTC

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Laurent Malvert created MRESOURCES-160:
------------------------------------------

             Summary: NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
                 Key: MRESOURCES-160
                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293614#comment-293614 ] 

Laurent Malvert edited comment on MRESOURCES-160 at 3/7/12 7:57 PM:
--------------------------------------------------------------------

Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is {{$\{basedir\}/src/main/resources}}.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.

*Careful:* in my ticket above I mention {{outputDirectory}}. Obviously I meant {{directory}}, as shown in the example project's configuration. Sorry for the confusion. (Can't seem to be able to re-edit the ticket itself.)

                
      was (Author: laurent.malvert):
    Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is {{$\{basedir\}/src/main/resources}}.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.

**Careful:** in my ticket above I mention {{outputDirectory}}. Obviously I meant {{directory}}, as shown in the example project's configuration. Sorry for the confusion.

                  
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293614#comment-293614 ] 

Laurent Malvert commented on MRESOURCES-160:
--------------------------------------------

Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong.

However, it shouldn't really fail with an NPE without giving any helpful information.

                
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293614#comment-293614 ] 

Laurent Malvert edited comment on MRESOURCES-160 at 3/7/12 8:06 PM:
--------------------------------------------------------------------

Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is {{$\{basedir\}/src/main/resources}}.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.

*Careful:* in my ticket above (and in its *title/summary*, whoops...) I mention {{outputDirectory}}. Obviously I meant {{directory}}, as shown in the example project's configuration. Sorry for the confusion. (Can't seem to be able to re-edit the ticket itself.)

                
      was (Author: laurent.malvert):
    Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is {{$\{basedir\}/src/main/resources}}.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.

*Careful:* in my ticket above I mention {{outputDirectory}}. Obviously I meant {{directory}}, as shown in the example project's configuration. Sorry for the confusion. (Can't seem to be able to re-edit the ticket itself.)

                  
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293614#comment-293614 ] 

Laurent Malvert edited comment on MRESOURCES-160 at 3/7/12 7:50 PM:
--------------------------------------------------------------------

Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is {{$\{basedir\}/src/main/resources}}.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.
                
      was (Author: laurent.malvert):
    Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is ${basedir}/src/main/resources.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.
                  
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293614#comment-293614 ] 

Laurent Malvert edited comment on MRESOURCES-160 at 3/7/12 7:49 PM:
--------------------------------------------------------------------

Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

.bq "[...] The default directory for a build is ${basedir}/src/main/resources."

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.
                
      was (Author: laurent.malvert):
    Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong.

However, it shouldn't really fail with an NPE without giving any helpful information.

                  
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293614#comment-293614 ] 

Laurent Malvert edited comment on MRESOURCES-160 at 3/7/12 7:57 PM:
--------------------------------------------------------------------

Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is {{$\{basedir\}/src/main/resources}}.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.

**Careful:** in my ticket above I mention {{outputDirectory}}. Obviously I meant {{directory}}, as shown in the example project's configuration. Sorry for the confusion.

                
      was (Author: laurent.malvert):
    Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is {{$\{basedir\}/src/main/resources}}.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.
                  
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293615#comment-293615 ] 

Laurent Malvert commented on MRESOURCES-160:
--------------------------------------------

Hmmm, I just realized these aren't exactly the same. I followed the goal's documentation, which then documented the {{<resources>}} by saying to look it up in the Maven Model documentation, and I ended up there, and somehow got mixed up between the {{<outputdirectory>}} and {{<directory>}}.

Nonetheless, the NPE seems like a pretty harsh default behavior and should provide additional information (missing required path).

Sorry for the confusion (would be worth testing if {{<targetPath>}} suffers from the same issue.

                
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293615#comment-293615 ] 

Laurent Malvert edited comment on MRESOURCES-160 at 3/7/12 7:56 PM:
--------------------------------------------------------------------

-- Ignore this comment: removed it, I confused myself --
                
      was (Author: laurent.malvert):
    Hmmm, I just realized these aren't exactly the same. I followed the goal's documentation, which then documented the {{<resources>}} by saying to look it up in the Maven Model documentation, and I ended up there, and somehow got mixed up between the {{<outputdirectory>}} and {{<directory>}}.

Nonetheless, the NPE seems like a pretty harsh default behavior and should provide additional information (missing required path).

Sorry for the confusion (would be worth testing if {{<targetPath>}} suffers from the same issue.

                  
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MRESOURCES-160) NPE when copy-resources set to use the default as aspecified by documentation

Posted by "Laurent Malvert (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRESOURCES-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293614#comment-293614 ] 

Laurent Malvert edited comment on MRESOURCES-160 at 3/7/12 7:49 PM:
--------------------------------------------------------------------

Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

{quote}
[...] The default directory for a build is ${basedir}/src/main/resources.
{quote}

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.
                
      was (Author: laurent.malvert):
    Might be more an enhancement than a bug as the [goal's documentation|http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html] indicates that this is a required parameter.

So it appears the the documentation on the maven site is wrong (actually, mayve it's just badly worded:

.bq "[...] The default directory for a build is ${basedir}/src/main/resources."

Maybe the intent was to say that this is where resources are usually located, not exactly that the default value for {{directory}} is supposed to be this.


However, it shouldn't really fail with an NPE without giving any helpful information.
                  
> NPE when copy-resources set to use the default <outputDirectory> as aspecified by documentation
> -----------------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-160
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-160
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira