Search code examples
mavenmaven-release-plugin

How to avoid uploading directories into the SCM while executing 'maven-release-plugin:prepare'


When releasing a maven project, the 'maven-release-plugin:prepare' goal will upload the tag version into the SCM.

1/ Does 'maven-release-plugin:prepare' use a specific plugin to execute the upload process into the SCM ? Or does it use its own classes ?

2/ Inside my maven multi modules project directory there are a few directories that I would like avoid uploading them into the SCM tag version for each release.

These directories do not contain code to be released, however they are located in the SCM branch subject of the release: Is there a way to tell 'maven-release-plugin:prepare' to avoid uploading them ?

Thank you.


Solution

  • The release plugin is internally using the SCM provider specified as part of your SCM project settings. Based on the URL you provide, it will determine the provider to use. More infos here: http://maven.apache.org/guides/mini/guide-releasing.html

    Everything you have under version control will get tagged - Maven does not know which directories are important and which aren't. If these directories shouldn't be tagged, maybe they shouldn't be part of the project layout and should not be in SCM in the first place. Have you thought about moving them to a different location?