2015-05-04 33 views
0

我試圖使用mvn site:deploy命令部署項目相關信息,但出現以下錯誤。使用mvn站點後無法使用WebDAV協議將項目文檔發佈到Apache:deploy命令

有人請指導一下,因爲這裏缺少的是什麼?

錯誤日誌:

http://gsi-547576/sites/ - Session: Opened 
[INFO] Pushing C:\nital\my-pet-projects\istore\istore-mvc2\istore-mvc2-domain\target\site 
[INFO] >>> to http://gsi-547576/sites/./ 
May 04, 2015 4:18:58 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme 
INFO: digest authentication scheme selected 
May 04, 2015 4:18:58 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge 
INFO: No credentials available for DIGEST 'DAV-upload'@gsi-547576:80 
May 04, 2015 4:18:58 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme 
INFO: digest authentication scheme selected 
May 04, 2015 4:18:58 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge 
INFO: No credentials available for DIGEST 'DAV-upload'@gsi-547576:80 
May 04, 2015 4:18:58 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme 
INFO: digest authentication scheme selected 
May 04, 2015 4:18:58 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge 
INFO: No credentials available for DIGEST 'DAV-upload'@gsi-547576:80 
Transfer error: java.io.IOException: Unable to create collection: http://gsi-547576/sites/; status code = 401 
Uploading: .//css/maven-base.css to http://gsi-547576/sites/ 

#May 04, 2015 4:18:58 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme 
INFO: digest authentication scheme selected 
May 04, 2015 4:18:58 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge 
INFO: No credentials available for DIGEST 'DAV-upload'@gsi-547576:80 
http://gsi-547576/sites//./css/maven-base.css - Status code: 401 
Transfer error: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://gsi-547576/sites//./css/maven-base.css. Return code is: 401 
http://gsi-547576/sites/ - Session: Disconnecting 
http://gsi-547576/sites/ - Session: Disconnected 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.968 s 
[INFO] Finished at: 2015-05-04T16:18:58-04:00 
[INFO] Final Memory: 14M/219M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:deploy (default-cli) on project istore-mvc2-domain: Error uploading site: Failed to transfer fil 
sites//./css/maven-base.css. Return code is: 401 -> [Help 1] 

httpd.conf文件管理(WebDAV啓用的模塊)

LoadModule alias_module modules/mod_alias.so 
LoadModule auth_digest_module modules/mod_auth_digest.so 
LoadModule authn_file_module modules/mod_authn_file.so 
LoadModule dav_module modules/mod_dav.so 
LoadModule dav_fs_module modules/mod_dav_fs.so 
LoadModule dav_lock_module modules/mod_dav_lock.so 
LoadModule setenvif_module modules/mod_setenvif.so 

# Distributed authoring and versioning (WebDAV) 
Include conf/extra/httpd-dav.conf 

我已經使我WAMP的服務器上WebDAV協議和​​3210看起來是這樣的:

ht TPD-dav.conf

Alias /sites "C:/wamp/www/sites" 
<Directory "C:/wamp/www/sites"> 
    Dav On 

    Order Allow,Deny 
    Allow from all 

    AuthType Digest 
    AuthName DAV-upload 

    Options Indexes 

    AuthUserFile "C:/wamp/bin/apache/apache2.4.9/user.passwd" 
    AuthDigestProvider file 

    # Allow universal read-access, but writes are restricted 
    # to the admin user. 
    <LimitExcept GET OPTIONS> 
     require user admin 
    </LimitExcept> 
</Directory> 

生成並放置在文件夾中文件夾C:/wamp/bin/apache/apache2.4.9/的user.passwd文件。

的pom.xml

.... 
    <!-- Uploading project documentation/information --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-site-plugin</artifactId> 
      <version>3.4</version> 
      <dependencies> 
       <dependency><!-- add support for ssh/scp --> 
        <groupId>org.apache.maven.wagon</groupId> 
        <artifactId>wagon-ssh</artifactId> 
        <version>1.0</version> 
       </dependency> 
      </dependencies> 
     </plugin> 
    </plugins> 
    <!-- Uploading project documentation/information --> 
    <extensions> 
     <extension> 
      <groupId>org.apache.maven.wagon</groupId> 
      <artifactId>wagon-webdav-jackrabbit</artifactId> 
      <version>1.0-beta-7</version> 
     </extension> 
    </extensions> 
</build> 
<distributionManagement> 
    <site> 
     <id>my-wamp-server</id> 
     <url>dav:http://gsi-547576/sites/</url> 
    </site> 
</distributionManagement> 

的settings.xml

<servers> 
    <server> 
     <id>my-wamp-server</id> 
     <username>admin</username> 
     <password>admin123<password> 
    </server> 
</servers> 
+0

錯誤代碼'返回碼是:401'是問題,這意味着'未經授權'。你爲什麼使用這樣一個老式的旅行車WebDAV?看看這裏:http://maven.apache.org/wagon/wagon-providers/wagon-webdav-jackrabbit/順便說一句:爲什麼不使用scp或像Nexus這樣的存儲庫管理器,它包含一個站點,默認情況下可以使用默認http? – khmarbaise

+0

我搜索了一下,發現了一個關於WebDAV的在線教程,因此我正在使用它。但我願意提供更好的建議。我已經在另一臺Windows計算機上安裝了Nexus,但不知道如何將網站發佈到Apache Web Server。我不是Unix的人,對於WebDAV協議沒有太多的想法。你能指出任何在線教程或例子,我可以使用HTTP或Nexus來做到這一點嗎? – user2325154

+0

感謝您的指導。我終於可以使用章節http://books.sonatype.com/nexus-book/reference/_configuring_maven_for_site_deployment.html將該網站部署到Nexus – user2325154

回答

0

的Maven無法找到您的憑據。

信息:沒有可用於消化「DAV-上傳的憑證@ GSI-547576:80

按照Maven documentation你的settings.xml缺少設置標籤。

<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 
         https://maven.apache.org/xsd/settings-1.0.0.xsd"> 
    <servers> 
    <server> 
     <id>my-wamp-server</id> 
     <username>admin</username> 
     <password>admin123</password> 
    </server> 
    </servers> 
</settings> 
相關問題