英文:
Failed to execute com.github.eirslett
问题
我最近开始学习https://spring.io/guides/tutorials/react-and-spring-data-rest/教程,但卡在了"Loading JavaScript Modules Example 8"部分。当我将以下内容添加到pom.xml中时:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
</plugin>
它会被标记为红色,并显示找不到插件'com.github.eirslett:frontend-maven-plugin:'。希望有人能够帮助。谢谢。
英文:
I've recently started on https://spring.io/guides/tutorials/react-and-spring-data-rest/ tutorial and I'm stuck on "Loading JavaScript Modules Example 8". When I add:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
</plugin>
to pom.xml, it highlights it as red and says Plugin 'com.github.eirslett:frontend-maven-plugin:' not found. I hope someone could help. Thank you.
答案1
得分: 3
将以下内容添加到插件中可解决我的问题。
<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>
英文:
Adding this to the pluging fixed the issue for me.
<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>
答案2
得分: 3
你可能需要在你的pom中包含插件的版本,参考他们仓库中的这个部分。
根据仓库的标签和mvnrepository上的信息,目前最新的版本是1.10.3:
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.10.3</version>
...
</plugin>
...
英文:
You may need to include the plugin's version in your pom, as per this section of their repo.
Looks like the latest version (per the repo's tags and per mvnrepository) as of right now is 1.10.3:
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.10.3</version>
...
</plugin>
...
答案3
得分: 0
我在进行这个教程时遇到了相同的问题。在阅读了一些其他的解决方法后,我找到了一个快速的解决办法,就是添加这个依赖:
<dependency>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
</dependency>
然后,将这个版本添加到插件中,对于我的情况是:
<version>1.10.3</version>
然后,重新加载所有的Maven项目,红色的提示线就会消失。
英文:
I came across the same issue while working on this tutorial. After reading some other workarounds, a quick solution for me was to add this dependency:
<dependency>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
</dependency>
Then, add the version to the plugin, which in my case was:
<version>1.10.3</version>
Then, reload all Maven projects, and the red lines go away.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论