亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Maven 使用“mvn install”命令構建失敗

Maven 使用“mvn install”命令構建失敗

慕神8447489 2022-06-04 16:38:56
我試圖為 Cucumber-Maven 報告生成和測試我的代碼(如果有效),然后打開命令提示符。我試過“mvn clean”,它是建立成功的。之后,我嘗試了“mvn install”并遇到了BUILD FAILURE(顯示錯誤)。[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time:  22.844 s[INFO] Finished at: 2019-02-05T13:14:51+08:00[INFO] ------------------------------------------------------------------------[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.20 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.20: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.20 from/to central (https://repo.maven.apache.org/maven2): Connect to webproxy.sample.com:8080 [webproxy.sample.com/205.165.7.13] failed: Connection timed out: connect -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
查看完整描述

2 回答

?
慕容森

TA貢獻1853條經驗 獲得超18個贊

我嘗試使用日食。我對同一個 POM 文件使用了 maven clean 和 install 。它工作正常。

C:\users\youruser\.m2\settings.xml看來你的文件有問題。可能是阻止 maven 下載依賴項的代理問題。請檢查您的 settings.xml 文件。


查看完整回答
反對 回復 2022-06-04
?
心有法竹

TA貢獻1866條經驗 獲得超5個贊

它看起來像代理問題,它阻止了依賴項的下載,所以settings.xml如果不存在,請進行一些更改或創建一個。


去c:\users\youruser\.m2\settings.xml.


<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0

                              http://maven.apache.org/xsd/settings-1.0.0.xsd">


 <proxies>

    <proxy>

      <id>myproxy</id>

      <active>true</active>

      <protocol>http</protocol>

      <username>user</username>  <!-- Put your username here -->

      <password>pass</password>  <!-- Put your password here -->

      <host>123.45.6.78</host>   <!-- Put the IP address of your proxy server here -->

      <port>80</port>            <!-- Put your proxy server's port number here -->

      <nonProxyHosts>maven</nonProxyHosts> <!-- Do not use this setting unless you know what you're doing. -->

    </proxy>    

  </proxies> 

</settings>


查看完整回答
反對 回復 2022-06-04
  • 2 回答
  • 0 關注
  • 255 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號