Discussion:
[m2e-users] Maven plugin in workspace, "could not find goal"
Curtiss Howard
7 years ago
Permalink
I have a project containing a Maven plugin I wrote and another project that uses it during the build. It works fine when running Maven, but I get the following error (genericized) in Eclipse:

"Could not find goal '<goalName>' in plugin <groupId>:<artifactId>:<version> among available goals help"

I saw someone had a similar issue last year and posted to the mailing list about it: https://www.eclipse.org/lists/m2e-users/msg05688.html

The response is that m2e does not support this. Fair enough, but then why is m2e aware of the (generated) help goal and not my other goal? I'm just wondering if there's a way to kill this error, either through some Maven configuration (preferable) or Eclipse configuration (acceptable).

Thanks!
Igor Fedorenko
7 years ago
Permalink
Maven command line build is single pass start-to-finish kind of affair, so it is perfectly reasonable to build the plugin project first, then to use the plugin when building other projects, all during single multi-module (aka reactor) build.

Eclipse incremental build is far more complex, where individual parts are executed to build the changed source files and all directly or indirectly affected sources. To make this work for Maven plugins we'd need to track everything that can possibly affect plugin's runtime behaviour, and force execution of the plugin whenever there is a change. This is either very hard or impossible, and certainly not implemented in m2e.

The workaround is to "mvn install" your plugin into local repository and force m2e update configuration of projects using the plugin. Every time you make changes to the plugin.
--
Regards,
Igor
...
Curtiss Howard
7 years ago
Permalink
Hi, I do actually have the plugin installed in my local repo and have done Maven > Update Project, Clean Projects, etc. and I still have this error. If it helps I'm using m2e 1.8.3.
...
Igor Fedorenko
7 years ago
Permalink
m2e is supposed to resolve the plugin from local repository and I am not aware of any bugs in this area. I suggest you double-check configuration of your project, things like versions between pom.xml and local repository match.
--
Regards,
Igor
...
Loading...