Received status code 401 from server: Unauthorized using Maven

Open
#1,576 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start with the reported settings.xml, repository declaration, and POM dependency, then reproduce the Maven build using the Mapbox repository URL. Check whether the server id and authentication configuration match what Maven expects for the 401 response. Done means the mapbox-sdk-services 6.15.0 dependency resolves successfully without unauthorized errors.

Written by the indexing model from the issue text.

Description

Hi there,
I'm trying to build a project using mapbox sdk in JavaFX. If I try to build I'm getting the following error:

[ERROR] Failed to execute goal on project interfaces: Could not resolve dependencies for project testProject:interfaces:bundle:1.0.0-SNAPSHOT: Failed to collect dependencies at com.mapbox.mapboxsdk:mapbox-sdk-services:jar:6.15.0: Failed to read artifact descriptor for com.mapbox.mapboxsdk:mapbox-sdk-services:jar:6.15.0: Could not transfer artifact com.mapbox.mapboxsdk:mapbox-sdk-services:pom:6.15.0 from/to mapbox (https://api.mapbox.com/downloads/v2/releases/maven): authentication failed for https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-sdk-services/6.15.0/mapbox-sdk-services-6.15.0.pom, status: 401 Unauthorized

My settings.xml:
`

    <server>
        <id>mapbox</id>
        <username>mapbox</username>
		<password>Token with Downloads:READ property</password>
    </server>
</servers>`

and

<repository> <id>mapbox</id> <name>Mapbox repo</name> <url>https://api.mapbox.com/downloads/v2/releases/maven</url> </repository>

and finally POM.xml:
<dependency> <groupId>com.mapbox.mapboxsdk</groupId> <artifactId>mapbox-sdk-services</artifactId> <version>6.15.0</version> </dependency>

I also tried to use the following adress and succeeded to read the POM
https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/mapboxsdk/mapbox-sdk-services/6.15.0/mapbox-sdk-services-6.15.0.pom?access_token=MYTOKEN

Dominant language
Java
Stars
438
Forks
117
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/mapbox-java

All issues in mapbox/mapbox-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.