ѕтƒ
ѕтƒ

Reputation: 3647

How to add Artifact metadata to nexus server

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

Answers (2)

Manfred Moser
Manfred Moser

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.

  • If you are using Nexus Professional you can activate the Custom Metadata plugin and use the approach described on the support site to get the properties into Nexus. Then you can also use search and so on to find specific components based on their metadata.

Upvotes: 2

Eldad Assis
Eldad Assis

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

Related Questions