Maven Nexus -Problem - Die Autorisierung hat für 403 Forbidden fehlgeschlagenJava

Java-Forum
Anonymous
 Maven Nexus -Problem - Die Autorisierung hat für 403 Forbidden fehlgeschlagen

Post by Anonymous »

Wir haben seit Tagen in diesem Problem. /> Aber wenn die GitLab -Pipeline ausgeführt wird, erhalten wir den folgenden Fehler: < /p>

Code: Select all

[ERROR] Failed to execute goal on project hello-component: Could not resolve dependencies for project x.y.z:hello-component:jar:1.6-SNAPSHOT: Failed to collect dependencies at a.b:c:jar:4.5.1132100: Failed to read artifact descriptor for b:c:jar:4.5.1132100: Could not transfer artifact a.b:c:pom:4.5.1132100 from/to maven-snapshots (http://host:8081/repository/maven-snapshots): Authorization failed for http://host:8081/repository/maven-snapshots/a/b/c/4.5.1132100/nidp-4.5.1132100.pom 403 Forbidden ->  [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project hello-component: Could not resolve dependencies for project x.y.z:hello-component:jar:1.6-SNAPSHOT: Failed to collect dependencies at a.b:c:jar:4.5.1132100
< /code>

Ich habe auch die folgende Anleitung verwendet: < /p>

https://blog.sonatype.com/how-to-use-gitlab-ci-with-nexus
Mein POM hat die folgenden mit Env -Variablen in CI/CD/Einstellungen/Variablen:

Code: Select all

     


org.apache.maven.plugins
maven-compiler-plugin
3.8.0

1.8
1.8



org.apache.maven.plugins
maven-surefire-plugin
2.22.1


org.sonatype.plugins
nexus-staging-maven-plugin
1.5.1


default-deploy
deploy

deploy




maven-snapshots
http://host:8081/repository/maven-snapshots
true







maven-snapshots
http://host:8081/repository/maven-snapshots


maven-releases
http://host:8081/repository/maven-releases






maven-snapshots
http://host:8081/repository/maven-snapshots


maven-releases
http://host:8081/repository/maven-releases


< /code>

Der GitLab CI -Läufer hat Folgendes: < /p>

image: maven:3.3.9-jdk-8

variables:
GIT_STRATEGY: clone
MAVEN_CLI_OPTS: "-s /opt/apache-maven-3.6.3/conf/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=/home/gitlab-runner/.m2/repository"

cache:
paths:
- /home/gitlab-runner/.m2/repository/
- target/

stages:
- build

CodeBuild:
stage: build
script:
- /opt/apache-maven-3.6.3/bin/mvn $MAVEN_CLI_OPTS -X clean package
artifacts:
name: “x—y-component"
paths:
- ./target/x—y-component.jar
Setting.xml on gitlab ci server has the following nexus user reference:

maven-snapshots
[adminuser]
[adminpassword]


Any help will be most appreciated.

Danke < /p>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post