Failed to execute com.github.eirslett

Viewed 3528

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.

2 Answers

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>
...

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>
Related