upendra
upendra

Reputation: 49

mvn release:prepare failing while git push operation?

I am trying to release one component using the maven. This is the project structure:

root-
    A-project/pom.xml
    B-project/pom.xml
    C-project/pom.xml
    D-project/pom.xml

Here we have ssh URL ssh://[email protected]:29418/root up to root only. So we add the following lines of code in each project to give the relative path.

<pomFileName>A-project/pom.xml</pomFileName>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <executions>
        <execution>
            <id>default</id>
            <goals>
                <goal>perform</goal>
            </goals>
            <configuration>
                <pomFileName>A-project/pom.xml</pomFileName>
                <!--
                <pushChanges>false</pushChanges>
                -->
                <autoVersionSubmodules>true</autoVersionSubmodules>
            </configuration>
        </execution>
    </executions>
    <!--
    <configuration>
        <autoVersionSubmodules>true</autoVersionSubmodules>
    </configuration>
    -->
</plugin>

While running mvn release:prepare the project is building successfully but after this I am getting the following error:

[ERROR] BUILD FAILURE
[INFO] Unable to tag SCM
Provider message:
The git-push command failed.
Command output:
To ssh://[email protected]:29418/root
 ! [remote rejected] A-prject-template-1.1.12 -> A-prject-template-1.1.12 \
 (prohibited by Gerrit) error: failed to push some refs to \
 'ssh://[email protected]:29418/root'

No tags are present at local and remote before doing mvn release:prepare.

Upvotes: 1

Views: 2149

Answers (1)

Andre
Andre

Reputation: 410

I got same Gerrit failure with maven-release-plugin using Git on Jenkins.

  • Push pom.xml -> Gerrit SUCCESS
  • Local tag SUCCESS
  • Push tag -> Gerrit FAIL "... (prohibited by Gerrit)"

SOLUTION: Gerrit permission "Forge Committer", see https://gerrit-review.googlesource.com/Documentation/error-prohibited-by-gerrit.html

Reason: Jenkins userid which created the tag was not the same as the userid for push to Gerrit.

Upvotes: 1

Related Questions