What is the purpose of the pom.xml inside a META-INF container?

Typically a maven built artifact will contain a pom in a META-INF

. I recently noticed that Spring jars don't have this. So this gets me thinking about the purpose of this pom.

It seems like maven is fetching the pom directly from the repository when it does things that require knowledge of artifact metadata, for example. when defining dependencies.

So what's built in for?

+3


source to share


2 answers


The docs Maven

offer two reasons for the pom at this location.

1) Just for reference, as a convenience. As the docs say, this makes the artifact "self-describing"



2) You can get this information from your application using Java. This allows arfiact to automatically report this in the app.

+2


source


The pump you find in the repository is not necessarily used to generate the artifact. It is intended for users of the artifact and can be customized when the artifact is created.



The one included in the IS artifact is used to create the artifact. There are options not to include it in the artifact.

+3


source







All Articles