In my maven plugin Mojo Java file, I am importing interface BuildPluginManager using following line:
import org.apache.maven.plugin.BuildPluginManager;
This line gives following error:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/username/git/path/to/plugin/my-maven-plugin/src/main/java/com/company/product/repo/my_maven_plugin/ExecutorExampleMojo.java:[25,31] cannot find symbol
symbol: class BuildPluginManager
location: package org.apache.maven.plugin
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
Also, eclipse shows this error in the beginning of the file:
The type org.apache.maven.plugin.BuildPluginManager cannot be resolved. It is indirectly referenced from required .class files
From what I understand, it means that the dependency jar/war that has this interface BuildPluginManager
is not there in the POM file. My question is, which dependency do I need to pull in to use this interface? How do I find that dependency?
You need to include dependency on
org.apache.maven:maven-core
:You can find this out by searching the Maven Central Repository,
By Classname
. Just putorg.apache.maven.plugin.BuildPluginManager
into theClassname
input field.