If I recall correctly, there is a bug in the settings.

When you have a repository and a server with the same id, Maven gets confused.

So, do you also have a repository configured with id ourrepository?

Normally I postfix every server id with .server, so in this case the server id 
becomes ourrepository.server.

Hth,

Nick Stolwijk


-----Original Message-----
From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED]
Sent: Mon 11/26/2007 11:07 AM
To: users@maven.apache.org
Subject: maven goal deploy:deploy-file skips the authentication?
 
Hello, gentlemen, we are using Artifactory to hold the modules we're using in
Maven, for some weird reason we can't upload an artifact to the repository.

For example I want to deploy the artifact with such command:

mvn deploy:deploy-file -DgroupId=org.apache.hadoop \
    -DartifactId=hadoop-core \
    -Dversion=0.14.3 \
    -Dpackaging=jar \
    -Dfile=hadoop-0.14.3-core.jar \
    -DpomFile=/home/user/tmp/hadoop-0.14.3/hadoop-pom.xml \
    -DrepositoryId=ourrepository \
    -Durl=http://our.domain.com:8080/artifactory/[EMAIL PROTECTED]

in the ~/.m2/settings.xml I have:

<settings>
    <servers>
        <server>
            <id>ourrepository</id>
            <username>username</username>
            <password>password</password>
        </server>
    </servers>
</settings>

and when doing the dump of server request/response I can see following:

============================request======================
PUT /artifactory/[EMAIL 
PROTECTED]/org/apache/hadoop/hadoop-core/0.14.3/hadoop-core-0.14.3.jar HTTP/1.1
User-Agent: Java/1.6.0_03-p3
Host: our.domain.com:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 1360922
============================/request=====================

===========================response======================
HTTP/1.1 401 Authentication_is_required
WWW-Authenticate: Basic realm="Artifactory Realm"
Content-Type: text/html; charset=iso-8859-1
Content-Length: 1481
Server: Jetty(6.1.4)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 401 </title>
</head>
<body><h2>HTTP ERROR: 401</h2><pre>Authentication is required.</pre>
<p>RequestURI=/artifactory/[EMAIL 
PROTECTED]/org/apache/hadoop/hadoop-core/0.14.3/hadoop-core-0.14.3.jar</p><
p><i><small><a href="http://jetty.mortbay.org/";>Powered by 
Jetty://</a></small></i></p><br/>
===========================/response=====================

So it looks like the authentication credentials were not even sent to the
server. I double checked the repositoryId used in the command line and in the
settings.xml and found there's no typo. So could somebody please explain what
else I could miss and how to fix the problem or what do I need to do to
provide more details?

Thank you in advance!

-- 
Eugene N Dzhurinsky

Reply via email to