Configuring gitlab-ci.yml for simple java project

I have a simple java project with HelloWorld class , I want to add the CI/CD for this project by using the gitlab-ci.yml configuration file, I am trying to find the reference but am unable to find for simple java project , any help in configuring the above project is appreciated.

Thank you for having interests on GitLab CI.

You can check a simple java Hello World app with GitLab CI, here.

Hey shinya,
Thanks a lot for your help on the given response,
one more favor please,
The above conf. is to build and execute a single java file. how if we want to continuously integrate and build , run a java project / maven application etc.
Could you please give me some inputs to configure the yml with project specific please.


Probably you can google more exmaples, e.g.

1 Like

Hi Shinya,

Here where will the following vaues need to be configured.

script: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac