I am on a team making local changes to a public open-source code project with the following general structure:
How should I deploy newly produced snapshot artifacts to our team's internal remote repository? Should I update the GAVs of sphinx-4 parent or its child modules? I slapped in a section pointing at our remote repository, but now I'm not sure how to specify these newly produced artifacts as dependencies instead of the artifacts on CMU's Sonatype repository. It feels like bad practice to be editing the POM, but maybe that's bad intuition, and I should embrace all-new POMs for just our team.
Thank you for any advice.
Best How To :
To deploy the created artifacts into another maven repository you need to add or change the
<distributionManagement> section of the pom. Or add one and replace the one in the parent. The result will be that the deploy goal will upload the artifacts to the new location.
Furthermore I would change the version of the artifact you patch or modify (if contributing to that project is not a possibility). For example by adding 1.0-mycompany-p1-SNAPSHOT. I would not only increase the version number - that might conflict in the future.
I would not recommend to change the
groupId. The reason is to allow maven to resolve the artifact as "same" artifact if it also appears as transitive dependency. Imagine you would change commons-logging to commons-logging-patched (as its new
artifactId. You may would end up with both jars in the classpath since maven does not recognize its almost the same thing.
I would agree to your instincts: The approach to not tamper to much with the original (
pom.xml) is often the best way to go.