JGit Clone Repo 从 windows 任务管理器启动失败

JGit Clone Repo kicked off from windows task manager fails

让我们先说我的代码有效。我可以单击运行 jar 文件的批处理文件,从 GIT.

下载一些代码
Git gitRepo = Git.cloneRepository().setURI( remoteProjectPath )
.setDirectory(new File(destination))
.setCredentialsProvider( new UsernamePasswordCredentialsProvider( repoUser, repoPassword ) )
.setBranch(branch)
.setNoCheckout(true)
.call();

在 windows 中,在我的用户配置文件文件夹中,我有一个 .gitconfig 文件,其中包含:

[http]
sslverify = false

当我双击批处理文件时,它起作用了。 但是,这是自动化过程的一部分。我需要 windows 任务调度程序在午夜执行批处理文件。 (时间并不重要,除了我不在工作的时候。) 但是我可以打开任务计划程序并单击该任务并单击 'run',它失败并显示 sslverify 标志。

"Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

在我看来,.gitconfig 仅在我(手动)执行该过程时使用。有没有办法确定 JGit 在任务调度程序启动时是否试图从不同的目录读取? 或者是否有另一种方法让 JGit 使用 sslverify=false 来使用 CloneCommand 进行稀疏签出?

谢谢,

我纠结了这么久,在我post这个问题后终于找到了答案。 在对 EGit 的引用中,我发现:How to change "Location" for "User Settings"

但这对我有用。我转到系统环境变量并创建了一个系统变量 'HOME' 并将其设置为包含我需要的 .gitconfig 文件的目录。现在,即使从 windows 任务调度程序启动,该过程也能正常工作。