scm connection vs developerConnection

superigno picture superigno · Apr 16, 2015 · Viewed 24.8k times · Source

Can anyone tell me the difference between scm connection and developerConnection in maven?

I am trying to build using mvn release:prepare and it requires either one of them.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project was-topology-legacy-dsl: Missing required setting: scm connection or developerConnection must be specified. -> [Help 1]

Answer

Charlee Chitsuk picture Charlee Chitsuk · Apr 16, 2015

As mentioned in POM Reference: SCM The connection requires read access for Maven to be able to find the source code (for example, an update), developerConnection requires a connection that will give write access. It is an information for our project where the other, including with another maven plugin to re-use this information further. In this case the Maven Release Plugin.

The Maven Release Plugin: Prepare a Release also provides us the behind the scenes what it does for us during the release:prepare. There are some significant steps which requires the access to the scm as the following: -

  1. Transform the SCM information in the POM to include the final destination of the tag
  2. Tag the code in the SCM with a version name (this will be prompted for)
  3. Commit the modified POMs

This means we should provide the scm information when using the maven release plugin. Especially the developerConnection. If we don't provide, the plugin is not able to execute.

Another useful information is Maven Release Plugin: Perform a Release and Maven Release Plugin: Rollback a Release.