Reputation: 3647
I want to know how can I add metadata for an artifact which I want to push to nexus repository.
Can I define the metadata in POM
file. Is there any tags in pom for doing this?
If adding through POM
is not possible what are the other ways to do this?
Upvotes: 0
Views: 1261
Reputation: 29912
There are three ways you can do it imho.
Add properties right in the pom. The problem I see with that is that you can not inspect the values easily in Nexus or search on them.
Add another file that is a properties file as an attached artifact with the Maven build helper plugin. That way they are in a separate file that can be parsed a bit easier than a Maven pom. Otherwise the same problems from 1. are there.
For both of these approaches you could create a custom Nexus plugin that shows that information somehow.
Upvotes: 2
Reputation: 11055
A simple way to do it is to add a <properties>
tag with different properties holding your metadata.
<properties>
<my.name>The King</my.name>
<my.goal>Bring joy to my people</my.goal>
</properties>
You can put in anything you want and it will be in the pom put under Nexus.
I hope this helps.
Upvotes: 0