简体   繁体   中英

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. I know there is a way to get it with maven help plugin with

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. 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.

We are using "Sonatype Nexus Professional" version 2.11.4-01, api version 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. I "need" the effective pom because it contains a link to the maven generated site which is build during release process. I'd like to have a (confluence) macro who creates a link to the site on nexus.

I see two ways to get effective 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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