作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 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/
我是一名优秀的程序员,十分优秀!