简体   繁体   English

如何从nexus rest API获得“有效pom”(或以编程方式)

[英]How to get the “effective pom” from nexus rest API (or programmatically)

I'm interested in the effective pom of a maven artifact preferably via nexus rest api. 我对Maven工件的有效pom感兴趣,最好通过nexus rest api。 I know there is a way to get it with maven help plugin with 我知道有一种方法可以使用Maven帮助插件

mvn help:effective-pom

However, i need the effective pom within a webapp - actually within a confluence plugin (which is an OSGI bundle) and afaik i can not run a maven plugin in this context. 但是,我需要web应用程序中的有效pom-实际上是在confluence插件(这是OSGI捆绑包)中,而afaik我无法在这种情况下运行maven插件。 My "plugin" has a rest client querying nexus - so i can easy fetch the "normal" pom but not the effective, however probably i missed one of the nexus rest resources. 我的“插件”有一个REST客户端查询关系-所以我可以轻松获取“正常” POM,但不是有效的,但是我可能错过了一个Nexus REST资源。

We are using "Sonatype Nexus Professional" version 2.11.4-01, api version 2.11.4-01 . 我们使用的是“ Sonatype Nexus Professional”版本2.11.4-01,API版本2.11.4-01

Would be fine for me to get the effective pom programmatically with Java, but i have no clue how to achieve it. 使用Java以编程方式获得有效的pom对我来说很好,但是我不知道如何实现。 I "need" the effective pom because it contains a link to the maven generated site which is build during release process. 我“需要”有效的pom,因为它包含指向在发布过程中生成的maven生成的站点的链接。 I'd like to have a (confluence) macro who creates a link to the site on nexus. 我想要一个(汇合)宏,该宏在nexus上创建指向该站点的链接。

I see two ways to get effective pom: 我看到两种获得有效pom的方法:

1. Request the effective pom artifact from Nexus (if it was produced and deployed previously)

2. Request the sources artifact from Nexus and execute over the source code:
mvn help:effective-pom > my_effective_pom.xml

Nexus was designed as a storage service, it just storages items and does not modify them Nexus被设计为一种存储服务,它仅存储项目而不会对其进行修改

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

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