相关疑难解决方法(0)

通过maven-antrun-plugin使用antcontrib <if>任务

我的maven java项目使用maven-antrun-plugin来执行部署我的应用程序的deploy.xml ant脚本.deploy.xml使用该<if>任务,这似乎导致了问题;

[INFO]执行任务
[taskdef]无法从资源net/sf/antcontrib/antlib.xml加载定义.它无法找到.

部署:
[INFO] --------------------------------------------- ---------------------------
[ERROR] BUILD ERROR
[INFO] --------------- -------------------------------------------------- -------
[INFO]发生了Ant BuildException:执行此行时发生以下错误:
E:\ My_Workspace\xxxxxx\xxxxxx\xxxxxxx\deploy.xml:24:问题:创建任务或类型失败如果
原因:名称未定义.
行动:检查拼写.
操作:检查是否已声明任何自定义任务/类型.
操作:检查是否已发生任何<presetdef>/<macrodef>声明.

这是我的pom的antrun插件配置;

<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> …
Run Code Online (Sandbox Code Playgroud)

java ant-contrib maven maven-antrun-plugin

15
推荐指数
2
解决办法
2万
查看次数

标签 统计

ant-contrib ×1

java ×1

maven ×1

maven-antrun-plugin ×1