我最近已经开始学习https://spring.io/guides/tutorials/react-and-spring-data-rest/教程,并且我被困在“加载JavaScript模块示例8”上。当我加上:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
</plugin> 对于pom.xml,它将其突出显示为红色,并表示插件‘com.github.eirslett:前端-maven-plugin:’没有找到。我希望有人能帮忙。谢谢。
发布于 2020-10-12 20:57:27
增加这个插件,为我解决了这个问题。
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v12.19.0</nodeVersion>
<npmVersion>6.14.8</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>webpack build</id>
<goals>
<goal>webpack</goal>
</goals>
</execution>
</executions>
</plugin>发布于 2020-10-12 21:14:24
您可能需要包括插件的版本在您的pom,根据他们的回购的这部分。
看起来现在的最新版本(回购的标签和mvnrepository储存库)是1.10.3:
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.10.3</version>
...
</plugin>
...发布于 2022-11-11 20:02:23
在编写本教程时,我遇到了同样的问题。在阅读了其他一些解决方案之后,我的一个快速解决方案是添加此依赖项:
<dependency>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
</dependency>然后,将该版本添加到插件中,在我的例子中是:
<version>1.10.3</version>然后,重新加载所有Maven项目,红线就会消失。
https://stackoverflow.com/questions/63952630
复制相似问题