简体   繁体   English

从Maven项目中提取Jar名称(使用Nexus Rest API)

[英]Extracting Jar names from maven projects(using Nexus Rest API)

I have a scenario where i have to extract jar names & dependent jar names for a maven project(.pom file).These maven projects are hosted in a nexus server. 我有一种情况,我必须为一个Maven项目(.pom文件)提取jar名称和相关的jar名称。这些maven项目托管在一个nexus服务器中。 Traversing through the directory structure to locate the pom file is cumbersome. 遍历目录结构以找到pom文件很麻烦。

What would be the appropriate method to get those information using org.sonatype.nexus.rest.model API. 使用org.sonatype.nexus.rest.model API获得这些信息的合适方法是什么。

Thanks in advance 提前致谢

Instead of using the Nexus REST API I would just call the Maven Dependency Plugin tree goal with a parameter for the outputFile. 而不是使用Nexus REST API,我只需使用带有outputFile参数的Maven依赖插件树目标即可 With that data and a bit of string parsing you can easily create a list of the filenames. 使用该数据和一些字符串分析,您可以轻松创建文件名列表。 From the coordinates of the output you can assemble the filenames in a repository using the Maven repository format. 根据输出的坐标,您可以使用Maven存储库格式在存储库中组合文件名

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM