get classifier/id of maven assembly artifact

2019-08-04 07:25发布

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条回答
2楼-- · 2019-08-04 08:11

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

查看更多
登录 后发表回答