From a558b349e8abdeee3da878f945041ab6cab4189e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Kondoray?= Date: Tue, 16 Jun 2026 07:24:01 +0000 Subject: [PATCH 1/3] #28 feat: add import order file & pom.xml --- .gitignore | 167 +++++++++++++++++++- README.adoc | 41 +++++ codeformatter/eclipse/java-import-order.txt | 5 + pom.xml | 46 ++++++ 4 files changed, 256 insertions(+), 3 deletions(-) create mode 100644 codeformatter/eclipse/java-import-order.txt create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore index 9c97c70..4cf74b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,165 @@ -.idea -*.iml -.settings/ +# Created by https://www.toptal.com/developers/gitignore/api/maven,java,intellij,code +# Edit at https://www.toptal.com/developers/gitignore?templates=maven,java,intellij,code + +#!! ERROR: code is undefined. Use list command to see defined gitignore types !!# + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +# Eclipse m2e generated files +# Eclipse Core .project +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# End of https://www.toptal.com/developers/gitignore/api/maven,java,intellij,code + diff --git a/README.adoc b/README.adoc index f8f772c..23cfbe1 100644 --- a/README.adoc +++ b/README.adoc @@ -87,5 +87,46 @@ When modifying old code, tabs and spaces may be mixed on the same line. Therefor image::docs/images/image2020-10-30_12-38-59.png[] +== Setting up with Spotless Maven plugin: + +1) Add the following to your pom.xml: + +[xml] +---- + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + origin/main + + + + icellmobilsoft-eclipse-code-formatter.xml + + + java-import-order.txt + + + + + + + + + + + + hu.icellmobilsoft + java-dev-tools + 0.1.0-SNAPSHOT + + + +---- + +2) Run `mvn spotless:check` or `mvn spotless:apply` + +For detailed instructions on configuring and using the Spotless Maven plugin, refer to the https://github.com/diffplug/spotless/tree/main/plugin-maven[official documentation]. Copyright (C) 2023 i-Cell Mobilsoft Zrt. diff --git a/codeformatter/eclipse/java-import-order.txt b/codeformatter/eclipse/java-import-order.txt new file mode 100644 index 0000000..1a06721 --- /dev/null +++ b/codeformatter/eclipse/java-import-order.txt @@ -0,0 +1,5 @@ +0=java +1=javax +2=jakarta +3=org +4=com diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8116e7d --- /dev/null +++ b/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + hu.icellmobilsoft + java-dev-tools + 0.1.0-SNAPSHOT + + jar + + + 25 + 25 + UTF-8 + + 3.5.0 + + + + + + codeformatter/eclipse + + **/*.txt + **/*.xml + + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${version.maven.jar.plugin} + + + **/*.txt + **/*.xml + + + + + + From d964d6b3e97318fdd273b40450435dbb588bbaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Kondoray?= Date: Tue, 16 Jun 2026 10:41:51 +0000 Subject: [PATCH 2/3] #28 build: make packege maven central ready --- pom.xml | 75 ++++++++++++++++++++++++++++ src/main/java/stub/Stub.java | 13 +++++ src/main/java/stub/package-info.java | 4 ++ 3 files changed, 92 insertions(+) create mode 100644 src/main/java/stub/Stub.java create mode 100644 src/main/java/stub/package-info.java diff --git a/pom.xml b/pom.xml index 8116e7d..496eaaa 100644 --- a/pom.xml +++ b/pom.xml @@ -10,12 +10,23 @@ jar + + scm:git:git@github.com:i-Cell-Mobilsoft-Open-Source/java-dev-tools.git + scm:git:git@github.com:i-Cell-Mobilsoft-Open-Source/java-dev-tools.git + https://github.com/i-Cell-Mobilsoft-Open-Source/java-dev-tools + HEAD + + 25 25 UTF-8 3.5.0 + 3.3.0 + 3.6.0 + 3.2.8 + 0.9.0 @@ -41,6 +52,70 @@ + + + + org.apache.maven.plugins + maven-source-plugin + ${version.maven.source.plugin} + + + attach-sources + + jar-no-fork + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${version.maven.javadoc.plugin} + + + attach-javadocs + + jar + + + + + + + org.sonatype.central + central-publishing-maven-plugin + ${version.central.publishing.plugin} + true + + true + central + + + + + release + + + + org.apache.maven.plugins + maven-gpg-plugin + ${version.maven.gpg.plugin} + + + sign-artifacts + verify + + sign + + + + + + + + diff --git a/src/main/java/stub/Stub.java b/src/main/java/stub/Stub.java new file mode 100644 index 0000000..65d9b4d --- /dev/null +++ b/src/main/java/stub/Stub.java @@ -0,0 +1,13 @@ +package stub; + +/** + * Placeholder class for javadoc generation. + *

+ * This project does not contain Java sources. This stub exists solely to satisfy + * Maven Central's requirement for a javadoc jar. + *

+ */ +public final class Stub { + private Stub() { + } +} diff --git a/src/main/java/stub/package-info.java b/src/main/java/stub/package-info.java new file mode 100644 index 0000000..ce838a8 --- /dev/null +++ b/src/main/java/stub/package-info.java @@ -0,0 +1,4 @@ +/** + * Placeholder package for Maven Central javadoc jar. + */ +package stub; From 653dc4ba7cf42805da41210d31cb0ed9c6b3d69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Kondoray?= Date: Tue, 16 Jun 2026 10:42:09 +0000 Subject: [PATCH 3/3] #28 ci: add maven central publish workflow --- .github/.m2/settings.xml | 20 ++++++++++++ .github/workflows/maven-build-and-publish.yml | 31 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/.m2/settings.xml create mode 100644 .github/workflows/maven-build-and-publish.yml diff --git a/.github/.m2/settings.xml b/.github/.m2/settings.xml new file mode 100644 index 0000000..f7d0081 --- /dev/null +++ b/.github/.m2/settings.xml @@ -0,0 +1,20 @@ + + + + central + ${env.USERNAME} + ${env.PASSWORD} + + + + + release + + ${env.GPG_KEYNAME} + + + + diff --git a/.github/workflows/maven-build-and-publish.yml b/.github/workflows/maven-build-and-publish.yml new file mode 100644 index 0000000..691d276 --- /dev/null +++ b/.github/workflows/maven-build-and-publish.yml @@ -0,0 +1,31 @@ +name: Build & publish + +on: + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + - name: Set up JDK 25 + uses: actions/setup-java@v5 + with: + java-version: '25' + distribution: 'temurin' + cache: maven + + - name: Import GPG key + run: | + mkdir -p ~/.gnupg/ + echo "${{ secrets.GPG_SIGNING_KEY_GITHUB_TECHUSER }}" | base64 --decode > ~/.gnupg/private.key + gpg --import ~/.gnupg/private.key + + - name: Build & Publish to Maven Central + run: mvn deploy -B -s $GITHUB_WORKSPACE/.github/.m2/settings.xml -Prelease + env: + USERNAME: '${{ secrets.CENTRAL_SONATYPE_ORG_USER }}' + PASSWORD: '${{ secrets.CENTRAL_SONATYPE_ORG_PASSWORD }}' + GPG_KEYNAME: '${{ secrets.GPG_KEY_ID_GITHUB_TECHUSER }}'