Andy Glick wrote:
Using M1 b1 and a <build> tag as shown below, java plugin produced NPEs for <maven:copy-resources> in code for goal

<goal name="java:jar-resources"

whether or not there was a <resources> tag. I got the plugin to work after adding what appears in the final section. There were no files in the src/resources tree. I did instrument the jelly code and found that pom.build.resources.isEmpty() always returned false, whether there was a <resources> tag or not.


original POM

<build>
  <sourceDirectory>src/java</sourceDirectory>
</build>


applicable jelly code


  <goal name="java:jar-resources"
        description="Copy any resources that must be present in the
          deployed JAR file">

    <j:if test="${!pom.build.resources.isEmpty()}">
      <echo message="pom.build.resources = ${pom.build.resources}"/>
      <echo message="pom.build.resources.isEmpty() =
        ${pom.build.resources.isEmpty()}"/>
      <maven:copy-resources
        resources="${pom.build.resources}"
        todir="${maven.build.dest}"/>
    </j:if>
  </goal>


NPE's stopped with following POM modifications


<build>
  <sourceDirectory>src/java</sourceDirectory>
  <resources>
    <resource>
      <directory>src/resources</directory>
      <includes>
        <include>**/*.xml</include>
      </includes>
    </resource>
  </resources>
</build>

I did look for this issue in the Maven JIRA and I didn' find anything.
If it was already reported and/or handled then I'm sorry if this is a duplicate report.

I encountered these problems while attempting to build a number of jakarta-commons-sandbox projects that I checked out from CVS, SVN or both. They included commons-sandbox/contract, commons-sandbox/events, commons-sandbox/functor to name a few.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to