2015-11-02 25 views
2

我想下載使用wget傳遞-A參數和通配符「* .jar」的jar文件,但jenkins不下載jar文件。相同的命令適用於非詹金斯網址。有沒有人得到這與詹金斯合作。高度讚賞你的投入。Jenkins wget使用通配符的神器

wget --no-check-certificate --auth-no-challenge -A "*.jar" -r -l 1 -nd "https://jenkins.xxxx.com/job/xxxx/6/artifact/target/" 
--2015-11-02 06:24:36-- https://jenkins.xxxx.com/job/xxxx/6/artifact/target/ 
Resolving jenkins.xxxx.com... 1.1.1.1 
Connecting to jenkins.xxxx.com|1.1.1.1|:443... connected. 
HTTP request sent, awaiting response... 302 Found 
Location: https://jenkins.xxxx.com/job/xxxx/6/artifact/target/ [following] 
--2015-11-02 06:24:37-- https://jenkins.xxxx.com/job/xxxx/6/artifact/target/ 
Reusing existing connection to jenkins.xxxx.com:443. 
HTTP request sent, awaiting response... 200 OK 
Length: unspecified [text/html] 
Saving to: `index.html' 
[ <=>                                    ] 12,420  --.-K/s in 0s 
2015-11-02 06:24:37 (592 MB/s) - `index.html' saved [12420] 

Loading robots.txt; please ignore errors. 
--2015-11-02 06:24:37-- https://jenkins.xxxx.com/robots.txt 
Connecting to jenkins.xxxx.com|1.1.1.1|:443... connected. 
HTTP request sent, awaiting response... 404 Not Found 
2015-11-02 06:24:37 ERROR 404: Not Found. 

Removing index.html since it should be rejected. 

FINISHED --2015-11-02 06:24:37-- 
Downloaded: 1 files, 12K in 0s (592 MB/s) 

回答

1

更新:重溫這一點,我實現了詹金斯服務器實際上是無法滿足its robots.txt file

Loading robots.txt; please ignore errors. 
--2015-11-02 06:24:37-- https://jenkins.xxxx.com/robots.txt 
Connecting to jenkins.xxxx.com|1.1.1.1|:443... connected. 
HTTP request sent, awaiting response... 404 Not Found 
2015-11-02 06:24:37 ERROR 404: Not Found. 

在此之後的404錯誤,wget解釋,就不可能保持它具有index.html已下載:

Removing index.html since it should be rejected. 

快速查找在wget manual收益率拒絕:

(...)接受/拒絕列表匹配兩次對下載的文件: 一旦對URL的文件名部分,以確定是否該文件 應該首先下載;那麼在接受併成功下載 之後,本地文件的名稱也將被 檢查爲接受/拒絕列表,以查看是否應該刪除 。 理由是,由於'.htm'和'.html'文件總是被下載,無論接受/拒絕規則如何,在被下載和掃描鏈接後,他們應該被刪除 ,如果他們確實 匹配接受/拒絕列出了

這意味着您最初請求的URL已下載並掃描了鏈接,但沒有一個鏈接匹配*.jar,因此沒有檢索到任何鏈接。然後,最初請求的index.html被刪除,因爲它的名稱也不匹配*.jar

看起來好像沒有鏈接到您要直接在此頁面下載的.jar工件。具有諷刺意味的是,這意味着我最終會建議像以前一樣 - 嘗試使用-l2而不是-l1將子目錄遞歸增加一級。正如我在我之前的回答中所述,我曾在本地Jenkins安裝中嘗試過,實際上我需要-l2從那裏下載一個工件(但確切的級別可能取決於項目設置和文件夾結構)。請嘗試:

wget --no-check-certificate --auth-no-challenge -A "*.jar" -r -l2 -nd "https://jenkins.xxxx.com/job/xxxx/6/artifact/target/"