Probleme de déployement de spring boot 3 sur VPS avec gitlab
Bonjour,
moi et mon collègue, on est entrain de mettre en prod notre projet spring boot sur un vps, le but étant de déployer la màj du projet après chaque push via Gitlab.
cependant nous bloquons sur une erreur:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.673 s
[INFO] Finished at: 2024-10-03T17:45:08Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.3:deploy (default-deploy) on project rh_quizz: Failed to retrieve remote metadata com.company:rh_quizz:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.company:rh_quizz:0.0.1-SNAPSHOT/maven-metadata.xml from/to gitlab-maven https://ovh.company.lu:8443/api/v4/p...kages/maven(): status code: 401, reason phrase: Unauthorized (401) -> [Help 1]
le probleme c'est qu'on ne sait pas de quel credentials il a besoin
ni si les urls vers les repository sont corrects (cette url "/api/v4/projects/2/packages/maven" me semble bizarre)
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://ovh.company.lu:8443/api/v4/projects/2/packages/maven></url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>https://ovh.company.lu:8443/api/v4/projects/2/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>https://ovh.company.lu:8443/api/v4/projects/2/packages/maven</url>
</snapshotRepository>
</distributionManagement>
quand je tente un curl:
curl --header "root: 123456" https://ovh.company.lu:9300/backend/rh_quizz.git
<html><body>You are being <a href="https://ovh.company.lu:9300/users/sign_in">redirected</a>.</body></html>%
voici le contenu du fichier gitalb-ci.yml:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| stages:
- build
- deploy
package:
image: maven:3.9.6-eclipse-temurin-21-jammy
stage: build
tags:
- maven-jdk-21 # tag provided during runner registration
script:
- mvn package -B
artifacts:
paths:
- target/rh_quizz.jar
deploy:
stage: deploy
tags:
- maven-jdk-21
script:
- mvn deploy |
et le contenu du fichier .m2/settings.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>gitlab-maven</id>
<username>root</username>
<password>123456</password>
</server>
</servers>
</settings> |
Auriez vous une idée de ce qui pourrait poser problème ?
Par avance merci pour votre aide :)
Tom