无法执行com.github.eirslett。

huangapple go评论81阅读模式
英文:

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:

&lt;plugin&gt;
	&lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;
	&lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;
&lt;/plugin&gt; 

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.

		&lt;plugin&gt;
		&lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;
		&lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
            &lt;installDirectory&gt;target&lt;/installDirectory&gt;
        &lt;/configuration&gt;
        &lt;executions&gt;
            &lt;execution&gt;
                &lt;id&gt;install node and npm&lt;/id&gt;
                &lt;goals&gt;
                    &lt;goal&gt;install-node-and-npm&lt;/goal&gt;
                &lt;/goals&gt;
                &lt;configuration&gt;
                    &lt;nodeVersion&gt;v12.19.0&lt;/nodeVersion&gt;
                    &lt;npmVersion&gt;6.14.8&lt;/npmVersion&gt;
                &lt;/configuration&gt;
            &lt;/execution&gt;
            &lt;execution&gt;
                &lt;id&gt;npm install&lt;/id&gt;
                &lt;goals&gt;
                    &lt;goal&gt;npm&lt;/goal&gt;
                &lt;/goals&gt;
                &lt;configuration&gt;
                    &lt;arguments&gt;install&lt;/arguments&gt;
                &lt;/configuration&gt;
            &lt;/execution&gt;
            &lt;execution&gt;
                &lt;id&gt;webpack build&lt;/id&gt;
                &lt;goals&gt;
                    &lt;goal&gt;webpack&lt;/goal&gt;
                &lt;/goals&gt;
            &lt;/execution&gt;
        &lt;/executions&gt;
	&lt;/plugin&gt;

答案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:

&lt;plugins&gt;
    &lt;plugin&gt;
        &lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;
        &lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;
        &lt;version&gt;1.10.3&lt;/version&gt;
        ...
    &lt;/plugin&gt;
...

答案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:

&lt;dependency&gt;
		&lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;
		&lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;
		&lt;version&gt;1.12.1&lt;/version&gt;
&lt;/dependency&gt;

Then, add the version to the plugin, which in my case was:

			&lt;version&gt;1.10.3&lt;/version&gt;

Then, reload all Maven projects, and the red lines go away.

huangapple
  • 本文由 发表于 2020年9月18日 17:02:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/63952630.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定