Max Vorobev :
I'm trying to produce a Maven-compatible artefact using bazel. I noticed that mvn
puts some files inside META-INF
directory in JAR archive (file.jar/META-INF/maven/groupId/artifactId/pom.xml
and file.jar/META-INF/maven/groupId/artifactId/pom.properties
)
Questions:
- Are they needed to be able to successfully depend on my artifact from another project? I know you can disable them via a config option in
pom.xml
ref, which leads me to believe that you don't. - Are they used by
mvn
in any case whatsoever? - Can I use
pom.xml
inside on the JAR instead ofpom.xml
near my artifact in Maven repo?
JF Meier :
We have several jars in your Maven repository that do not contain a pom.xml. For maven, the revelant pom.xml is the one that is outside your artifact. In Nexus, you deploy a jar always along with a pom.xml and that is the one that counts.
So you need to publish a pom.xml along with your jar if you want to use it from Maven, but you do not need to put it inside. AFAIK you cannot change this behaviour.