Skip to content

Commit 2c7672d

Browse files
committed
Initial commit
0 parents  commit 2c7672d

15 files changed

Lines changed: 784 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: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
mvn-versions-display-updates:
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+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/cache@v4
23+
id: java-cache
24+
with:
25+
path: |
26+
~/.m2/repository
27+
!~/.m2/repository/io/github/daggerok
28+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml', '**/.mvn/**', '**/mvnw*') }}
29+
- uses: graalvm/setup-graalvm@v1
30+
with:
31+
java-version: ${{ env.JAVA_VERSION }}
32+
distribution: ${{ env.JAVA_GRAALVM_DISTRIBUTION }}
33+
- run: ./mvnw versions:display-parent-updates -Dmaven.version.ignore=".*(alpha|beta|rc|milestone|M\d+|RC\d+).*" --no-transfer-progress
34+
- run: ./mvnw versions:display-plugin-updates -Dmaven.version.ignore=".*(alpha|beta|rc|milestone|M\d+|RC\d+).*" --no-transfer-progress
35+
- run: ./mvnw versions:display-property-updates -Dmaven.version.ignore=".*(alpha|beta|rc|milestone|M\d+|RC\d+).*" --no-transfer-progress
36+
graalvm-24-tests:
37+
if: github.event.inputs.trigger == ''
38+
|| !startsWith(github.event.inputs.trigger, 'm')
39+
|| !startsWith(github.event.inputs.trigger, 'M')
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/cache@v4
44+
id: java-cache
45+
with:
46+
path: |
47+
~/.m2/repository
48+
!~/.m2/repository/io/github/daggerok
49+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml', '**/.mvn/**', '**/mvnw*') }}
50+
- uses: graalvm/setup-graalvm@v1
51+
with:
52+
java-version: ${{ env.JAVA_VERSION }}
53+
distribution: ${{ env.JAVA_GRAALVM_DISTRIBUTION }}
54+
- run: ./mvnw clean --no-transfer-progress ; ./mvnw --no-transfer-progress
55+
zulu-24-tests:
56+
if: github.event.inputs.trigger == ''
57+
|| !startsWith(github.event.inputs.trigger, 'm')
58+
|| !startsWith(github.event.inputs.trigger, 'M')
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: actions/cache@v4
63+
id: java-cache
64+
with:
65+
path: |
66+
~/.m2/repository
67+
!~/.m2/repository/io/github/daggerok
68+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml', '**/.mvn/**', '**/mvnw*') }}
69+
- uses: actions/setup-java@v4
70+
with:
71+
java-version: ${{ env.JAVA_VERSION }}
72+
distribution: ${{ env.JAVA_ZULU_DISTRIBUTION }}
73+
- run: ./mvnw clean --no-transfer-progress ; ./mvnw --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/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-lib-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-lib-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-lib-starter [![ci](https://github.com/daggerok/maven-slf4j-lib-starter-java-21/actions/workflows/ci.yml/badge.svg)](https://github.com/daggerok/maven-slf4j-lib-starter-java-21/actions/workflows/ci.yml)
2+
Maven library 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-lib-starter-21 my-lib && 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
50+
51+
```bash
52+
use zulu 21 ; java -version
53+
./mvnw clean ; ./mvnw
54+
```

0 commit comments

Comments
 (0)