Не удается запустить Maven antrun с последовательным ant-contrib

У нас есть специальная процедура для разделения файлов во вложенной папке на расширения, которые будут скопированы и помещены в файлы с одним расширением. Для этого особого подхода я хотел использовать maven-antrun-plugin , для последовательной итерации и упаковки jar через dirset нам нужна библиотека ant-contrib.

Предстоящая конфигурация плагина не работает с ошибкой ошибка. Что я неправильно сконфигурировал? Спасибо.

Конфигурация плагина

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-antrun-plugin</artifactId>
  <version>1.6</version>
  <executions>
    <execution>
      <phase>validate</phase>
      <goals>
        <goal>run</goal>
      </goals>
      <configuration>
        <target>
          <for param="extension">
            <path>
              <dirset dir="${basedir}/src/main/webapp/WEB-INF/resources/extensions/">
                <include name="*" />
              </dirset>
            </path>

            <sequential>
              <basename property="extension.name" file="${extension}" />
              <echo message="Creating JAR for extension '${extension.name}'." />
              <jar destfile="${basedir}/target/extension-${extension.name}-1.0.0.jar">
                <zipfileset dir="${extension}" prefix="WEB-INF/resources/extensions/${extension.name}/">
                  <include name="**/*" />
                </zipfileset>
              </jar>
            </sequential>
          </for>
        </target>
      </configuration>
    </execution>
  </executions>
  <dependencies>
    <dependency>
      <groupId>ant-contrib</groupId>
      <artifactId>ant-contrib</artifactId>
      <version>1.0b3</version>
      <exclusions>
        <exclusion>
          <groupId>ant</groupId>
          <artifactId>ant</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-nodeps</artifactId>
      <version>1.8.1</version>
    </dependency>
  </dependencies>
</plugin>

Ошибка

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (default) on project extension-platform: An Ant BuildException has occured: Problem: failed to create task or type for
[ERROR] Cause: The name is undefined.
[ERROR] Action: Check the spelling.
[ERROR] Action: Check that any custom tasks/types have been declared.
[ERROR] Action: Check that any <presetdef>/<macrodef> declarations have taken place.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
7
задан Tunaki 31 January 2016 в 23:02
поделиться