Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
push:
branches:
- main
tags:
- 'v[0-9]+.*'
pull_request:
branches:
- main
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish package maven
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Publish package
run: mvn -B -P release deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ hs_err_pid*
replay_pid*

/target

# release plugin state files
/pom.xml.releaseBackup
/release.properties
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"editorconfig.editorconfig" // make sure basic editor configs align between developers
]
}
157 changes: 122 additions & 35 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>engineering.swat</groupId>
<artifactId>java-watch</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.5.0-RC5-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
<description>A java file watcher that works across platforms and supports recursion, single file watches, and tries to make sure no events are missed. Where possible it uses Java's NIO WatchService.</description>
<url>https://github.com/SWAT-engineering/java-watch</url>

<licenses>
<license>
<name>BSD-2-Clause</name>
Expand All @@ -43,6 +47,28 @@
</license>
</licenses>

<developers>
<developer>
<name>Davy Landman</name>
<email>davy.landman@swat.engineering</email>
<organization>swat.engineering</organization>
<organizationUrl>https://www.swat.engineering</organizationUrl>
</developer>
<developer>
<name>Sung-Shik Jongmans</name>
<email>sung-shik.jongmans@swat.engineering</email>
<organization>swat.engineering</organization>
<organizationUrl>https://www.swat.engineering</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/SWAT-engineering/java-watch.git</connection>
<developerConnection>scm:git:ssh://git@github.com/SWAT-engineering/java-watch.git</developerConnection>
<url>https://github.com/SWAT-engineering/java-watch/tree/main/</url>
<tag>v0.5.0-RC3</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<checkerframework.version>3.42.0</checkerframework.version>
Expand All @@ -54,52 +80,34 @@

<build>
<plugins>
<plugin>
<plugin> <!-- configure java compiler -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.14.0</version>
<configuration>
<release>11</release>
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<plugin> <!-- automate release commits -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<!-- do not use the build in release profile, we invoke it later -->
<releaseProfiles />
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
<plugin>
<plugin> <!-- unit test integration -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.5.3</version>
</plugin>
<plugin>
<plugin> <!-- code coverage -->
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.13</version>
<executions>
<execution>
<goals>
Expand All @@ -115,11 +123,11 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin> <!-- enforce license headers -->
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<!-- mvn license:format adds/updates all license headers -->
<version>4.6</version>
<version>5.0.0</version>
<configuration>
<licenseSets>
<licenseSet>
Expand All @@ -142,7 +150,7 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin> <!-- enforce editor config on the files -->
<groupId>org.ec4j.maven</groupId>
<artifactId>editorconfig-maven-plugin</artifactId>
<version>0.1.3</version>
Expand All @@ -157,6 +165,26 @@
</execution>
</executions>
</plugin>
<plugin> <!-- use a new version of maven -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>(3.9,)</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -197,6 +225,64 @@
</dependencies>

<profiles>
<profile> <!-- releasing to maven central -->
<id>release</id>
<build>
<plugins>
<plugin><!-- uploading to maven central-->
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
<plugin> <!-- sign jar for maven central-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <!-- generate java-doc -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <!-- generate sources jar -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>


<profile> <!-- run with: mvn clean compile -P checker-framework -->
<id>checker-framework</id>
<build>
Expand All @@ -205,6 +291,7 @@
<!-- This plugin will set properties values using dependency information -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<goals>
Expand All @@ -216,7 +303,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.14.0</version>
<configuration>
<fork>true</fork>
<release>11</release>
Expand Down