Factor Three
Factor Three

Reputation: 2284

Access to JAR file fails in Artifactory repository

I have deployed a JAR file to a custom Artifactory repository (called my_custom_repo), and am attempting to access it in a Maven build. My POM file points to my artifactory repo using the tag:

    <repositories>
       <repository>
       <id>snapshots</id>
       <name>c70766072326c-snapshots</name>
       <url>http://mymachine:8081/artifactory/my_custom_repo</url>
      </repository>
    </repositories>

And my dependency is set up as follows:

<dependency>
   <groupId>mygroupid</groupId>
   <artifactId>reslib</artifactId>
   <version>0.1.0</version>
</dependency>

I have also set Artifactory to give anonymous access (for reading, of course) to the my_custom_repo.

I have been attempting to build my application. The build is failing with the following error message:

 Could not resolve dependencies for project com.factor3.apps:myserver:jar:0.0.1: Failed to collect 
dependencies at mygroupid.libs:reslib:jar:0.1.0: Failed to read artifact descriptor for
mygroupid:reslib:jar:0.1.0: Could not transfer artifact mygroupid:reslib:pom:0.1.0 from/to snapshots 
(http://mymachine1:8081/artifactory/my_custom_repo/): Not authorized -> [Help 1]

I have attempted a few things, including a mvn clean install. The failure persists.

Is there some configuration of my POM file, Maven, or Artifactory what will enable me to successfully compile my project?

Upvotes: 1

Views: 738

Answers (1)

Daniele
Daniele

Reputation: 2837

Using the default (out-of-the-box) security settings- it looks like enabling "anonymous access" will give read access to the remote repositories only.

To give read access to local repos for the anonymous user: go to Admin > Security > Permissions, edit the Anything permission, and turn on the "Any Local Repository" checkbox.

(note that the "anything" permission only contains group=readers. If you want to give anonymous write/deploy rights, you can create a "writers" group, and add the "deploy/cache" action for that group)

(tried with: artifactory-oss-6.14.1)

Upvotes: 3

Related Questions