Creating a Maven Job¶
This page explains you step by step how to create a Build job on CodeMC for a Maven Project.
For how to add a Gradle project, check the Creating a Gradle Job page.
Creating the Job¶
Important
In order to create a job will you need to be added to the Site first, if you haven't already.
To get added, join the Discord Server and follow the instructions in the #info
channel.
- Go to https://ci.codemc.io/job/:user/newJob (Replace
:user
with your user/organisation name) - Enter the job name in the top text box, and select
Maven project
. Click theOK
button at the bottom of the page. - Your job is now created! You should be redirected to the configuration page.
Configuration¶
Here are some recommendet configuration settings to set.
SCM¶
- In the
Source Code Management
(SCM) section, click on thegit
radio button. - Click on
Add repository
and paste your repository URL in the corresponding text field. - If you want to build only a specific branch, can you define it in the
Branch Specifier
field.
Build Trigger (Optional)¶
Note that you can configure CodeMC to automatically build each time you push changes to GitHub.
A tutorial for this can be found here.
- Click on
Poll SCM
- Put
*/5 * * * *
in the large text field, to make CodeMC check your GitHub project every 5 minutes.
Build Environment (Optional)¶
It's recommended to enable Add timestamps to the Console Output
Build¶
Important
In order to build a maven project using JDK 8 you will have to use a workaround
- Write the path to your pom.xml in the
Root POM
field. - In the
Goals and options
field, set your default maven goals.- If you want to deploy the artifacts to the CodeMC repository will you need to follow the steps explained in the FAQ
Post-build Actions¶
- Click on the
Add post-build action
button. - Select
Archive the artifacts
. - In
Files to archive
puttarget/*.jar
(default build directory) or**/target/*.jar
for multi-module projects. - Click on the
Advanced
button and set**/target/original-*.jar
in theExclusions
field.
Finishing¶
- Click the
Save
button. All changes will now be saved and applied and you will be redirected to your job's page. - To launch your first build, click the
Build Now
button on the left side. - CodeMC will now queue a build job and execute it. If you want to see the console of it, click on the rotating icon next to the build number under the
Build History
section.