1
获取org.apache.maven.project.MavenProject的Maven依赖项列表
我试图使用列出一些Maven工件的依赖项org.apache.maven.project.MavenProject。 我的代码是这样的。 public List<Dependencies> loadProject() { Model mavenModel = new Model(); mavenModel.setModelVersion("4.0.0"); mavenModel.setGroupId("org"); mavenModel.setArtifactId("wso2"); mavenModel.setVersion("1.0.0"); addDependency(mavenModel, "com.google.inject", "guice", "4.2.2"); addDependency(mavenModel, "ch.qos.logback", "logback-classic", "1.2.3"); MavenProject mavenProject = new MavenProject(mavenModel); //******* Need to resolve dependencies of `mavenProject` and ******* //******* get the list of dependencies of this project. ******* return dependencies; } …