首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >插件maven-antrun-plugin或其依赖项无法解决。

插件maven-antrun-plugin或其依赖项无法解决。
EN

Stack Overflow用户
提问于 2018-04-12 07:58:14
回答 1查看 3.2K关注 0票数 0

我希望每次在清理安装期间在maven src/main中创建两个新目录。

最初,我使用maven-antrun-plugin来实现这个功能,但是新版本的maven已经不再支持这个插件了。

下面是我在pom.xml中的代码

代码语言:javascript
复制
<plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-antrun-plugin</artifactId>
              <version>1.7</version>
              <executions>
                  <execution>
                      <id>staticFolder</id>
                      <phase>generate-test-resources</phase>
                      <configuration>
                          <tasks>
                            <delete dir="./src/main/resources/static"/>
                            <mkdir dir="./src/main/resources/static"/>
                          </tasks>
                      </configuration>
                      <goals>
                          <goal>run</goal>
                      </goals>
                  </execution>
                  <execution>
                      <id>templatesFolder</id>
                      <phase>generate-test-resources</phase>
                      <configuration>
                          <tasks>
                             <delete dir="./src/main/resources/templates"/>
                             <mkdir dir="./src/main/resources/templates"/>
                          </tasks>
                      </configuration>
                      <goals>
                          <goal>run</goal>
                      </goals>
                  </execution>
              </executions>
            </plugin>

在maven干净安装上面的代码中,它会导致生成失败,并出现以下错误,

代码语言:javascript
复制
[WARNING] The POM for org.apache.maven.plugins:maven-antrun-plugin:jar:1.9 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.9/maven-antrun-plugin-1.9.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.900 s
[INFO] Finished at: 2018-04-12T13:16:26+05:30
[INFO] Final Memory: 13M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-antrun-plugin:1.9 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-antrun-plugin:jar:1.9 in central (https://repo.maven.apache.org/maven2) -> [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/PluginResolutionException

不确定在maven构建时是否有我可以用来创建新目录的maven插件。如果有的话请提出建议。

Maven版本- 3.5.2维Ant版本- 1.9.4

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-12 10:54:12

这将根本无法工作,因为版本1.9的maven-antrun-plugin不存在maven.apache.org/plugins

除此之外,在src构建过程中创建目录是个坏主意.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49791003

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档