获取有关maven依赖关系的信息 [英] getting information about maven dependencies

查看:435
本文介绍了获取有关maven依赖关系的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能获得有关我的maven项目的所有第一级依赖项的信息。
我需要以下信息:名称,供应商,版本,许可证类型,参考URL,描述。所有这些信息都存储在每个包的pom.xml中。问题是我们有大约20个项目的层次结构,这些项目有数百个依赖项不断被更改。

I wonder if it is possible to get information about all first level dependencies of my maven project. I need the following information: name, vendor, version, license type, reference URL, description. All this information is stored in pom.xml of each package. The problem is that we have hierarchy of about 20 projects that have several hundreds dependencies that are constantly being changed.

我知道 maven依赖插件 。我运行了 mvn依赖:list 并使用 grep s和的组合提取了包列表秒。但我需要许可证信息和URL。我可以实现我自己的解析器来解析pom.xml以获取有趣的包并提取这些信息,但似乎应该存在可以使用的东西。

I know about maven dependency plugin. I ran mvn dependency:list and extracted list of packages using combination of greps and seds. But I need license information and URL. I can implement my own parser that parses pom.xml for interesting packages and extracts this information but it seems that something ready to use should exist.

推荐答案

最好的方法是在maven-project-info-report插件的支持下创建一个站点,该插件将创建所需的信息。请参阅此处作为示例。唯一的问题是你使用的是哪个版本的maven?此外,我建议你看看 maven-license-plugin
如果您需要以任何方式限制许可证,您可以查看 maven-license-verifier插件

The best thing is to create a site with the support of the maven-project-info-report plugin which will create the needed information. See here as an example. The only question is which version of maven are you using? Furthermore i would suggest to take a look at the maven-license-plugin If you need to limit the licenses in any way you can take a look at the maven-license-verifier plugin.

这篇关于获取有关maven依赖关系的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆