How can I perform 'releasing' on a simple project using the Maven 'maven-release-plugin' while using with Git(lab)?
I am working on a dev / feature branch and finally I merge the updates into the 'master' branch. I guess, then the 'release' plugin comes into play. Correct?
In my Jenkinsfile I call:
sh 'mvn release:prepare release:perform'
While trying many options, I keep getting this error:
The svn command failed. [ERROR] Command output: [ERROR] svn: E155007: '..workspace/project/pom.xml' is not a working copy
The command that fails is:
[INFO] Executing: /bin/sh -c cd /var/jenkins_home/workspace/jenkins-testing-releasing && svn --non-interactive commit --file /tmp/maven-scm-1557766606.commit --targets /tmp/maven-scm-8208798121252708517-targets
[INFO] Working directory: /var/jenkins_home/workspace/jenkins-testing-releasing
Strange, because I don't work with SVN.
This is what I have so far:
<project ...
<artifactId>jenkinstesting</artifactId>
<version>0.1-SNAPSHOT</version>
<scm>
<connection>scm:git:git@gitlab.com:user/project.git</connection>
<developerConnection>scm:git:git@gitlab.com:user/project.git</developerConnection>
<tag>rel1</tag>
</scm>
Version 1:
<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>pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
Version 2:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>