Hi Dit,
One really easy way to get this working is using Pipeline. We've released a new version of Pipeline recently with use case driven documentation that is aimed to get people started quickly.
With Pipeline you checkin a
Jenkinsfile into the root of your Git repository to control how the build is run. I've provided an example from the
simple quick start guide on the wiki below. The quick start example uses Docker to provide a Maven and Java 8 environment to run the build in (I very much recommend giving it a try). If you don't want to use Docker,
there are a few other options to look at.
I hope this is useful to you!
pipeline {
agent docker:'maven:3.3.3'
stages {
stage('build') {
sh 'mvn --version'
sh 'mvn install'
}
}
}