Java 无法读取 org.apache.maven.plugins:maven-resources-plugin:jar:3.0.5 的工件描述符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43649571/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 01:05:03  来源:igfitidea点击:

Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.0.5

javaspringmavenpom.xml

提问by georgiana_e

I want to build a web app using spring boot and react js (followed the tutorial here). In pom.xml I added:

我想使用 spring boot 和 react js 构建一个 web 应用程序(按照这里的教程)。在 pom.xml 我添加:

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.0.5</version>
    <executions>
        <execution>
            <id>Copy frontend production build to resources</id>
            <phase>package</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${basedir}/target/classes</outputDirectory>
                <resources>
                    <resource>
                        <directory>src/main/app/build/</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

When executing mvn clean package, i get the errors below. Maven version is 3.0.5.

执行 mvn clean package 时,出现以下错误。Maven 版本是 3.0.5。

Plugin org.apache.maven.plugins:maven-resources-plugin:3.0.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.0.5: Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:3.0.5 in http://repo.maven.apache.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

插件 org.apache.maven.plugins:maven-resources-plugin:3.0.5 或其依赖项之一无法解析:无法读取 org.apache.maven.plugins:maven-resources-plugin:jar 的工件描述符: 3.0.5: failed to find org.apache.maven.plugins:maven-resources-plugin:pom:3.0.5 in http://repo.maven.apache.org/maven2被缓存在本地仓库中,解析不会重新尝试直到 Central 的更新间隔已过或强制更新

EDIT: I have changed the in maven-resources-plugin tag, the maven version to 3.0.2 but now i get errors on:

编辑:我已将 maven-resources-plugin 标签中的 maven 版本更改为 3.0.2,但现在出现以下错误:

<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <version>1.2</version>
    <executions>
        <execution>
            <id>Install Node and Yarn</id>
            <goals>
                <goal>install-node-and-yarn</goal>
            </goals>
        </execution>

        <execution>
            <id>yarn install</id>
            <goals>
                <goal>yarn</goal>
            </goals>
            <configuration>
                <arguments>install</arguments>
            </configuration>
        </execution>

        <execution>
            <id>Frontend production build</id>
            <phase>package</phase>
            <goals>
                <goal>yarn</goal>
            </goals>
            <configuration>
                <arguments>run build</arguments>
            </configuration>
        </execution>
    </executions>
    <configuration>
        <nodeVersion>v7.2.0</nodeVersion>
        <yarnVersion>v0.18.0</yarnVersion>
        <installDirectory>.mvn</installDirectory>
        <workingDirectory>src/main/app</workingDirectory>
    </configuration>
</plugin>

ERROR:

错误:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.2:install-node-and-yarn (Install Node and Yarn) on project ema: The plugin com.github.eirslett:frontend-maven-plugin:1.2 requires Maven version 3.1.0 -> [Help 1]

[错误] 无法在项目 ema 上执行目标 com.github.eirslett:frontend-maven-plugin:1.2:install-node-and-yarn (Install Node and Yarn):插件 com.github.eirslett:frontend-maven- plugin:1.2 需要 Maven 版本 3.1.0 -> [帮助 1]

采纳答案by Steve C

In a nutshell, your problem is here:

简而言之,您的问题在这里:

<artifactId>maven-resources-plugin</artifactId>
<version>3.0.5</version>

This version is intended to convey the version of the maven-resources-plugin, not maven itself.

此版本旨在传达 的版本,而maven-resources-plugin不是 maven 本身。

The most recent version applicable here is 3.0.2.

此处适用的最新版本是3.0.2.

I also recommend that you upgrade your entire maven installation to the most recent 3.5.0 release.

我还建议您将整个 maven 安装升级到最新的 3.5.0 版本。

回答by Vijay Maurya

I was facing same problem then i change code 1.5.9.RELEASE it is working now perfectlty

我遇到了同样的问题,然后我更改了代码 1.5.9.RELEASE 它现在可以正常工作了

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.9.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

回答by Search Results Web results Pi

Problem is your maven resource plugin repositoryversion isn't valid.

问题是您的maven resource plugin repository版本无效。

Change your pom.xmlfile's repository to this.

pom.xml文件的存储库更改为此。

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.0.2</version>
</dependency>