Skip to content

Commit

Permalink
Merge pull request #48 from g4s8/pom
Browse files Browse the repository at this point in the history
Pom and checkstyle
  • Loading branch information
g4s8 authored Jul 17, 2022
2 parents 65f22a2 + 6156663 commit ff4204c
Show file tree
Hide file tree
Showing 16 changed files with 665 additions and 50 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ name: CI checks
branches:
- master
jobs:
maven-build:
build-verify:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
java: [8, 11, 15]
java: [8, 11, 15, 17]
jdk: [zulu, adopt]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: ${{ matrix.jdk }}
Expand All @@ -27,5 +27,22 @@ jobs:
key: ${{ runner.os }}_jdk-${{ matrix.jdk }}-${{ matrix.java }}_maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}_jdk-${{ matrix.jdk }}-${{ matrix.java }}_maven-
- name: Build
run: mvn -B package
- name: Verify
run: mvn -B verify -Pjava8
run: mvn -B verify
checkstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
- uses: actions/cache@v2.1.5
with:
path: ~/.m2/repository
key: ${{ runner.os }}_jdk-adopt-17_maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}_jdk-adopt-17_maven-
- run: mvn -B checkstyle:check
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ Fork and clone the repository:
git clone git@github.com:your-username/mime.git
```

Make changes and run Maven build:
Make changes and run Maven tests:
```
mvn clean install -Pqulice
mvn clean verify
```
Make sure code style is OK:
```
mvn checkstyle:check
```

If build command completed without errors push changes to your fork and create a pull request.
If build command completed without errors push changes to your fork and create a pull request,
I'll review it as soon as possible.
374 changes: 374 additions & 0 deletions checkstyle.xml

Large diffs are not rendered by default.

221 changes: 208 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
<groupId>wtf.g4s8</groupId>
<artifactId>mime</artifactId>
<version>1.0-SNAPSHOT</version>
<name>MIME</name>
<description>Media types (MIME types) RFC6838</description>
<packaging>jar</packaging>
<parent>
<groupId>com.artipie</groupId>
<artifactId>ppom</artifactId>
<version>v1.1.3</version>
</parent>
<url>https://github.com/g4s8/mime</url>
<licenses>
<license>
Expand Down Expand Up @@ -47,6 +44,16 @@
<junit-platform.version>5.7.1</junit-platform.version>
<surefire.version>3.0.0-M5</surefire.version>
</properties>
<distributionManagement>
<repository>
<id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>wtf.g4s8.oot</groupId>
Expand All @@ -58,6 +65,7 @@
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>provided</scope>
<version>2.2</version>
</dependency>
</dependencies>
<build>
Expand All @@ -80,6 +88,31 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.0</version>
</dependency>
</dependencies>
<configuration>
<configLocation>${project.basedir}/checkstyle.xml</configLocation>
<includeResources>true</includeResources>
<includeTestResources>true</includeTestResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
<testSourceDirectories>${project.build.testSourceDirectory}</testSourceDirectories>
<outputFile>${project.build.directory}/reports/checkstyle/checkstyle-result.xml</outputFile>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>true</linkXRef>
<violationSeverity>warning</violationSeverity>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down Expand Up @@ -155,18 +188,83 @@
<version>1.6.13</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.4.0,)</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-maven-plugin</artifactId>
<executions>
<execution>
<id>jcabi-versionalize-packages</id>
<phase>none</phase>
</execution>
</executions>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<optimize>true</optimize>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<useIncrementalCompilation>false</useIncrementalCompilation>
<compilerArgs>
<arg>-Xlint</arg>
<arg>-Werror</arg>
<arg>-Xlint:-path</arg>
<!-- @see https://stackoverflow.com/questions/44675503/why-safevarargs-doesnt-suppress-the-warning -->
<arg>-Xlint:-varargs</arg>
<!-- @see https://blogs.oracle.com/darcy/entry/bootclasspath_older_source -->
<arg>-Xlint:-options</arg>
<!-- ignore APT warnings -->
<arg>-Xlint:-processing</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -222,6 +320,103 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>sonatype</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>jar-sources</id>
<configuration>
<forceCreation>true</forceCreation>
</configuration>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>jar-javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>oss.sonatype.org</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<description>${project.version}</description>
<stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
</configuration>
<executions>
<execution>
<id>deploy-sonatype</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
<goal>release</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gpg-sign</id>
<activation>
<property>
<name>gpg.keyname</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>artipie-central</id>
<distributionManagement>
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/module-info.java

This file was deleted.

Loading

0 comments on commit ff4204c

Please sign in to comment.