I am using the following Maven plugin:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.9</version>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>${basedir}/target/generated/src/main/java</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Eclipse keeps showing me the following error:

Execution add-source of goal org.codehaus.mojo:build-helper-maven-plugin:1.9:add-source failed: Unable to load the mojo 'add-source' (or one of its required components) from the plugin 'org.codehaus.mojo:build-helper-maven-plugin:1.9' (org.codehaus.mojo:build-helper-maven-plugin:1.9:add-source:add-source:generate-sources) org.apache.maven.plugin.PluginExecutionException: Execution add-source of goal org.codehaus.mojo:build-helper-maven-plugin:1.9:add-source failed: Unable to load the mojo 'add-source' (or one of its required components) from the plugin 'org.codehaus.mojo:build-helper-maven-plugin:1.9'

What am I doing wrong?

1

There are 1 answers

1
stefan.m On BEST ANSWER

This happens when the project loses the Maven nature for some reason.

Simple right-click the Eclipse project and select

"Configure - Convert to Maven Project".