diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2430ca680aedd6ed53bf48d082f9f787e4225acf..c57b2c56d34aa384ee2e8c561afc74a1ae0b1a3d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: maven:latest +image: maven:3-eclipse-temurin-17 variables: # This will supress any download for dependencies and plugins or upload messages which would clutter the console log. @@ -14,6 +14,11 @@ cache: paths: - .m2/repository +stages: + - build + - test + - deploy + build: stage: build script: @@ -23,3 +28,10 @@ test: stage: test script: - mvn test + +deploy: + stage: deploy + rules: + - if: $CI_COMMIT_TAG + script: + - mvn deploy -s ci_settings.xml diff --git a/ci_settings.xml b/ci_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..59c8c271cb4549ebcad535c1c9e1907839ba440f --- /dev/null +++ b/ci_settings.xml @@ -0,0 +1,16 @@ +<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>gitlab-maven</id> + <configuration> + <httpHeaders> + <property> + <name>Job-Token</name> + <value>${env.CI_JOB_TOKEN}</value> + </property> + </httpHeaders> + </configuration> + </server> + </servers> +</settings> diff --git a/pom.xml b/pom.xml index b63e72171af3e8043d8d27cdf108251593cd6e1b..04483d44d64ba2ac7f81ff22e4b9b4ac1517959a 100644 --- a/pom.xml +++ b/pom.xml @@ -12,32 +12,19 @@ <packaging>jar</packaging> <properties> - <jdk.version>11</jdk.version> + <jdk.version>17</jdk.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <jqwik.version>1.3.0</jqwik.version> - <junit.version>5.6.2</junit.version> - <junitplatform.version>1.6.2</junitplatform.version> + <jqwik.version>1.8.4</jqwik.version> + <junit.version>5.10.2</junit.version> + <junitplatform.version>1.10.2</junitplatform.version> </properties> <repositories> <repository> - <snapshots> - <enabled>false</enabled> - </snapshots> <id>central</id> <name>Central Repository</name> <url>https://repo.maven.apache.org/maven2</url> </repository> - <repository> - <id>jcenter</id> - <name>jcenter</name> - <url>https://jcenter.bintray.com/</url> - </repository> - <repository> - <id>ftdev</id> - <name>ftdev</name> - <url>http://ftdev.utu.fi/maven2</url> - </repository> </repositories> <dependencies> @@ -148,21 +135,16 @@ </plugin> </plugins> - <extensions> - <!-- Enables the use of SSH for deployments --> - <extension> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-ssh</artifactId> - <version>3.4.1</version> - </extension> - </extensions> </build> + <distributionManagement> - <!-- where to deploy the package --> <repository> - <id>ftdev</id> - <name>UTU tech ftdev repository</name> - <url>scp://localhost:2222/var/www/maven2</url> + <id>gitlab-maven</id> + <url>${env.CI_API_V4_URL}/projects/${env.CI_PROJECT_ID}/packages/maven</url> </repository> + <snapshotRepository> + <id>gitlab-maven</id> + <url>${env.CI_API_V4_URL}/projects/${env.CI_PROJECT_ID}/packages/maven</url> + </snapshotRepository> </distributionManagement> </project>