get classifier/id of maven assembly artifact

梦想的初衷 提交于 2020-01-05 07:41:55

问题


We have a Maven extension which runs afterSessionEnd to get all the artifacts details generated during the maven build, it prints GAV of each artifact using MavenSession.getAllProjects(), Artifact.getArtifact(), getAttachedArtifacts(), getGroupID(), getArtifactId(), getClassifier(), getType() methods. It works fine generally, but if there are any assemblies being generated in the maven project it doesn't print classifier/ID of that assembly artifact even though using getClassifier(), Is there any way to get it also ?


回答1:


Found that problem was due to active profile setup.
It is fixed by setting up the correct active profile of the session, using org.apache.maven.model.Profile getActiveProfiles(), setProperty(), setActivation()
and now it gives all the missing info for all the artifacts including assemblies and rpm's (with classifiers).



来源:https://stackoverflow.com/questions/48402490/get-classifier-id-of-maven-assembly-artifact

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!