I currently have these gitlab stages outlined below in my .gitlab-ci.yml
I created it this way to visualize in gitlab each maven stage in the pipeline. however, because maven automatically executes preceding stages in the build life cycle it means i’m wasting a lot of time and cpu in the test and deploy gitlab stages because these re-execute their preceding maven stages.
Is it possible for gitlab and maven to play nicely so I can visualize each maven stage visually in gitlab without maven re-executing previous stages in the build lifecycle and instead use the artifacts from the previous job in the pipeline?
Or, do I need to just consolidate the three stages into a single, ‘mvn clean deploy -U’ stage?
- echo ‘Building’
- mvn $MAVEN_CLI_OPTS -T 4 clean install -U
- echo ‘Testing’
- mvn $MAVEN_CLI_OPTS test
expire_in: 1 week
- echo ‘Deploying to Nexus’
- ‘mvn $MAVEN_CLI_OPTS deploy -U’