diff --git a/.gitignore b/.gitignore index 8c5352a..156e05c 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ target/ hs_err_pid* replay_pid* +# Flatten files # +.flattened-pom.xml + ### IntelliJ IDEA ### .idea/modules.xml .idea/jarRepositories.xml diff --git a/.releaserc.yml b/.releaserc.yml index d01e172..37d0867 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -12,7 +12,7 @@ plugins: - - "@semantic-release/changelog" - changelogFile: CHANGELOG.md - - "@semantic-release/exec" - - prepareCmd: "./mvnw versions:set -DnewVersion=${nextRelease.version}" + - prepareCmd: "./mvnw versions:set-property -Dproperty=revision -DnewVersion=${nextRelease.version}" - "@semantic-release/github" - - "@semantic-release/git" - assets: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..92a14e4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# v1.0.0-alpha.1 (2024-09-07) + +## ✨ New Features +- [`a594d95`](https://github.com/lengors/maven-lombok-template/commit/a594d95) Added example for `lombok` usage + +# v1.0.0-dev.1 (2024-09-07) + +## ✨ New Features +- [`a594d95`](https://github.com/lengors/maven-lombok-template/commit/a594d95) Added example for `lombok` usage diff --git a/core/pom.xml b/core/pom.xml new file mode 100644 index 0000000..929cf0c --- /dev/null +++ b/core/pom.xml @@ -0,0 +1,402 @@ + + + 4.0.0 + + io.github.lengors + maven-lombok-template-parent + ${revision} + + + io.github.lengors + maven-lombok-template + ${revision} + maven-lombok-template + https://github.com/lengors/maven-lombok-template + Template repository for maven projects written in java and that require the usage of lombok. + + + + lengors + 24527258+lengors@users.noreply.github.com + + + + + https://github.com/lengors/maven-lombok-template + + + + + The Unlicense + https://unlicense.org/UNLICENSE + + + + + + + false + false + false + + + 0.5.0 + 3.6.0 + 3.4.0 + 3.3.1 + 3.13.0 + 3.7.1 + 0.8.12 + 3.3.1 + 3.2.4 + + + + + org.checkerframework + checker-qual + + + + org.projectlombok + lombok + provided + + + + org.junit.jupiter + junit-jupiter + test + + + + org.mockito + mockito-core + + + org.mockito + mockito-junit-jupiter + test + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven.checkstyle.version} + + true + checkstyle.xml + + + + + org.apache.maven.plugins + maven-resources-plugin + ${maven.resources.version} + + + copy-javadoc + package + + copy-resources + + + ${project.build.directory} + + + ${project.basedir}/../javadoc/target + + maven-lombok-template-${revision}-javadoc.jar + + + + + + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven.source.version} + + + attach-sources + verify + + jar-no-fork + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${maven.build-helper.version} + + + io.github.lengors + maven-lombok-template-javadoc + ${revision} + + + + + attach-javadoc + verify + + attach-artifact + + + + + ${project.build.directory}/maven-lombok-template-${revision}-javadoc.jar + jar + javadoc + + + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven.gpg.version} + + ${MAVEN_GPG_KEYNAME} + + + + sign-artifacts + verify + + sign + + + + + + + org.sonatype.central + central-publishing-maven-plugin + ${maven.central-publishing.version} + true + + central + true + published + + + + + org.jacoco + jacoco-maven-plugin + ${maven.jacoco.version} + + + prepare-agent + + prepare-agent + + + + report + + report + + + + XML + + + + + + + + + + + + + checkerframework + + + [1.8,) + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + true + + + org.projectlombok + lombok + ${maven.lombok.version} + + + + org.checkerframework + checker + ${maven.checkerframework.version} + + + + + org.checkerframework.checker.nullness.NullnessChecker + org.checkerframework.checker.resourceleak.ResourceLeakChecker + + + lombok.launch.AnnotationProcessorHider$AnnotationProcessor + lombok.launch.AnnotationProcessorHider$ClaimingProcessor + + + -Xmaxerrs + 10000 + -Xmaxwarns + 10000 + + + + + + + + + checkerframework-jdk8 + + 1.8 + + + + 9+181-r4173-1 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + copy + + process-sources + + com.google.errorprone:javac:${javac.version}:jar + ${project.build.directory}/javac + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + -J-Xbootclasspath/p:${project.build.directory}/javac/javac-${javac.version}.jar + + + + + + + + + checkerframework-jdk9orlater + + [9,) + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + + + + + + jar + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven.jar.version} + + + + true + io.github.lengors.maven_java_template.Example + + + + + + + + + + assemble + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven.assembly.version} + + + + io.github.lengors.maven_java_template.Example + + + + jar-with-dependencies + + + + + package + + single + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/io/github/lengors/maven_java_template/Example.java b/core/src/main/java/io/github/lengors/maven_lombok_template/Example.java similarity index 90% rename from src/main/java/io/github/lengors/maven_java_template/Example.java rename to core/src/main/java/io/github/lengors/maven_lombok_template/Example.java index 8656f46..4546bc5 100644 --- a/src/main/java/io/github/lengors/maven_java_template/Example.java +++ b/core/src/main/java/io/github/lengors/maven_lombok_template/Example.java @@ -1,4 +1,4 @@ -package io.github.lengors.maven_java_template; +package io.github.lengors.maven_lombok_template; /** * Example for project template. diff --git a/core/src/main/java/io/github/lengors/maven_lombok_template/ExampleData.java b/core/src/main/java/io/github/lengors/maven_lombok_template/ExampleData.java new file mode 100644 index 0000000..7b10d5d --- /dev/null +++ b/core/src/main/java/io/github/lengors/maven_lombok_template/ExampleData.java @@ -0,0 +1,17 @@ +package io.github.lengors.maven_lombok_template; + +import lombok.Value; + +/** + * Example data value for Lombok. + * + * @author lengors + */ +@Value +public class ExampleData { + + /** + * Example property used in Lombok example. + */ + private String example; +} diff --git a/src/main/java/io/github/lengors/maven_java_template/package-info.java b/core/src/main/java/io/github/lengors/maven_lombok_template/package-info.java similarity index 59% rename from src/main/java/io/github/lengors/maven_java_template/package-info.java rename to core/src/main/java/io/github/lengors/maven_lombok_template/package-info.java index 2d21a0d..f135855 100644 --- a/src/main/java/io/github/lengors/maven_java_template/package-info.java +++ b/core/src/main/java/io/github/lengors/maven_lombok_template/package-info.java @@ -3,4 +3,4 @@ * * @author lengors */ -package io.github.lengors.maven_java_template; +package io.github.lengors.maven_lombok_template; diff --git a/core/src/test/java/io/github/lengors/maven_lombok_template/ExampleDataTest.java b/core/src/test/java/io/github/lengors/maven_lombok_template/ExampleDataTest.java new file mode 100644 index 0000000..a954d70 --- /dev/null +++ b/core/src/test/java/io/github/lengors/maven_lombok_template/ExampleDataTest.java @@ -0,0 +1,13 @@ +package io.github.lengors.maven_lombok_template; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +class ExampleDataTest { + @Test + void shouldCorrectlyInitializeExampleData() { + final var value = "Hello, World!"; + final var data = new ExampleData(value); + Assertions.assertEquals(value, data.getExample()); + } +} diff --git a/core/src/test/java/io/github/lengors/maven_lombok_template/ExampleTest.java b/core/src/test/java/io/github/lengors/maven_lombok_template/ExampleTest.java new file mode 100644 index 0000000..e604558 --- /dev/null +++ b/core/src/test/java/io/github/lengors/maven_lombok_template/ExampleTest.java @@ -0,0 +1,24 @@ +package io.github.lengors.maven_lombok_template; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.platform.commons.util.ReflectionUtils; + +class ExampleTest { + @Test + void shouldThrowUnsupportedOperationExceptionWhenInstantiateExample() { + Assertions.assertThrows(UnsupportedOperationException.class, () -> { + ReflectionUtils.newInstance(Example.class); + }); + } + + @Test + void shouldGetHelloWorldFromExampleFunction() { + Assertions.assertEquals("Hello, World!", Example.example()); + } + + @Test + void shouldExecuteMainFunctionWithoutErrors() { + Example.main(new String[] {}); + } +} diff --git a/src/test/java/io/github/lengors/maven_java_template/package-info.java b/core/src/test/java/io/github/lengors/maven_lombok_template/package-info.java similarity index 59% rename from src/test/java/io/github/lengors/maven_java_template/package-info.java rename to core/src/test/java/io/github/lengors/maven_lombok_template/package-info.java index 2d21a0d..f135855 100644 --- a/src/test/java/io/github/lengors/maven_java_template/package-info.java +++ b/core/src/test/java/io/github/lengors/maven_lombok_template/package-info.java @@ -3,4 +3,4 @@ * * @author lengors */ -package io.github.lengors.maven_java_template; +package io.github.lengors.maven_lombok_template; diff --git a/javadoc/pom.xml b/javadoc/pom.xml new file mode 100644 index 0000000..7bfad4d --- /dev/null +++ b/javadoc/pom.xml @@ -0,0 +1,143 @@ + + + 4.0.0 + + io.github.lengors + maven-lombok-template-parent + ${revision} + + + io.github.lengors + maven-lombok-template-javadoc + ${revision} + + + + true + true + + + 1.18.20.0 + 3.8.0 + + + ${project.basedir}/../core + + + + + org.checkerframework + checker-qual + + + + org.projectlombok + lombok + provided + + + + org.junit.jupiter + junit-jupiter + test + + + + org.mockito + mockito-core + + + org.mockito + mockito-junit-jupiter + test + + + + + ${project.build.directory}/generated-sources/delombok + ${project.build.directory}/generated-test-sources/delombok + + + + org.projectlombok + lombok-maven-plugin + ${maven.delombok.version} + + + org.projectlombok + lombok + ${maven.lombok.version} + + + + + delombok + generate-sources + + delombok + + + false + ${project.core.directory}/src/main/java + + + + test-delombok + generate-test-sources + + testDelombok + + + false + ${project.core.directory}/src/test/java + + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven.jar.version} + + + default-jar + none + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven.javadoc.version} + + true + + + org.checkerframework + checker-qual + https://checkerframework.org/api + + + maven-lombok-template ${project.version} API + maven-lombok-template ${project.version} API + + + + attach-javadocs + + jar + + + maven-lombok-template-${revision} + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3321267..ed6e75f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,31 +6,19 @@ 4.0.0 io.github.lengors - maven-lombok-template - 0.0.0-local.0 - maven-lombok-template - https://github.com/lengors/maven-lombok-template - Template repository for maven projects written in java and that require the usage of lombok. + maven-lombok-template-parent + ${revision} + pom - - - lengors - 24527258+lengors@users.noreply.github.com - - - - - https://github.com/lengors/maven-lombok-template - - - - - The Unlicense - https://unlicense.org/UNLICENSE - - + + javadoc + core + + + 1.0.0-alpha.1 + UTF-8 @@ -38,24 +26,23 @@ 21 21 + + true + true + true + - 0.5.0 3.46.0 - 3.4.0 - 3.13.0 - 3.7.1 5.12.0 - 3.8.0 - 0.8.12 - 3.3.1 + 1.6.0 + 1.18.34 5.10.3 - 3.2.4 3.4.2 lengors-github https://sonarcloud.io - + core @@ -67,308 +54,51 @@ pom import - - - - - - org.checkerframework - checker-qual - ${maven.checkerframework.version} - + + org.checkerframework + checker-qual + ${maven.checkerframework.version} + - - org.junit.jupiter - junit-jupiter - test - + + org.projectlombok + lombok + ${maven.lombok.version} + - - org.mockito - mockito-core - ${maven.mockito.version} - - - org.mockito - mockito-junit-jupiter - ${maven.mockito.version} - test - - + + org.mockito + mockito-core + ${maven.mockito.version} + + + org.mockito + mockito-junit-jupiter + ${maven.mockito.version} + + + - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${maven.checkstyle.version} + org.codehaus.mojo + flatten-maven-plugin + ${maven.flatten.version} - true - checkstyle.xml + ossrh - - - - org.apache.maven.plugins - maven-source-plugin - ${maven.source.version} - attach-sources - verify + flatten + process-resources - jar-no-fork + flatten - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven.javadoc.version} - - true - - - org.checkerframework - checker-qual - https://checkerframework.org/api - - - - - - attach-javadocs - - jar - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${maven.gpg.version} - - ${MAVEN_GPG_KEYNAME} - - - - sign-artifacts - verify - - sign - - - - - - - org.sonatype.central - central-publishing-maven-plugin - ${maven.central-publishing.version} - true - - central - true - published - - - - - org.jacoco - jacoco-maven-plugin - ${maven.jacoco.version} - - - prepare-agent - - prepare-agent - - - - report - - report - - - - XML - - - - - - - - - - - checkerframework - - - [1.8,) - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.version} - - true - - - org.checkerframework - checker - ${maven.checkerframework.version} - - - - - org.checkerframework.checker.nullness.NullnessChecker - org.checkerframework.checker.resourceleak.ResourceLeakChecker - - - -Xmaxerrs - 10000 - -Xmaxwarns - 10000 - - - - - - - - - checkerframework-jdk8 - - 1.8 - - - - 9+181-r4173-1 - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - copy - - process-sources - - com.google.errorprone:javac:${javac.version}:jar - ${project.build.directory}/javac - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - -J-Xbootclasspath/p:${project.build.directory}/javac/javac-${javac.version}.jar - - - - - - - - - checkerframework-jdk9orlater - - [9,) - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED - - - - - - - - - jar - - - - org.apache.maven.plugins - maven-jar-plugin - ${maven.jar.version} - - - - true - io.github.lengors.maven_java_template.Example - - - - - - - - - - assemble - - - - org.apache.maven.plugins - maven-assembly-plugin - ${maven.assembly.version} - - - - io.github.lengors.maven_java_template.Example - - - - jar-with-dependencies - - - - - package - - single - - - - - - - - - \ No newline at end of file + diff --git a/src/test/java/io/github/lengors/maven_java_template/ExampleTest.java b/src/test/java/io/github/lengors/maven_java_template/ExampleTest.java deleted file mode 100644 index 1de9134..0000000 --- a/src/test/java/io/github/lengors/maven_java_template/ExampleTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.github.lengors.maven_java_template; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.platform.commons.util.ReflectionUtils; - -/** - * Example test suite for {@link Example}. - * - * @author lengors - */ -public class ExampleTest { - /** - * Exampel test for {@link Example#Example()}. - */ - @Test - public void shouldThrowUnsupportedOperationExceptionWhenInstantiateExample() { - Assertions.assertThrows(UnsupportedOperationException.class, () -> { - ReflectionUtils.newInstance(Example.class); - }); - } - - /** - * Exampel test for {@link Example#example()}. - */ - @Test - public void shouldGetHelloWorldFromExampleFunction() { - Assertions.assertEquals("Hello, World!", Example.example()); - } - - /** - * Exampel test for {@link Example#main(String[])}. - */ - @Test - public void shouldExecuteMainFunctionWithoutErrors() { - Example.main(new String[] {}); - } -}