maven-2 - Maven : Could not transfer artifact Erro

我使用 maven 2.2.1 和 Eclipse Helios 作为 IDE 当我从命令提示符运行 mvn deploy 时,部署成功 但是当我使用 Eclipse Maven 插件并尝试从那里部署时

我得到以下异常

[INFO] Total time: 1.148s
[INFO] Finished at: Mon Oct 03 21:22:57 IST 2011
[INFO] Final Memory: 10M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project bayer: Failed to deploy artifacts: Could not transfer artifact com.tata:bayer:pom:1.0 from/to Test (dav:http://127.0.0.1/sites/): Access denied to http://127.0.0.1/sites/com/tata/bayer/1.0/bayer-1.0.pom. Error code 401, Authorization Required -> [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.

在我的 POM.xml 文件中,我有这个

<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>1.0-beta-7</version>
</extension>
</extensions>

<distributionManagement>
    <repository>
   <id>Test</id>
  <name>Parent Project</name>
 <url>dav:http://127.0.0.1/sites/</url>
  </repository>
</distributionManagement>


and in M2_HOME Settings.xml file i have these 

 <servers>
    <server>
        <id>Test</id>
        <username>admin</username>
        <password>Testing</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
    </server>
    </servers>

终于在 Apache 网络服务器中,我将其用于存储库目的,我有这些

Alias /sites "/httpd-2.2-x64/sites"
<Directory "/httpd-2.2-x64/sites">
    Dav On

    Order Allow,Deny
    Allow from all
AllowOverride All
    AuthType Digest
    AuthName DAV-upload

    # You can use the htdigest program to create the password database:
    #   htdigest -c "/httpd-2.2-x64/user.passwd" DAV-upload admin
    AuthUserFile "/httpd-2.2-x64/user.passwd"
    AuthDigestProvider file

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

谁能告诉我为什么我会得到这个

错误代码 401,需要授权 -> [帮助 1]

(再次在 comamnd 提示下工作正常,但不是来自 Eclipse IDE Maven 插件)

非常感谢

最佳答案

检查您的 .settings.xml 文件,您必须在连接到远程存储库时设置用户名/密码....在海报的情况下,我认为这是错误的用户名/密码..

关于maven-2 - Maven : Could not transfer artifact Error code 401, 需要授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7637643/

相关文章:

asp.net - NHibernate:获取所有打开的 session

msbuild - 如何转储从 MSBuild 导入的属性表列表

sql-server - 从游标源 SQL Server 中删除行

sql - TABLOCK 和 TABLOCKX 定义示例

PHP 5.2 无法解释 - 文件停止正常执行

apache - "ExpiresDefault access"与 "ExpiresDefault

php - 从我的 Wordpress 插件中更改 wp_title

imagemagick - 在图像魔术中更改图像的背景

database-design - ERD - 鱼尾纹符号

domain-driven-design - 在域驱动设计中描述实体时,连续性线程意味着什么