I'm trying to configure Maven Release Plugin for a multi model project which has the following modules: parent, Model, WebApplication, WebServices.
I've made the plugin work for a simple project as a test, but for this project I've not been able to.
parent\pom.xml
....
<version>2.4.1-SNAPSHOT</version>
.....
<distributionManagement>
<repository>
<id>release</id>
<url>file://git.comapany.ro/dragos.geornoiu/test.git</url>
</repository>
</distributionManagement>
<scm>connection>scm:git:[email protected]:dragos.geornoiu/test.git</connection></scm>
....
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.8</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
</plugin>
....
</plugins>
The oher modules take the version from the parent pom:
<parent>
...
<version>2.4.1-SNAPSHOT</version>
</parent>
I run mvn release:prepare from the parent module.
The plugin asks for the new versions of each module and the new version for development. It changes the version from 2.4.1-SNAPSHOT to 2.4.1, creates a local tag, but stops there. The tag isn't pushed and the development version isn't changed to 2.4.2-SNPASHOT.
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] Access denied.
[ERROR] fatal: Could not read from remote repository.
[ERROR]
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.
I am connecting with ssh to the remote and have tested commit, push and creating a tag from the parent module, all of them work just fine (since I am not getting a permission denied or something similar, I don't think this is a problem). Also, the plugin manages to make a push after changing the version to 2.4.1 (removing SNAPSHOT).
I've tried looking with -X parameter, but cant' figure what I'm doing wrong.
I have found the solution by reading this article - MAVEN-RELEASE-PLUGIN "UNABLE TO TAG SCM" ISSUE AND SOLUTION.
In case the modules are located on the same level as the pom-project and need to be referenced
…you will get a misleading error message:
Caused by: org.apache.maven.plugin.MojoFailureException: Unable to tag SCM
Provider message: The git-push command failed.
Command output: ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
After moving the Model, WebApplication, WebServices modules into the parent and changing the paths in each pom.xml, the mvn release:prepare command executed succesfully.