From 2d9e9a61f9938ada01a4c578b56fefbe0a3fc233 Mon Sep 17 00:00:00 2001 From: TheSnoozer Date: Thu, 10 Jun 2021 23:17:20 +0200 Subject: [PATCH] https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/458: Have the plugin operate in "offline mode" by default to prevent issues like "com.jcraft.jsch.JSchException: Auth fail" -- WARNING: the properties git.local.branch.ahead and git.local.branch.behind might be inaccurate without the "false"! --- .../main/java/pl/project13/core/AheadBehind.java | 4 ++++ maven/docs/using-the-plugin.md | 13 +++++++++---- .../pl/project13/maven/git/GitCommitIdMojo.java | 6 +++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/pl/project13/core/AheadBehind.java b/core/src/main/java/pl/project13/core/AheadBehind.java index 09bd4177..681ce5dc 100644 --- a/core/src/main/java/pl/project13/core/AheadBehind.java +++ b/core/src/main/java/pl/project13/core/AheadBehind.java @@ -23,6 +23,10 @@ * A local git repository can either be "ahead", or "behind" in the number of commits * relative to the remote repository. This class tracks the amount of commits the local git repository * is "behind", or "ahead" relative to it's remote. + * + * :warning: You must set the {@code offline}-setting of the plugin to {@code false} when you want to ensure + * that the properties generated are truly up-to-date. Otherwise the local state of the git repository is used + * which might be out-of-date. */ public class AheadBehind { diff --git a/maven/docs/using-the-plugin.md b/maven/docs/using-the-plugin.md index 757ab136..cf95027e 100644 --- a/maven/docs/using-the-plugin.md +++ b/maven/docs/using-the-plugin.md @@ -308,15 +308,20 @@ It's really simple to setup this plugin; below is a sample pom that you may base - false + true