1

git-commit-id-plugin の spring -boot-starter-parentからデフォルトをオーバーライドするにはどうすればよいでしょうか。以下をbuild/pluginsに入れてもうまくいかないようです。

       <plugin>
            <groupId>pl.project13.maven</groupId>
            <artifactId>git-commit-id-plugin</artifactId>

            <configuration>
                <abbrevLength>10</abbrevLength>
            </configuration>
        </plugin>

生成されたgit.propertiesにデフォルトの短いバージョンが引き続き表示されます。

git.commit.id.describe-short=05780bf
git.commit.id.describe=05780bf

アップデート:

以下の@kanの提案に従って、次のことを試しました:

           <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>

                <configuration>

                    <abbrevLength>10</abbrevLength>
                    <gitDescribe>
                    <abbrev>10</abbrev>
                    </gitDescribe>
                </configuration>
            </plugin>

git.propertiesで以下を生成しました:

git.commit.id.abbrev=8b8a2f7
git.commit.id.describe-short=8b8a2f727c
git.commit.id.describe=8b8a2f727c

ただし、Spring Boot アプリの/infoエンドポイントには、明らかにgit.commit.id.abbrevからの短縮バージョンが引き続き表示されます。

{

    "application": 

{

    "name": "broker-feed"

},
"build": 
{

    "version": "0.0.1-SNAPSHOT"

},
"git": 
{

    "branch": "master",
    "commit": 

        {
            "id": "8b8a2f7",
            "time": "2015-08-28T13:00:49-0400"
        }
    }

}

Spring Boot プラグインをリダイレクトして別のバージョンを選択することはできますか?

ありがとう!

4

3 に答える 3

0

この問題は、Spring Boot 1.5.3 で修正する必要があります (プル リクエストUse git.commit.id.abbrev if present を参照)。

git.commit.id.abbrevプラグインの構成を介してプロパティの長さを構成するだけで、abbrevLengthSpring Boot がそれを取得します。

于 2017-04-25T18:57:02.470 に答える