Использование задачи antcontrib через maven-antrun-plugin

Мой Java-проект maven использует maven-antrun-plugin для выполнения ant-скрипта deploy.xml, который развертывает мое приложение. В deploy.xml используется

[INFO] Выполнение задач
[taskdef] Не удалось загрузить определения из ресурса net / sf / antcontrib / antlib.xml. Не удалось найти.

развернуть:
[ИНФОРМАЦИЯ] ----------------------------------------------- -------------------------
[ERROR] BUILD ERROR
[ИНФОРМАЦИЯ] ----------------------------------------------- -------------------------
[ИНФОРМАЦИЯ] Произошла Ant BuildException: при выполнении этой строки произошла следующая ошибка:
E: \ My_Workspace \ xxxxxx \ xxxxxx \ xxxxxxx \ deploy.xml: 24: Проблема: не удалось создать задачу или ввести, если
Причина: имя не определено.
Действие: проверьте правописание.
Действие: Убедитесь, что были объявлены все настраиваемые задачи / типы.
Действие: Убедитесь, что выполнены все объявления / .

Вот конфигурация плагина antrun из моего pom;

<plugin>
    <inherited>false</inherited>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <id>remote-deploy</id>
            <phase>install</phase>
            <configuration>
                <tasks>
                    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath"/>

                        <property name="compile_classpath" refid="maven.compile.classpath" />
                        <property name="runtime_classpath" refid="maven.runtime.classpath" />
                        <property name="plugin_classpath" refid="maven.plugin.classpath" />

                        <echo message="compile classpath: ${compile_classpath}"/>
                        <echo message="runtime classpath: ${runtime_classpath}"/>
                        <echo message="plugin classpath: ${plugin_classpath}"/>

                        <ant antfile="${basedir}/deploy.xml">
                            <target name="deploy" />
                        </ant>
                </tasks>
            </configuration>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.7.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-jsch</artifactId>
            <version>1.7.1</version>
        </dependency>
    </dependencies>
</plugin>

.. и вот соответствующий раздел из моего deploy.xml;

<target name="deploy" if="deploy">
    <if>    <!-- line 24 -->
        <and>

Почему я смотрю в репозиторий maven, я вижу ant-contrib / ant-contrib / 1.0b3 / ant-contrib-1.0b3.jar и когда я смотрю внутрь jar, я вижу net / sf / antcontrib / antcontrib.properties , так что проблем нет.

Когда я проверяю значения maven.compile.classpath , maven.compile.classpath и maven.compile.classpath , я не вижу никаких ссылок на antcontrib , может в этом проблема? Почему они не появляются, когда antcontrib определен как зависимость?

15
задан Tunaki 31 January 2016 в 23:03
поделиться