.gitlab-ci.yml = = =
.....
build staging:
stage: build
image: maven: jdk-13
artifacts:
paths:
- target/*.jar
before_script:
- "mkdir -p ~/.m2 && cp .ci-settings.xml ~/.m2/settings.xml"
script: "mvn -Dnex.username=${nexususer} -Dnex.passwd=${nexuspasswd} package -B"
only:
- staging
.....
.ci-settings.xml = = =
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="
http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>myrepo</id>
<username>${nex.username}</username>
<password>${nex.passwd}</password>
</server>
<server>
<id>nexus-release</id>
<username>${nex.username}</username>
<password>${nex.passwd}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>ibec</id>
<url>https://nexus.******.com/repository/maven-public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>