Reputation: 1869
I want to build a web app using spring boot and react js (followed the tutorial here). In pom.xml I added:
<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.
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
EDIT: I have changed the in maven-resources-plugin tag, the maven version to 3.0.2 but now i get errors on:
<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]
Upvotes: 3
Views: 55404
Reputation: 2076
Problem is your maven resource plugin repository
version isn't valid.
Change your pom.xml
file's repository to this.
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</dependency>
Upvotes: 1
Reputation: 349
I was facing same problem then i change code 1.5.9.RELEASE it is working now perfectlty
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Upvotes: 3
Reputation: 19445
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.
The most recent version applicable here is 3.0.2
.
I also recommend that you upgrade your entire maven installation to the most recent 3.5.0 release.
Upvotes: 2