Skip to content

Have the plugin operate in "offline mode" by default to prevent issues since 3.x where the revision goal throws Exception: Caused by: com.jcraft.jsch.JSchException: Auth fail #458

Closed
@879913935

Description

@879913935

Description

When i use the Springboot 2.2.x, its default version of git-commit-id is 3.0.1, but this version will cause build error log and there is no problem with git-commit-id:2.2.6. Here is the exception segment:

org.eclipse.jgit.api.errors.TransportException: git@xxxxx.git: Auth fail
    at org.eclipse.jgit.api.FetchCommand.call (FetchCommand.java:254)
    at pl.project13.core.JGitProvider.fetch (JGitProvider.java:351)
    at pl.project13.core.JGitProvider.getAheadBehind (JGitProvider.java:338)
    at pl.project13.core.GitDataProvider.lambda$memoize$6 (GitDataProvider.java:274)
    at pl.project13.core.GitDataProvider.lambda$loadGitData$2 (GitDataProvider.java:177)
    at pl.project13.core.GitDataProvider.maybePut (GitDataProvider.java:257)
    at pl.project13.core.GitDataProvider.loadGitData (GitDataProvider.java:177)
    at pl.project13.maven.git.GitCommitIdMojo.loadGitDataWithJGit (GitCommitIdMojo.java:639)
    at pl.project13.maven.git.GitCommitIdMojo.loadGitData (GitCommitIdMojo.java:598)
    at pl.project13.maven.git.GitCommitIdMojo.execute (GitCommitIdMojo.java:489)

I read the source code and find that : since 3.x , add two properties (GitDataProvider#loadGitData line 174)

SupplierEx<AheadBehind> aheadBehindSupplier = memoize(() -> getAheadBehind());
maybePut(properties, GitCommitPropertyConstant.LOCAL_BRANCH_AHEAD, () -> aheadBehindSupplier.get().ahead());
maybePut(properties, GitCommitPropertyConstant.LOCAL_BRANCH_BEHIND, () -> aheadBehindSupplier.get().behind());

This looks like lead to the problem : it will connect the remote git repository and get some infos, that is the Auth fail and i don't know how to fix it(my native git works well, the .ssh directory has no problem)

Expected behavior

when mvn compile , i expect no error logs, even if it was ignored and the build is finally "SUCCESS".

Additional context

plugin version : 3.0.1
maven : 3.6.1
os: mac
command: mvn compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions