В моем проекте maven java используется maven-antrun-plugin для выполнения deploy.xml ant script, который развертывает мое приложение. В файле deploy.xml используется задача <if>
, и это, по-видимому, вызывает проблему;
[INFO] Выполнение задач
[taskdef] Не удалось загрузить определения из ресурса net/sf/antcontrib/antlib.xml. Его не удалось найти.Deploy:
[ИНФОРМАЦИЯ] ----------------------------------------------- -------------------------
[ERROR] СТРОИТЬ ОШИБКУ
[ИНФОРМАЦИЯ] ----------------------------------------------- -------------------------
[INFO] Произошло событие ant BuildException: при выполнении этой строки произошла следующая ошибка:
E:\My_Workspace\xxxxxx\xxxxxx\xxxxxxx\deploy.xml: 24: Проблема: не удалось создать задачу или тип, если
Причина. Имя undefined.
Действие: Проверьте орфографию.
Действие: убедитесь, что объявлены какие-либо пользовательские задачи/типы.
Действие: проверьте, что любой <presetdef> /<macrodef> были сделаны заявления.
Вот конфигурация плагина 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
, и когда я заглядываю в банку, я вижу net/sf/antcontrib/antcontrib.properties
, поэтому проблем нет.
Когда я проверяю значения maven.compile.classpath
, maven.compile.classpath
и maven.compile.classpath
, я не вижу ссылки на antcontrib
, может ли это быть проблемой? Почему они не появляются, когда antcontrib
определяется как зависимость?