Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not transfer artifact - not authorized

I want to use an artifact "eu.excitementproject:lap:jar:1.1.0:" from the following repository:

http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject

I can download the jar directly from the above link without any authorization.

However, when I mvn install on my computer, I get the following error:

Could not transfer artifact eu.excitementproject:lap:pom:1.1.0 from/to excitement 
(http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject): 
Not authorized

Here is the relevant part of my pom.xml:

  <repositories>
    <repository>
      <id>excitement</id>
      <name>excitement</name>
      <url>http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject</url>
    </repository>
  </repositories>

  <dependencies>
        <dependency>
            <groupId>eu.excitementproject</groupId>
            <artifactId>lap</artifactId>
            <version>1.1.0</version>
        </dependency>
  </dependencies>

What should I do?

like image 650
Erel Segal-Halevi Avatar asked Feb 11 '14 12:02

Erel Segal-Halevi


Video Answer


2 Answers

Your Maven configuration is:

  1. repository URL - http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject
  2. group-id - eu.excitementproject
  3. artifact-id - lap
  4. artifact-version - 1.1.1.

The full path to the artifact is therefore http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject/eu.excitementproject/lap/1.1.1/lap-1.1.1.pom.

If I hit this URL from any web browser, I am asked to authenticate using basic HTTP authentication. This is exactly what Maven also sees. Therefore, as @Will mentioned above, if you wish to continue using this repository URL, you will have to configure authentication settings for the repository in your local settings.xml.

Interestingly, I can hit http://hlt-services4.fbk.eu:8080/artifactory/repo/eu.excitementproject/lap/1.1.1/lap-1.1.1.pom without problems. So, if you shorten your repository URL to http://hlt-services4.fbk.eu:8080/artifactory/repo, your build will work (I have tested this).

like image 132
manish Avatar answered Sep 22 '22 12:09

manish


you can provide credentials to your artifactory using basic url authentification(https://developer.mozilla.org/en-US/docs/Web/HTTP/Basic_access_authentication). In your case repository url should be: http://USERNAME:[email protected]:8080/artifactory/repo/eu/excitementproject

like image 38
user2682809 Avatar answered Sep 19 '22 12:09

user2682809