maven - spring-boot-maven-plugin,mvn 发布 :prepare not committing changes to pom. xml

标签 maven spring-boot

使用spring-boot-maven-plugin进行发布时,它无法标记项目,自动增加项目版本并将更改提交到pom.xml,即使我使用了命令-B。我在网上没有找到任何有用的东西,有什么办法让它工作吗?

我的pom如下:

<?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>

目标:干净发布:干净发布:准备发布:执行

额外的 Maven 命令行参数:-B

最佳答案

我有同样的问题。它似乎与 maven-release-plugin 的版本有关,但我无法找到它来自哪里。

解决方案是在 pluginManagement 中指定插件的版本,如下所示:

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

这是一个相关的问题:mvn release:prepare not committing changes to pom.xml

关于maven - spring-boot-maven-plugin,mvn 发布 :prepare not committing changes to pom. xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32090724/

相关文章:

scala - 让 Maven 和 SBT 使用本地 Artifactory-server

intellij-idea - IntelliJ "Initialization failed for ' https ://start. spring.io'请检查 URL、网络和代理设置"

java - 在 IntelliJ Idea 中启动一个简单的 JUnit/Maven 项目

java - 在 Maven 中创建具有外部依赖项的 jar 和其他 jar

spring-boot - 为什么 Spring Boot Application 在添加 spring-cloud-bus 依赖项后记录它启动了两次

java - 需要动态更改数据源url的数据库名称( Multi-Tenancy 数据库)

java - Spring @Transactional 注释在使用 try catch 的 for 循环中不起作用

spring - 如何从 application.properties 文件设置 h2.jdbc?

java - Maven |如何在 Gradle 中使用 build-helper-maven-plugin?

hibernate - 使用带有嵌入式 derby 的 hibernate