【问题标题】:maven plugin out of datemaven插件过时了
【发布时间】:2017-11-07 13:30:47
【问题描述】:

当我想在 STS 中启动一个新的 maven 项目并从教程 JavaBrains 制作我的第一个简单的 spring 项目时,我收到了这个错误:

Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:maven-clean-plugin:maven-plugin:2.6.1:runtime Cause: error in opening zip file

我不知道发生了什么......

我的 pom.xml 文件:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.test.spring</groupId>
<artifactId>course-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Test Spring API</name>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.2.RELEASE</version> // i try another version and this same..
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

<properties>
    <java.version>1.8</java.version>
</properties>

【问题讨论】:

    标签: java spring maven plugins


    【解决方案1】:

    从以下文件夹中删除内容有助于解决此问题。希望这会有所帮助。

    C:\Users\.m2\repository\org\apache\maven\plugins\maven-jar-plugin\

    然后运行:mvn clean install

    【讨论】:

      【解决方案2】:

      您需要从本地 Maven 存储库中删除现有版本。 然后使用 -U 选项运行全新安装。

      【讨论】:

        【解决方案3】:

        您的 pom.xml 文件似乎有问题,

        1. 确保&lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt; 在存储库中可用,看起来您已将工件名称编辑为&lt;spring-boot-starter-**parent**&gt;.
        2. 您的第二个控制台说您在 pom.xml 中使用 &lt;//&gt; 评论了单行,因此它打印为 expected START_TAG or END_TAG not TEXT (position: TEXT seen ...&lt;/version&gt;\r\n\t&lt;/parent&gt;\r\n\ 使用 &lt;!-- --&gt; 评论pom.xml 文件。

        希望这有助于解决。

        【讨论】:

        • 我这次下载正确,同样的问题是:maven-clean-plugin-2.6.1.jar
        • 你的意思是说你已经更正了你的 pom.xml 文件和可用的父依赖??
        • 我确定,我尝试手动替换新的 maven-clean-plugin 并尝试其他父 RELEASE 版本和不同插件的相同问题
        • 希望您在 pom.xml 标签中添加了 maven ,请选择您的项目并按 Alt+F5 并标记强制更新快照/版本,然后单击确定,即使您遇到同样的问题,请发布您的控制台。
        猜你喜欢
        • 1970-01-01
        • 2017-09-07
        • 2021-12-25
        • 1970-01-01
        • 1970-01-01
        • 2012-12-27
        • 2014-10-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多