【问题标题】:Why won't maven-antrun-plugin run?为什么 maven-antrun-plugin 不运行?
【发布时间】:2015-05-18 22:02:53
【问题描述】:

我无法运行 antrun 插件。

我的 pom 中有这个配置:

<project>
    ...
    <build>
        ...
        <plugins>       
            ...
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals><goal>run</goal></goals>
                        <configuration>
                            <target>
                                <echo message="Hello, maven"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

当我运行mvn:compile 时,它会运行,但我在有关 antrun 插件的日志中看到的只是:

[INFO] --- maven-antrun-plugin:1.4:run (default) @ datasite-cms ---
project.artifactId
[INFO] Executing tasks
[INFO] Executed tasks

为什么插件实际上没有做任何事情?

【问题讨论】:

  • 为什么需要使用maven-antrun-plugin?目的是什么?
  • 从 maven 运行 sencha 命令的构建工具。
  • 还有@khmarbaise,我不应该使用antrun插件有什么原因吗?
  • 我经常遇到用户不知道存在哪些插件的体验...大多数时候这比使用 maven-antrun-plugin 更简单...但是有些情况下你可以'不要避免 maven-antrun-plugin...

标签: maven ant maven-3 maven-antrun-plugin


【解决方案1】:

如果您确实需要使用 maven-antrun-plugin,请使用 maven-antrun-plugin 的最新版本。

older versions 使用配置标签:tasks 而不是target。但是不要再使用这些古老版本的 Maven 插件了。

【讨论】:

  • 是的。这正是我做错了。我什至没有意识到我使用的是旧版本。感谢您的帮助。
  • 最新的maven插件列表可以在这里找到:maven.apache.org/plugins
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多