Skip to content

Commit 7eaa535

Browse files
committed
Initial commit
0 parents  commit 7eaa535

16 files changed

Lines changed: 839 additions & 0 deletions

File tree

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Top-level EditorConfig file
2+
root = true
3+
4+
# Apply to all files
5+
[*]
6+
indent_size = 2
7+
indent_style = space
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: ci
2+
on:
3+
push:
4+
workflow_dispatch:
5+
inputs:
6+
trigger:
7+
description: Type m to trigger manual jobs
8+
required: false
9+
default: ''
10+
env:
11+
JAVA_VERSION: '21'
12+
JAVA_ZULU_DISTRIBUTION: 'zulu'
13+
JAVA_GRAALVM_DISTRIBUTION: 'graalvm'
14+
jobs:
15+
graalvm-24-tests:
16+
if: github.event.inputs.trigger == ''
17+
|| !startsWith(github.event.inputs.trigger, 'm')
18+
|| !startsWith(github.event.inputs.trigger, 'M')
19+
runs-on: ubuntu-latest
20+
env:
21+
JAVA_GRAALVM_DISTRIBUTION: 'graalvm'
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/cache@v4
25+
id: java-cache
26+
with:
27+
path: |
28+
~/.m2/repository
29+
!~/.m2/repository/io/github/daggerok
30+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml', '**/.mvn/**', '**/mvnw*') }}
31+
- uses: graalvm/setup-graalvm@v1
32+
with:
33+
java-version: ${{ env.JAVA_VERSION }}
34+
distribution: ${{ env.JAVA_GRAALVM_DISTRIBUTION }}
35+
- run: ./mvnw clean --no-transfer-progress ; ./mvnw --no-transfer-progress
36+
- run: java -jar target/*.jar
37+
zulu-24-tests:
38+
if: github.event.inputs.trigger == ''
39+
|| !startsWith(github.event.inputs.trigger, 'm')
40+
|| !startsWith(github.event.inputs.trigger, 'M')
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions/cache@v4
45+
id: java-cache
46+
with:
47+
path: |
48+
~/.m2/repository
49+
!~/.m2/repository/io/github/daggerok
50+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml', '**/.mvn/**', '**/mvnw*') }}
51+
- uses: actions/setup-java@v4
52+
with:
53+
java-version: ${{ env.JAVA_VERSION }}
54+
distribution: ${{ env.JAVA_ZULU_DISTRIBUTION }}
55+
- run: ./mvnw clean --no-transfer-progress ; ./mvnw --no-transfer-progress
56+
- run: java -jar target/*.jar
57+
mvn-versions-display-updates:
58+
if: github.event.inputs.trigger == ''
59+
|| !startsWith(github.event.inputs.trigger, 'm')
60+
|| !startsWith(github.event.inputs.trigger, 'M')
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/cache@v4
65+
id: java-cache
66+
with:
67+
path: |
68+
~/.m2/repository
69+
!~/.m2/repository/io/github/daggerok
70+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml', '**/.mvn/**', '**/mvnw*') }}
71+
- uses: actions/setup-java@v4
72+
with:
73+
java-version: ${{ env.JAVA_VERSION }}
74+
distribution: ${{ env.JAVA_ZULU_DISTRIBUTION }}
75+
- run: ./mvnw versions:display-plugin-updates -Dmaven.version.ignore=".*(alpha|beta|rc|milestone|M\d+|RC\d+).*" --no-transfer-progress
76+
- run: ./mvnw versions:display-parent-updates -Dmaven.version.ignore=".*(alpha|beta|rc|milestone|M\d+|RC\d+).*" --no-transfer-progress
77+
- run: ./mvnw versions:display-property-updates -Dmaven.version.ignore=".*(alpha|beta|rc|milestone|M\d+|RC\d+).*" --no-transfer-progress

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
target/
2+
!**/src/main/**/target/
3+
!**/src/test/**/target/
4+
5+
### IntelliJ IDEA ###
6+
.idea/
7+
*.iws
8+
*.iml
9+
*.ipr
10+
11+
### Eclipse ###
12+
.apt_generated
13+
.classpath
14+
.factorypath
15+
.project
16+
.settings
17+
.springBeans
18+
.sts4-cache
19+
20+
### NetBeans ###
21+
/nbproject/private/
22+
/nbbuild/
23+
/dist/
24+
/nbdist/
25+
/.nb-gradle/
26+
build/
27+
!**/src/main/**/build/
28+
!**/src/test/**/build/
29+
30+
### VS Code ###
31+
.vscode/
32+
33+
### Mac OS ###
34+
.DS_Store

.mvn/maven.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-T1C
2+
-ff
3+
-U
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

.run/App.run.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="App" type="Application" factoryName="Application" nameIsGenerated="true">
3+
<option name="MAIN_CLASS_NAME" value="io.github.daggerok.App" />
4+
<module name="maven-slf4j-main-starter" />
5+
<extension name="coverage">
6+
<pattern>
7+
<option name="PATTERN" value="io.github.daggerok.*" />
8+
<option name="ENABLED" value="true" />
9+
</pattern>
10+
</extension>
11+
<method v="2">
12+
<option name="Make" enabled="true" />
13+
</method>
14+
</configuration>
15+
</component>

.run/tests colored.run.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="tests colored" type="JUnit" factoryName="JUnit">
3+
<module name="maven-slf4j-main-starter" />
4+
<option name="PACKAGE_NAME" value="" />
5+
<option name="MAIN_CLASS_NAME" value="" />
6+
<option name="METHOD_NAME" value="" />
7+
<option name="TEST_OBJECT" value="package" />
8+
<option name="VM_PARAMETERS" value="-ea -Dlogback.configurationFile=src/test/resources/logback-colored.xml" />
9+
<method v="2">
10+
<option name="Make" enabled="true" />
11+
</method>
12+
</configuration>
13+
</component>

.run/tests.run.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="tests" type="JUnit" factoryName="JUnit">
3+
<module name="maven-slf4j-main-starter" />
4+
<option name="PACKAGE_NAME" value="" />
5+
<option name="MAIN_CLASS_NAME" value="" />
6+
<option name="METHOD_NAME" value="" />
7+
<option name="TEST_OBJECT" value="package" />
8+
<method v="2">
9+
<option name="Make" enabled="true" />
10+
</method>
11+
</configuration>
12+
</component>

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# maven-slf4j-main-starter [![ci](https://github.com/daggerok/maven-slf4j-main-starter-java-21/actions/workflows/ci.yml/badge.svg)](https://github.com/daggerok/maven-slf4j-main-starter-java-21/actions/workflows/ci.yml)
2+
Maven application project starter using maven wrapper, slf4j, assertj and java 21 (tested on Zulu and GraalVM)
3+
4+
## Getting Started
5+
6+
Create a new project
7+
8+
```bash
9+
npx --yes degit daggerok/maven-slf4j-main-starter-java-21 my-app && cd $_
10+
```
11+
12+
## Setup Development Environment
13+
14+
Install Java 21
15+
16+
```bash
17+
brew reinstall zulu@21 # graalvm@21
18+
19+
declare -f use # output:
20+
function use() {
21+
function usage() {
22+
echo "Usage:\n\tuse jdk 1.8\nor:\n\tuse graalvm 21"
23+
return
24+
}
25+
if [[ $# -eq 0 ]] ; then
26+
usage
27+
return -1
28+
fi
29+
if [[ $# -eq 2 ]] ; then
30+
USE_WHAT=${1:-jdk}
31+
if [[ "jdk" != "$USE_WHAT" && "graalvm" != "$USE_WHAT" ]] ; then
32+
usage
33+
return -2
34+
fi
35+
export JAVA_VERSION=${2:-21}
36+
else
37+
export JAVA_VERSION=${1:-21}
38+
fi
39+
if [[ "graalvm" == "$USE_WHAT" ]] ; then
40+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-$JAVA_VERSION.jdk/Contents/Home
41+
else
42+
export JAVA_HOME=$(/usr/libexec/java_home -v $JAVA_VERSION)
43+
fi
44+
export PATH=$JAVA_HOME/bin:$PATH
45+
return 0
46+
}
47+
```
48+
49+
## Test Build Run
50+
51+
```bash
52+
use zulu 21 ; java -version
53+
./mvnw clean ; ./mvnw ; java -jar target/*.jar
54+
```

0 commit comments

Comments
 (0)