Skip to content
Open
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
20 changes: 20 additions & 0 deletions .github/.m2/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>central</id>
<username>${env.USERNAME}</username>
<password>${env.PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>release</id>
<properties>
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
</properties>
</profile>
</profiles>
</settings>
31 changes: 31 additions & 0 deletions .github/workflows/maven-build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}'
167 changes: 164 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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

41 changes: 41 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
----
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<ratchetFrom>origin/main</ratchetFrom>
<java>
<cleanthat/>
<eclipse>
<file>icellmobilsoft-eclipse-code-formatter.xml</file>
</eclipse>
<importOrder>
<file>java-import-order.txt</file>
</importOrder>
<toggleOffOn/>
<removeUnusedImports/>
<forbidWildcardImports/>
<forbidModuleImports/>
<trimTrailingWhitespace/>
<endWithNewline/>
</java>
</configuration>
<dependencies>
<dependency>
<groupId>hu.icellmobilsoft</groupId>
<artifactId>java-dev-tools</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
----

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.
5 changes: 5 additions & 0 deletions codeformatter/eclipse/java-import-order.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0=java
1=javax
2=jakarta
3=org
4=com
121 changes: 121 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>hu.icellmobilsoft</groupId>
<artifactId>java-dev-tools</artifactId>
<version>0.1.0-SNAPSHOT</version>

<packaging>jar</packaging>

<scm>
<connection>scm:git:git@github.com:i-Cell-Mobilsoft-Open-Source/java-dev-tools.git</connection>
<developerConnection>scm:git:git@github.com:i-Cell-Mobilsoft-Open-Source/java-dev-tools.git</developerConnection>
<url>https://github.com/i-Cell-Mobilsoft-Open-Source/java-dev-tools</url>
<tag>HEAD</tag>
</scm>

<properties>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<version.maven.jar.plugin>3.5.0</version.maven.jar.plugin>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parent pom hasznalata praktikusabb lenne...

<version.maven.source.plugin>3.3.0</version.maven.source.plugin>
<version.maven.javadoc.plugin>3.6.0</version.maven.javadoc.plugin>
<version.maven.gpg.plugin>3.2.8</version.maven.gpg.plugin>
<version.central.publishing.plugin>0.9.0</version.central.publishing.plugin>
</properties>

<build>
<resources>
<resource>
<directory>codeformatter/eclipse</directory>
<includes>
<include>**/*.txt</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${version.maven.jar.plugin}</version>
<configuration>
<includes>
<include>**/*.txt</include>
<include>**/*.xml</include>
</includes>
</configuration>
</plugin>

<!-- Empty sources.jar for Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${version.maven.source.plugin}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- javadoc.jar for Maven Central -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${version.maven.javadoc.plugin}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${version.central.publishing.plugin}</version>
<extensions>true</extensions>
<configuration>
<autoPublish>true</autoPublish>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.maven.gpg.plugin}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading