BuildPluginManager的Maven依赖jar

时间:2017-01-05 19:41:58

标签: java maven maven-dependency

在我的maven插件Mojo Java文件中,我使用以下行导入接口BuildPluginManager

import org.apache.maven.plugin.BuildPluginManager;

此行给出以下错误:

[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

另外,eclipse在文件的开头显示了这个错误:

The type org.apache.maven.plugin.BuildPluginManager cannot be resolved. It is indirectly referenced from required .class files

据我所知,这意味着POM文件中不存在具有此接口BuildPluginManager的依赖jar / war。我的问题是,我需要使用哪个依赖项来使用此接口?我如何找到依赖?

1 个答案:

答案 0 :(得分:3)

您需要包含对org.apache.maven:maven-core的依赖:

<dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-core</artifactId>
    <version>3.2.5</version>
</dependency>

您可以searching the Maven Central RepositoryBy Classname找到这个。 只需将org.apache.maven.plugin.BuildPluginManager放入Classname输入字段即可。

enter image description here