maven-release-plugin "Unable to tag SCM" Issue And Solution

maven-release-plugin works only perfectly for nested multi-module project. In case the modules projects are located inside the folder containing the pom.xml with the "pom" packaging.

In case the modules are located on the same level as the pom-project and need to be referenced like:


<modules>
   <module>../moduleA</module>
   <module>../moduleB</module>
   <module>../moduleC</module>
</modules>

…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.

Moving the submodules to the folder containing the multi-module pom.xml solves the problem. The issue was extensively tested with releasing http://lightfish.adam-bien.com :-)

See you at Java EE Workshops at MUC Airport, and particularly at the http://workshops.adam-bien.com/javaee-architectures.htm!

Comments:

Hi Adam,

you can specify the location of the pom.xml file explicitly by using the configuration of the release-plugin:

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>../moduleA/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

...

H.t.h.
Robert

Posted by Robert on August 27, 2013 at 04:52 PM CEST #

@Robert,

thanks for the hint!

The only problem here is the absolutely misleading error message. I had other working projects, what helped me to isolate the cause.

I prefer the nested layout now -- it is easier to commit all changes from one folder.

thanks, as always, for you valuable comments!,

adam

Posted by Adam Bien on August 27, 2013 at 11:14 PM CEST #

Hi Adam,

you can also use this configuration if your multi module project (even if nested directory layout) is in a GIT repository.

Because GIT works other than SVN, the maven release plugin cannot use a maven submodule as it's own SCM module. SVN is able to use directories as completely own projects, but GIT don't.

So you will need this configuration anyway when maven-release a multimodule project with GIT...

Regards,
Robert

Posted by Robert on August 27, 2013 at 11:35 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments
License