I am posting here because the maven project issue tracker ain't open without registration, and registration takes some time.
I am referring to https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html, last variant: Only specifying -Dfile parameter, thus using the Jar-internal POM to derive artifactId etc.
if the JAR was built by Apache Maven, it'll contain a pom.xml in a subdirectory of the META-INF/ directory, which will be read by default.
On the command-line I run
mvn install:install-file -Dfile=somefile.jar -DgroupId=somegroup -DartifactId=someartefact -Dversion=1.0.0 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=someotherfile.jar
This works. Now when I use maven-embedder, it doesn't.
What happens is:
- maven-embedder writes the first jar file correctly into the local repository.
- Then, maven-embedder writes the second jar over the previous one.
I have debugged into https://github.com/apache/maven-install-plugin/blob/master/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java :
On the second install:install-file goal, the -DgroupId, -Dartifact parameters from the first call are still somehow here and trigger the override.
Seems to be a bug, can somebody report and fix that? Thank You.