繁体   English   中英

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

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

我想使用spring boot来构建一个Web应用程序并响应js(在之后跟随教程)。 在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>

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

插件org.apache.maven.plugins:maven-resources-plugin:3.0.5或其依赖项之一无法解析:无法读取org.apache.maven.plugins:maven-resources-plugin:jar的工件描述符: 3.0.5:无法在http://repo.maven.apache.org/maven2中找到org.apache.maven.plugins:maven-resources-plugin:pom:3.0.5缓存在本地存储库中,解决方案不会重新尝试直到中心的更新间隔过去或强制更新

编辑:我已将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>

错误:

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

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

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

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

这里适用的最新版本是3.0.2

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

我遇到了同样的问题,然后我更改了代码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>

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM