5

when using spring-boot-maven-plugin for the release, it fails to tag the project, auto increase the version of the project and git commit the change to pom.xml, even I used the command -B. I didn't find anything useful online, is there any way to make it work?

my pom is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>xxx</groupId>
<artifactId>xxx</artifactId>
<version>1.0.0-SNAPSHOT</version>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.5.RELEASE</version>
</parent>

......


<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>1.2.5.RELEASE</version>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>1.2.5.RELEASE</version>
        </plugin>
    </plugins>
</build>

Goals: clean release:clean release:prepare release:perform

Additional Maven command line parameters: -B

Eddie
  • 51
  • 3
  • 1
    Is there an error message? If so, you should post it. – Tunaki Aug 19 '15 at 08:53
  • what makes you think that the Spring Boot maven plugin has anything to do with this? – Stephane Nicoll Aug 19 '15 at 11:35
  • @Tunaki no error message, it was built successfully, but just didn't git commit and increase the version of the project – Eddie Aug 20 '15 at 08:02
  • @StéphaneNicoll Because `org.apache.maven.plugins maven-release-plugin 2.3.2` works, but i perfer using spring boot maven plugin due to that I am using spring boot for the whole project – Eddie Aug 20 '15 at 08:05
  • What makes you think that the spring boot maven plugin has a release goal? It has not. – Stephane Nicoll Aug 20 '15 at 12:34
  • @StéphaneNicoll Okay, cool, thanks, I see – Eddie Aug 20 '15 at 15:46
  • @StéphaneNicoll in this case, could I ask you that what can I use to run the release goal? should I replace spring-boot-maven-plugin with spring-release-plugin?thanks – Eddie Aug 21 '15 at 09:56

2 Answers2

3

I had the same problem. It seems to be related with the version of the maven-release-plugin, but I wasn't able to find where is it coming from.

The solution was to specify the version for the plugin inside pluginManagement as follows:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
        </plugins>
    </pluginManagement>
    <!--... your code ...-->
</build>

Here's a related question: mvn release:prepare not committing changes to pom.xml

Community
  • 1
  • 1
Gastón Fournier
  • 956
  • 1
  • 9
  • 25
  • I got this issue with spring boot 1.5.10 too. no idea where the maven-release-plugin 2.3.2 come from – min Mar 16 '18 at 04:22
0

like @StéphaneNicoll said in the comment, Spring boot maven plugin doesn't have a release goal, so please just bear in mind

Eddie
  • 51
  • 3