gpt4 book ai didi

java - 无法读取 org.apache.maven.plugins :maven-resources-plugin:jar:3. 0.5 的 Artifact 描述符

转载 作者:行者123 更新时间:2023-11-30 06:06:39 24 4
gpt4 key购买 nike

我想使用 spring boot 和 react js 构建一个网络应用程序(遵循教程 here )。在 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。

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/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

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

最佳答案

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

关于java - 无法读取 org.apache.maven.plugins :maven-resources-plugin:jar:3. 0.5 的 Artifact 描述符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43649571/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com