image: maven:latest

stages:
  - clean
  - build
  - test
  - deploy

Clean Project files:
  stage: clean
  script: mvn clean

Compile new version:
  stage: build
  script: mvn compile

Run JUnit tests and verify:
  stage: test
  script: mvn verify
  artifacts:
    reports:
      junit:
      - target/surefire-reports/TEST-*.xml
      - target/failsafe-reports/TEST-*.xml

Deploy new version as Release:
  stage: deploy
  script:
    - mvn versions:set -DnewVersion=$CI_COMMIT_TAG
    - mvn assembly:assembly
