I've got artefacts which are built and released using Maven. The artefact's original pom.xml contains the usual project information (artifactId, name, etc.) and the dependencies. That's fine. But the pom.xml also includes private information such as the SCM URLs, the names of the developers or a parent-artefact.
Is there any way to tell Maven to generate a pom.xml which is sanitized, so the artefact can be released to public, without destroying the technical relevant information such as the dependencies?
Neither the SCM URLs, nor the list of developers nor the existence of a parent-pom (which is only used for DepMgmt definitions and other meta-stuff) is imho relevant for users of the artefact, so I assume i could be removed from a released pom.xml
The pom.xml both in an repository manager such as Archiva and packaged within the artefact's jar file contain those informations. I assume Maven is just copying the whole thing.
To summarize:
I have:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>my-artifact</artifactId>
<scm>
<connection>scm:svn:http://buildmachine/org.example/my-artifact/trunk</connection>
<developerConnection>scm:svn:http://buildmachine/org.example/my-artifact/trunk</developerConnection>
<url>http://buildmachine/org.example/my-artifact/trunk</url>
</scm>
<dependencies>
<dependency>
...
</dependency>
</dependencies>
I want:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>my-artifact</artifactId>
<dependencies>
<dependency>
...
</dependency>
</dependencies>
I don't know perfect solution for your problem, but some things can be done. These are hacks, but they might help.
First, externalize private information from pom (like scm, developer names etc.). For scm metadata it will be:
Second, move properties to settings file placing them in a profile. In settings file you can also "hide" your company private repository. If you must share profiles/settings.xml file with other associates, try to use global setting file running
mvn -gs path_to_global_settings
or prepare common Maven installation with these settings prepared.Parent pom section unfortunately must stay untouched.