This is a multi-module project:
.zip
package for MetricsHub on Windows platforms..tar.gz
package of MetricsHub on Linux platforms.[!TIP] Looking for connectors? Check the MetricsHub Community Connectors repository.
To build the MetricsHub package, from ./metricshub
:
$ mvn clean package
mvn package
command within the MetricsHub root directory (metricshub
). You can find the .zip
package in the metricshub/metricshub-windows/target
directory upon completion (metricshub-windows-<version>.zip
).mvn package
command within the MetricsHub root directory (metricshub
). You can find the .tar.gz
package in the metricshub/metricshub-linux/target
directory upon completion (metricshub-linux-<version>.tar.gz
).
Docker
package is compatible with the debian:latest
image, it will be generated under the metricshub/metricshub-linux/target
directory (metricshub-linux-<version>-docker.tar.gz
).In this project, we use Checkstyle to ensure consistent and clean Java code across our codebase.
Maven Checkstyle Plugin is configured globally in the main pom.xml
file, and it verifies the Java code during the build process:
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
<configLocation>checkstyle.xml</configLocation>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>checkstyle</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
The Checkstyle rules that govern our code quality and style are defined in the ./checkstyle.xml
file. It's important to adhere to these rules to maintain code consistency and quality throughout the project.
The build will fail if one or more Checkstyle rules are violated.
To perform Checkstyle analysis and generate a report on violations, navigate to the directory of the Maven project you wish check and run the following mvn
command:
mvn checkstyle:checkstyle
All the encountered Checkstyle issues are reported under the target/site
directory.
To perform Checkstyle analysis and output violations to the console, navigate to the directory of the Maven project you wish check and run the following mvn
command:
mvn checkstyle:check
In this project, we maintain code formatting using prettier-java, a tool that helps ensure clean and consistent Java code. It automatically formats your code according to a predefined set of rules.
To automatically format the Java code in a specific Maven module, navigate to the directory of the Maven project you wish to format and run the following mvn
command:
mvn prettier:write
To validate the formatted code, navigate to the directory of the Maven project you wish to check and run the following mvn
command:
mvn prettier:check
The build will fail if you forgot to run Prettier.
Before you submit a PR, make sure to use the available tools for code formatting, and ensure that the style checks and unit tests pass.
License is GNU Affero General Public License v3.0. Each source file must include the AGPL-3.0 header (build will fail otherwise). To update source files with the proper header, simply execute the below command:
mvn license:update-file-header