diff --git a/.github/workflows/scaffold.yml b/.github/workflows/scaffold.yml index a8a4d94..48d9b32 100644 --- a/.github/workflows/scaffold.yml +++ b/.github/workflows/scaffold.yml @@ -21,18 +21,18 @@ jobs: - name: Install cookiecutter run: | pip install cookiecutter -# - name: Test cookiecutter -# run: | -# cookiecutter . --no-input -# - name: Set up JDK 21 -# uses: actions/setup-java@v1 -# with: -# java-version: 21 -# - name: Cache Maven packages -# uses: actions/cache@v2 -# with: -# path: ~/.m2 -# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} -# restore-keys: ${{ runner.os }}-m2 -# - name: Build with Maven -# run: cd sample && mvn clean install -ntp \ No newline at end of file + - name: Test cookiecutter + run: | + cookiecutter --config-file=test-config.yml --no-input . + - name: Set up JDK 21 + uses: actions/setup-java@v1 + with: + java-version: 21 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build with Maven + run: cd sample && mvn clean install -ntp \ No newline at end of file diff --git a/cookiecutter.json b/cookiecutter.json index c53e399..a77da48 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,5 +1,7 @@ { - "app_name": "sample", + "app_name": "{{cookiecutter.app_name}}", "app_name_lower": "{{cookiecutter.app_name.lower()}}", - "app_title": "{{cookiecutter.app_name.capitalize()}}" + "app_title": "{{cookiecutter.app_name.capitalize()}}", + "group_id": "org.dfm.{{cookiecutter.app_name_lower}}", + "artifact_id": "{{cookiecutter.app_name_lower}}" } diff --git a/test-config.yml b/test-config.yml new file mode 100644 index 0000000..f03e68a --- /dev/null +++ b/test-config.yml @@ -0,0 +1,4 @@ +default_context: + app_name: "sample" + group_id: "org.example.sample" + artifact_id: "sample" \ No newline at end of file diff --git a/{{cookiecutter.app_name_lower}}/pom.xml b/{{cookiecutter.app_name_lower}}/pom.xml new file mode 100644 index 0000000..1d98e80 --- /dev/null +++ b/{{cookiecutter.app_name_lower}}/pom.xml @@ -0,0 +1,260 @@ + + + 4.0.0 + {{cookiecutter.group_id}} + {{cookiecutter.artifact_id}} + pom + 1.0-SNAPSHOT + + UTF-8 + 21 + ${java.version} + ${java.version} + 5.11.3 + 3.3.5 + 7.20.1 + 2.6.0 + 1.5.1 + 1.1.0 + 2.3 + 2.3.232 + + 3.9.0 + 3.5.2 + 3.5.0 + 4.0.2 + 0.8.12 + 3.13.0 + 3.4.4 + 5.3 + 1.0.5 + 1.17.1 + 1.2.1 + + + + + + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + org.projectlombok + lombok + provided + + + + org.junit.jupiter + junit-jupiter + test + + + org.junit.platform + junit-platform-suite + test + + + + org.mockito + mockito-core + test + + + org.mockito + mockito-junit-jupiter + test + + + + ${project.artifactId} + target + target/classes + target/test-classes + src/main/java + src/test/java + + + src/main/resources + + + + + src/test/resources + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + false + + + + org.jacoco + jacoco-maven-plugin + + + + prepare-agent + + + + report + test + + report + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven-enforcer-plugin} + + + + + false + + ${project.groupId}:* + + + + true + + + + enforce-versions + + enforce + + validate + + + + + com.cosium.code + git-code-format-maven-plugin + ${git-code-format-maven-plugin.version} + + + + install-formatter-hook + + install-hooks + + + + + validate-code-format + + validate-code-format + + + + + + + com.cosium.code + google-java-format + ${git-code-format-maven-plugin.version} + + + + + io.github.phillipuniverse + githook-maven-plugin + ${githook-maven-plugin.version} + + + + install + + + + + echo "Validating..." + exec mvn test + echo "Formatting code..." + exec mvn git-code-format:format-code + echo "Validating format..." + exec mvn git-code-format:validate-code-format + + + + + + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + com.societegenerale.commons + arch-unit-maven-plugin + ${arch-unit-maven-plugin.version} + + + test + + arch-test + + + + + + com.google.cloud.tools + jib-maven-plugin + ${jib-maven.plugin.version} + + + + +