Skip to content

Commit

Permalink
feat: Add spotless support. Update licence
Browse files Browse the repository at this point in the history
  • Loading branch information
tzebrowski committed Jan 12, 2025
1 parent c425e19 commit b46bada
Show file tree
Hide file tree
Showing 355 changed files with 4,678 additions and 5,349 deletions.
16 changes: 16 additions & 0 deletions license-header
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright 2019-$YEAR, Tomasz Żebrowski
*
* <p>Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
139 changes: 70 additions & 69 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,21 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.github.tzebrowski</groupId>

<artifactId>obd-metrics</artifactId>

<version>11.1.0-SNAPSHOT</version>

<packaging>jar</packaging>

<name>OBD Metrics</name>

<description>
OBD Metrics is a Java OBD2 framework that is intended to simplify communication with OBD2 adapters like ELM327 clones.
The goal of the implementation is to provide a set of useful functions that can be a foundation for future OBD2 related applications.
</description>

<url>https://github.com/tzebrowski/ObdMetrics</url>

<licenses>
<license>
<name>Apache License 2.0</name>
</license>
</licenses>


<contributors>
<contributor>
<name>Tomasz Zebrowski</name>
Expand All @@ -37,7 +27,6 @@
<timezone>GMT/UTC + 01:00</timezone>
</contributor>
</contributors>

<developers>
<developer>
<name>Tomasz Zebrowski</name>
Expand All @@ -46,38 +35,33 @@
</roles>
</developer>
</developers>


<scm>
<connection>scm:git:git://github.com/tzebrowski/ObdMetrics.git</connection>
<developerConnection>scm:git:ssh://github.com:tzebrowski/ObdMetrics.git</developerConnection>
<url>http://github.com/tzebrowski/ObdMetrics/tree/master</url>
<tag>release</tag>
</scm>


<properties>
<java.version>1.8</java.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spotless.version>2.44.0</spotless.version>
</properties>

<repositories>
<repository>
<id>oss.sonatype.org.snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>oss.sonatype.org.snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

</repositories>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand All @@ -88,8 +72,6 @@
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>


<reporting>
<plugins>
<plugin>
Expand All @@ -106,9 +88,49 @@
</plugin>
</plugins>
</reporting>

<build>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<executions>
<execution>
<goals>
<goal>check</goal>
<goal>apply</goal>
</goals>
</execution>
</executions>
<configuration>
<ratchetFrom>origin/main</ratchetFrom>
<formats>
<format>
<includes>
<include>.gitattributes</include>
<include>.gitignore</include>
</includes>
<trimTrailingWhitespace />
<endWithNewline />
<indent>
<tabs>true</tabs>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<java>
<!--
<googleJavaFormat>
<version>1.8</version>
<style>AOSP</style>
</googleJavaFormat>
-->
<licenseHeader>
<file>${project.basedir}/license-header</file>
</licenseHeader>
</java>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand All @@ -130,28 +152,24 @@
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>


<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.20.0</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<outputDirectory>${delombok.output}</outputDirectory>
<addOutputDirectory>false</addOutputDirectory>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.20.0</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<outputDirectory>${delombok.output}</outputDirectory>
<addOutputDirectory>false</addOutputDirectory>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -168,9 +186,7 @@
</goals>
</execution>
</executions>
</plugin>


</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand All @@ -193,7 +209,6 @@
<goal>report</goal>
</goals>
</execution>

<execution>
<id>check</id>
<goals>
Expand Down Expand Up @@ -221,7 +236,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand All @@ -238,27 +252,22 @@
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>4.1.17</version>
</dependency>

<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.3.8</version>
</dependency>

<dependency>
<groupId>com.dynatrace.dynahist</groupId>
<artifactId>dynahist</artifactId>
<version>1.1</version>
</dependency>


<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand All @@ -281,13 +290,11 @@
<version>1.18.30</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.18.1</version>
</dependency>

<dependency>
<groupId>io.ultreia</groupId>
<artifactId>bluecove</artifactId>
Expand All @@ -300,21 +307,18 @@
<version>5.6.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.19</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.19</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
Expand All @@ -328,7 +332,6 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>release</id>
Expand All @@ -354,7 +357,7 @@
<configuration>
<additionalOptions>-html5</additionalOptions>
<sourcepath>${project.build.directory}/generated-sources/delombok</sourcepath>
</configuration>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -364,7 +367,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -379,7 +381,6 @@
</execution>
</executions>
</plugin>

</plugins>
</build>
</profile>
Expand Down
28 changes: 13 additions & 15 deletions src/main/java/org/obd/metrics/alert/Alert.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
/**
* Copyright 2019-2024, Tomasz Żebrowski
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
/**
* Copyright 2019-2025, Tomasz Żebrowski
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
**/
*/
package org.obd.metrics.alert;

import lombok.Getter;
Expand Down
Loading

0 comments on commit b46bada

Please sign in to comment.