我试图提取有关我的项目中使用的所有依赖项(递归)的信息.看起来MavenProject类提供了我需要的所有信息.但我无法弄清楚如何将Artifact的实例转换为MavenProject的实例
/**
*
*
* @reqiresDependencyResolution
*
*/
@Mojo(name = "license-overview", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
public class MyMojo extends AbstractMojo {
/**
* @parameter default-value="${project}"
* @required
* @readonly
*/
MavenProject project;
public void execute() throws MojoExecutionException {
Set artifacts= project.getArtifacts();
for (Artifact artifact : artifacts) {
//Here I need to access the artifact's name, license, author, etc.
System.out.println("*** "+artifact.getArtifactId()+"***");
}
}
}
如何访问位于我的依赖关系的pom中但不通过Artifacts gett