Template for an Open Source Java project
All the following dependencies are free provided your project is Open Source.
-
Source repository and VCS
We use GitHub. Of course you can use another VCS here. What is nice with GitHub is the integration with Travis CI (see below). So here you only have to create a repository.
-
Continuous Integration
We use Travis CI and its connection to GitHub. See here how to activate this for your project. Then, the provided
.travis.yml
andbuild.gradle
files will do the job. -
Code Analysis
We use SonarQube for code analysis. This is not included in the works made by Travis CI. Therefore you have to run Gradle target
sonarqube
. By default thebuild.gradle
file works with a local SonarCube server onlocalhost:9000
. You will have to install and run your own server there or if you have access to another one to complete the information inbuild.gradle
. More information is here (note that Gradle includes a SonarCube plugin but it will be removed in Gradle 3.0). The technical badge is not generated automatically. You will have to change the value by hand each time you run SonarCube (this is too bad). -
Test Coverage
We use JaCoCo to produce test coverage reports. For the time being it does not support excluding private constructors from the analysis. Hence you won't get 100% coverage in the reports if you use them (e.g., in order to have a good SonarQube technical debt). To have JaCoCo support, nothing to do, the provided
.travis.yml
andbuild.gradle
files will do the job.We use Coveralls to produce test coverage history and statistics. See here how to activate this for your project. Then, the provided
.travis.yml
andbuild.gradle
files will do the job. -
Logging
We use Apache Log4j 2 for logging. A very basic set configuration files, in YAML format, is provided. More information is here. Note the use of distinct configurations files for the run (
src/main/resources/log4j2.yml
) and for the test (src/main/resources/log4j2-test.yml
). This enables you, e.g., to log different things and present them in different ways in test or in production. Of course different logging APIs can be used instead of Log4j. For example if you usejava.util.logging
you can remove the Log4j and jackson-dataformat dependencies frombuild.gradle
, and you don't need the Log4j configuration files. -
Licence Badges
We use shields.io to generate the Licence and the Technical Debt badge.
-
Documentation (soon ...)
-
Web Site (soon ...)