I am trying to set up my project’s CI/CD pipeline in GitLab and I am getting stuck at every turn. I am attempting to access package dependencies that are housed within the project in GitLab’s package repository, because a few of the .jar files we need are not located within Maven’s central repo. I keep getting a ‘401 Unauthorized’ error no matter how I configure my settings, pom, and yaml file. I’m fairly new to this, so I’m sure there’s something silly I’m missing, but I’m just not seeing it. The full error is below. I’m replacing references to company/project names with dummies but everything else is copy pasted from the trace.
Failed to execute goal on project foo: Could not resolve dependencies for project foo:bar:jar:0.4.0: Failed to collect dependencies at gov.nasa:worldwind:jar:2.2.1: Failed to read artifact descriptor for gov.nasa:worldwind:jar:2.2.1: Could not transfer artifact gov.nasa:worldwind:pom:2.2.1 from/to gitlab-maven (http://gitlab.lan.foobar.com/api/v4/projects/6/packages/maven): authentication failed for http://gitlab.lan.foobar.com/api/v4/projects/6/packages/maven/gov/nasa/worldwind/2.2.1/worldwind-2.2.1.pom, status: 401 Unauthorized -> [Help 1]
I have found the ci job token and am trying to use that in my settings and pom, but that has not fixed the issue. I’ve tried different configurations to get it to work, but to no avail. I tried to include the relevant parts of the pom, settings, and yaml files, but stackoverflow keeps flagging it as spam. I will include those in the comments or edit them in later.