You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ramon Turnes Perez <Ra...@hermes-softlab.com> on 2009/05/06 10:03:20 UTC

Downloading from a secure repository

Hi,

we have set up an internal maven repository with Artifactory and disable
anonymous access so clients should authenticate themselves not only for
publishing to the repository but also for downloading. The set up works
for publishing, that is, maven client responds to server authentication
request and sends the username and password as configured in
settings.xml. 

But it does not work for downloading, that is, during the building
phase. It seems that maven client ignores the authentication request and
we just received the following message:

Authorization failed: Access denied to:
http://10.17.13.7:9080/artifactory/repo/org/apache/maven/plugins/maven-s
ite-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom

If we enable anonymous access for reading from the repository it works.
Any help would be appreciated.

We are using maven 2.1.0 and artifactory 2.0.5 with Java 1.5 on Windows
XP.

Thanks in advance.
Ramon.

We have followed the instructions as described in
http://maven.apache.org/guides/introduction/introduction-to-repositories
.html. Our configuration looks like this:

pom.xml:

  <repositories>
      <repository>
          <id>central</id>
          <url>http://10.17.13.7:9080/artifactory/repo</url>
          <snapshots>
              <enabled>false</enabled>
          </snapshots>
      </repository>
      <repository>
          <id>snapshots</id>
          <url>http://10.17.13.7:9080/artifactory/repo</url>
          <releases>
              <enabled>false</enabled>
          </releases>
      </repository>
  </repositories>
  <pluginRepositories>
      <pluginRepository>
          <id>central</id>
          <url>http://10.17.13.7:9080/artifactory/repo</url>
          <snapshots>
              <enabled>false</enabled>
          </snapshots>
      </pluginRepository>
      <pluginRepository>
          <id>snapshots</id>
          <url>http://10.17.13.7:9080/artifactory/repo</url>
          <releases>
              <enabled>false</enabled>
          </releases>
      </pluginRepository>
  </pluginRepositories>

  <distributionManagement>
      <repository>
          <id>repo-releases</id>
          <name>repo-releases</name>
 
<url>http://10.17.13.7:9080/artifactory/libs-releases-local</url>
      </repository>
      <snapshotRepository>
          <id>repo-snapshots</id>
          <name>repo-snapshots</name>
 
<url>http://10.17.13.7:9080/artifactory/libs-snapshots-local</url>
      </snapshotRepository>
  </distributionManagement>


settings.xml

    <servers>
        <server>
            <id>central</id>
            <username>username</username>
            <password>password</password>
        </server>
        <server>
            <id>repo-releases</id>
            <username>username</username>
            <password>password</password>
        </server>
        <server>
            <id>repo-snapshots</id>
            <username>username</username>
            <password>password</password>
        </server>
    </servers>

    <mirrors>
        <mirror>
          <id>artifactory</id>
          <mirrorOf>*</mirrorOf>
          <url>http://10.17.13.7:9080/artifactory/repo</url>
          <name>Artifactory</name>
        </mirror>
    </mirrors>

Re: Downloading from a secure repository

Posted by Anders Hammar <an...@hammar.net>.
Ok, great. I was kind of hoping it was a mistake on your side, as I
would be clueless otherwise. :-)

/Anders

On Wed, May 6, 2009 at 11:04, Ramon Turnes Perez
<Ra...@hermes-softlab.com> wrote:
> Hi again,
>
> Anders, you were right, putting repo id "artifactory" solves the problem. It did not work because I entered the wrong credentials.
>
> Regards.
> Ramon.
>
> -----Original Message-----
> From: Ramon Turnes Perez [mailto:Ramon.Turnes-Perez@hermes-softlab.com]
> Sent: 6. maj 2009 10:33
> To: Maven Users List
> Subject: RE: Downloading from a secure repository
>
> Thanks for your answer. I have tried it but it does not work.
>
> Regards.
> Ramon.
>
> -----Original Message-----
> From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
> Sent: 6. maj 2009 10:30
> To: Maven Users List
> Subject: Re: Downloading from a secure repository
>
> Possibly you should define credentials for the repo id "artifactory"
> in your settings.xml? As that's the id of the mirror being used.
>
> /Anders
>
> On Wed, May 6, 2009 at 10:03, Ramon Turnes Perez
> <Ra...@hermes-softlab.com> wrote:
>> Hi,
>>
>> we have set up an internal maven repository with Artifactory and disable
>> anonymous access so clients should authenticate themselves not only for
>> publishing to the repository but also for downloading. The set up works
>> for publishing, that is, maven client responds to server authentication
>> request and sends the username and password as configured in
>> settings.xml.
>>
>> But it does not work for downloading, that is, during the building
>> phase. It seems that maven client ignores the authentication request and
>> we just received the following message:
>>
>> Authorization failed: Access denied to:
>> http://10.17.13.7:9080/artifactory/repo/org/apache/maven/plugins/maven-s
>> ite-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
>>
>> If we enable anonymous access for reading from the repository it works.
>> Any help would be appreciated.
>>
>> We are using maven 2.1.0 and artifactory 2.0.5 with Java 1.5 on Windows
>> XP.
>>
>> Thanks in advance.
>> Ramon.
>>
>> We have followed the instructions as described in
>> http://maven.apache.org/guides/introduction/introduction-to-repositories
>> .html. Our configuration looks like this:
>>
>> pom.xml:
>>
>>  <repositories>
>>      <repository>
>>          <id>central</id>
>>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>>          <snapshots>
>>              <enabled>false</enabled>
>>          </snapshots>
>>      </repository>
>>      <repository>
>>          <id>snapshots</id>
>>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>>          <releases>
>>              <enabled>false</enabled>
>>          </releases>
>>      </repository>
>>  </repositories>
>>  <pluginRepositories>
>>      <pluginRepository>
>>          <id>central</id>
>>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>>          <snapshots>
>>              <enabled>false</enabled>
>>          </snapshots>
>>      </pluginRepository>
>>      <pluginRepository>
>>          <id>snapshots</id>
>>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>>          <releases>
>>              <enabled>false</enabled>
>>          </releases>
>>      </pluginRepository>
>>  </pluginRepositories>
>>
>>  <distributionManagement>
>>      <repository>
>>          <id>repo-releases</id>
>>          <name>repo-releases</name>
>>
>> <url>http://10.17.13.7:9080/artifactory/libs-releases-local</url>
>>      </repository>
>>      <snapshotRepository>
>>          <id>repo-snapshots</id>
>>          <name>repo-snapshots</name>
>>
>> <url>http://10.17.13.7:9080/artifactory/libs-snapshots-local</url>
>>      </snapshotRepository>
>>  </distributionManagement>
>>
>>
>> settings.xml
>>
>>    <servers>
>>        <server>
>>            <id>central</id>
>>            <username>username</username>
>>            <password>password</password>
>>        </server>
>>        <server>
>>            <id>repo-releases</id>
>>            <username>username</username>
>>            <password>password</password>
>>        </server>
>>        <server>
>>            <id>repo-snapshots</id>
>>            <username>username</username>
>>            <password>password</password>
>>        </server>
>>    </servers>
>>
>>    <mirrors>
>>        <mirror>
>>          <id>artifactory</id>
>>          <mirrorOf>*</mirrorOf>
>>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>>          <name>Artifactory</name>
>>        </mirror>
>>    </mirrors>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Downloading from a secure repository

Posted by Ramon Turnes Perez <Ra...@hermes-softlab.com>.
Hi again, 

Anders, you were right, putting repo id "artifactory" solves the problem. It did not work because I entered the wrong credentials.

Regards.
Ramon.

-----Original Message-----
From: Ramon Turnes Perez [mailto:Ramon.Turnes-Perez@hermes-softlab.com] 
Sent: 6. maj 2009 10:33
To: Maven Users List
Subject: RE: Downloading from a secure repository

Thanks for your answer. I have tried it but it does not work.

Regards.
Ramon.

-----Original Message-----
From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
Sent: 6. maj 2009 10:30
To: Maven Users List
Subject: Re: Downloading from a secure repository

Possibly you should define credentials for the repo id "artifactory"
in your settings.xml? As that's the id of the mirror being used.

/Anders

On Wed, May 6, 2009 at 10:03, Ramon Turnes Perez
<Ra...@hermes-softlab.com> wrote:
> Hi,
>
> we have set up an internal maven repository with Artifactory and disable
> anonymous access so clients should authenticate themselves not only for
> publishing to the repository but also for downloading. The set up works
> for publishing, that is, maven client responds to server authentication
> request and sends the username and password as configured in
> settings.xml.
>
> But it does not work for downloading, that is, during the building
> phase. It seems that maven client ignores the authentication request and
> we just received the following message:
>
> Authorization failed: Access denied to:
> http://10.17.13.7:9080/artifactory/repo/org/apache/maven/plugins/maven-s
> ite-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
>
> If we enable anonymous access for reading from the repository it works.
> Any help would be appreciated.
>
> We are using maven 2.1.0 and artifactory 2.0.5 with Java 1.5 on Windows
> XP.
>
> Thanks in advance.
> Ramon.
>
> We have followed the instructions as described in
> http://maven.apache.org/guides/introduction/introduction-to-repositories
> .html. Our configuration looks like this:
>
> pom.xml:
>
>  <repositories>
>      <repository>
>          <id>central</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <snapshots>
>              <enabled>false</enabled>
>          </snapshots>
>      </repository>
>      <repository>
>          <id>snapshots</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <releases>
>              <enabled>false</enabled>
>          </releases>
>      </repository>
>  </repositories>
>  <pluginRepositories>
>      <pluginRepository>
>          <id>central</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <snapshots>
>              <enabled>false</enabled>
>          </snapshots>
>      </pluginRepository>
>      <pluginRepository>
>          <id>snapshots</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <releases>
>              <enabled>false</enabled>
>          </releases>
>      </pluginRepository>
>  </pluginRepositories>
>
>  <distributionManagement>
>      <repository>
>          <id>repo-releases</id>
>          <name>repo-releases</name>
>
> <url>http://10.17.13.7:9080/artifactory/libs-releases-local</url>
>      </repository>
>      <snapshotRepository>
>          <id>repo-snapshots</id>
>          <name>repo-snapshots</name>
>
> <url>http://10.17.13.7:9080/artifactory/libs-snapshots-local</url>
>      </snapshotRepository>
>  </distributionManagement>
>
>
> settings.xml
>
>    <servers>
>        <server>
>            <id>central</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>        <server>
>            <id>repo-releases</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>        <server>
>            <id>repo-snapshots</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>    </servers>
>
>    <mirrors>
>        <mirror>
>          <id>artifactory</id>
>          <mirrorOf>*</mirrorOf>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <name>Artifactory</name>
>        </mirror>
>    </mirrors>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Downloading from a secure repository

Posted by Ramon Turnes Perez <Ra...@hermes-softlab.com>.
Thanks for your answer. I have tried it but it does not work.

Regards.
Ramon.

-----Original Message-----
From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
Sent: 6. maj 2009 10:30
To: Maven Users List
Subject: Re: Downloading from a secure repository

Possibly you should define credentials for the repo id "artifactory"
in your settings.xml? As that's the id of the mirror being used.

/Anders

On Wed, May 6, 2009 at 10:03, Ramon Turnes Perez
<Ra...@hermes-softlab.com> wrote:
> Hi,
>
> we have set up an internal maven repository with Artifactory and disable
> anonymous access so clients should authenticate themselves not only for
> publishing to the repository but also for downloading. The set up works
> for publishing, that is, maven client responds to server authentication
> request and sends the username and password as configured in
> settings.xml.
>
> But it does not work for downloading, that is, during the building
> phase. It seems that maven client ignores the authentication request and
> we just received the following message:
>
> Authorization failed: Access denied to:
> http://10.17.13.7:9080/artifactory/repo/org/apache/maven/plugins/maven-s
> ite-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
>
> If we enable anonymous access for reading from the repository it works.
> Any help would be appreciated.
>
> We are using maven 2.1.0 and artifactory 2.0.5 with Java 1.5 on Windows
> XP.
>
> Thanks in advance.
> Ramon.
>
> We have followed the instructions as described in
> http://maven.apache.org/guides/introduction/introduction-to-repositories
> .html. Our configuration looks like this:
>
> pom.xml:
>
>  <repositories>
>      <repository>
>          <id>central</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <snapshots>
>              <enabled>false</enabled>
>          </snapshots>
>      </repository>
>      <repository>
>          <id>snapshots</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <releases>
>              <enabled>false</enabled>
>          </releases>
>      </repository>
>  </repositories>
>  <pluginRepositories>
>      <pluginRepository>
>          <id>central</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <snapshots>
>              <enabled>false</enabled>
>          </snapshots>
>      </pluginRepository>
>      <pluginRepository>
>          <id>snapshots</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <releases>
>              <enabled>false</enabled>
>          </releases>
>      </pluginRepository>
>  </pluginRepositories>
>
>  <distributionManagement>
>      <repository>
>          <id>repo-releases</id>
>          <name>repo-releases</name>
>
> <url>http://10.17.13.7:9080/artifactory/libs-releases-local</url>
>      </repository>
>      <snapshotRepository>
>          <id>repo-snapshots</id>
>          <name>repo-snapshots</name>
>
> <url>http://10.17.13.7:9080/artifactory/libs-snapshots-local</url>
>      </snapshotRepository>
>  </distributionManagement>
>
>
> settings.xml
>
>    <servers>
>        <server>
>            <id>central</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>        <server>
>            <id>repo-releases</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>        <server>
>            <id>repo-snapshots</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>    </servers>
>
>    <mirrors>
>        <mirror>
>          <id>artifactory</id>
>          <mirrorOf>*</mirrorOf>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <name>Artifactory</name>
>        </mirror>
>    </mirrors>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Downloading from a secure repository

Posted by Anders Hammar <an...@hammar.net>.
Possibly you should define credentials for the repo id "artifactory"
in your settings.xml? As that's the id of the mirror being used.

/Anders

On Wed, May 6, 2009 at 10:03, Ramon Turnes Perez
<Ra...@hermes-softlab.com> wrote:
> Hi,
>
> we have set up an internal maven repository with Artifactory and disable
> anonymous access so clients should authenticate themselves not only for
> publishing to the repository but also for downloading. The set up works
> for publishing, that is, maven client responds to server authentication
> request and sends the username and password as configured in
> settings.xml.
>
> But it does not work for downloading, that is, during the building
> phase. It seems that maven client ignores the authentication request and
> we just received the following message:
>
> Authorization failed: Access denied to:
> http://10.17.13.7:9080/artifactory/repo/org/apache/maven/plugins/maven-s
> ite-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.pom
>
> If we enable anonymous access for reading from the repository it works.
> Any help would be appreciated.
>
> We are using maven 2.1.0 and artifactory 2.0.5 with Java 1.5 on Windows
> XP.
>
> Thanks in advance.
> Ramon.
>
> We have followed the instructions as described in
> http://maven.apache.org/guides/introduction/introduction-to-repositories
> .html. Our configuration looks like this:
>
> pom.xml:
>
>  <repositories>
>      <repository>
>          <id>central</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <snapshots>
>              <enabled>false</enabled>
>          </snapshots>
>      </repository>
>      <repository>
>          <id>snapshots</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <releases>
>              <enabled>false</enabled>
>          </releases>
>      </repository>
>  </repositories>
>  <pluginRepositories>
>      <pluginRepository>
>          <id>central</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <snapshots>
>              <enabled>false</enabled>
>          </snapshots>
>      </pluginRepository>
>      <pluginRepository>
>          <id>snapshots</id>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <releases>
>              <enabled>false</enabled>
>          </releases>
>      </pluginRepository>
>  </pluginRepositories>
>
>  <distributionManagement>
>      <repository>
>          <id>repo-releases</id>
>          <name>repo-releases</name>
>
> <url>http://10.17.13.7:9080/artifactory/libs-releases-local</url>
>      </repository>
>      <snapshotRepository>
>          <id>repo-snapshots</id>
>          <name>repo-snapshots</name>
>
> <url>http://10.17.13.7:9080/artifactory/libs-snapshots-local</url>
>      </snapshotRepository>
>  </distributionManagement>
>
>
> settings.xml
>
>    <servers>
>        <server>
>            <id>central</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>        <server>
>            <id>repo-releases</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>        <server>
>            <id>repo-snapshots</id>
>            <username>username</username>
>            <password>password</password>
>        </server>
>    </servers>
>
>    <mirrors>
>        <mirror>
>          <id>artifactory</id>
>          <mirrorOf>*</mirrorOf>
>          <url>http://10.17.13.7:9080/artifactory/repo</url>
>          <name>Artifactory</name>
>        </mirror>
>    </mirrors>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org