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>


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

Reply via email to