Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven发布插件显示git推送错误时的明文密码_Git_Maven_Password Protection_Maven Release Plugin_Maven Scm Plugin - Fatal编程技术网

Maven发布插件显示git推送错误时的明文密码

Maven发布插件显示git推送错误时的明文密码,git,maven,password-protection,maven-release-plugin,maven-scm-plugin,Git,Maven,Password Protection,Maven Release Plugin,Maven Scm Plugin,我在跑步 mvn release:prepare -Dusername=myuser -Dpassword=mypassword 请参见输出中的行: [INFO] Executing: cmd.exe /X /C "git push https://myuser:********@myserver.com:8081/scm/project/project.git refs/heads/master:refs/heads/master" 但如果由于某种原因,git push失败(例如,我输入密

我在跑步

mvn release:prepare -Dusername=myuser -Dpassword=mypassword
请参见输出中的行:

[INFO] Executing: cmd.exe /X /C "git push https://myuser:********@myserver.com:8081/scm/project/project.git refs/heads/master:refs/heads/master"
但如果由于某种原因,git push失败(例如,我输入密码时出错),那么我会在日志中看到

[ERROR] fatal: unable to access 'https://myuser:mypassword@myserver.com:8081/scm/project/project.git/': SSL certificate problem: self signed certificate in certificate chain
所以我看到了明文密码。当我在Teamcity上使用此步骤时,如果构建失败,其他人可以看到我的密码,这会导致安全问题。 我在Linux和Windows机器上都试过了

我使用maven发布插件版本2.5.3


有人知道如何修复它吗?

在发布插件中使用另一个git提供程序。我在切换到另一个git服务器时遇到了完全相同的问题。突然,Jenkins密码出现在构建日志中,即使没有错误。可能git服务器使用的是不同的身份验证方案

这对我很有用:

 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-release-plugin</artifactId>
   <version>2.5.3</version>
   <configuration>
     <providerImplementations>
       <git>jgit</git>
     </providerImplementations>
   </configuration>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-jgit</artifactId>
       <version>1.9.5</version>
     </dependency>
   </dependencies>                 
 </plugin>

org.apache.maven.plugins

.

这并不能直接解决您的问题,但如果您使用SSH访问Git存储库,那么您将无法在日志中看到密码。远程链接看起来像git pushssh://git@myserver.com/path/to/repo.git有关详细信息,请参阅。@RichardNeish,感谢您的回复和建议,但这对我没有帮助,因为我需要通过用户/密码而不是ssh密钥进行身份验证,因为我有几个人在Teamcity上运行这个构建,我不能为每个人创建一个密钥,并将其放入每个buildAgent框中。