Выпуск Maven Nexus - разрешение не удалось для 403JAVA

Программисты JAVA общаются здесь
Anonymous
Выпуск Maven Nexus - разрешение не удалось для 403

Сообщение Anonymous »

Мы были в этом вопросе уже несколько дней. /> Но, когда выполняется трубопровод Gitlab, мы получаем следующую ошибку: < /p>

Код: Выделить всё

[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>

Я также использовал следующее руководство: < /p>

https://blog.sonatype.com/how-to-use-gitlab-ci-with-nexus
My POM имеет приведенное ниже, с переменными ENV, настроенные в CI/CD/Settings/Variables:




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>

gitlab ci -бегун имеет следующее: < /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
< /code>

setting.xml на сервере Gitlab CI имеет следующую ссылку на пользователь Nexus: < /p>

maven-snapshots
[Adminuser]
[adminpassword]
< /p>

prable wry. />
Спасибо < /p>

Подробнее здесь: https://stackoverflow.com/questions/596 ... -forbidden

Вернуться в «JAVA»