簡體   English   中英

Maven發布插件在git push錯誤上顯示明文密碼

[英]Maven release plugin shows plaintext password on git push error

我在跑

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

所以我看到了PLAINTEXT密碼。 當我在Teamcity上使用此步驟時,如果構建失敗,其他人可以看到我的密碼時會導致安全問題。 我在Linux和Windows機器上都試過了。

我使用maven-release-plugin版本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>

大約6個月前這個問題是固定的,根據這個

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM