diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index a960e44..c6f89b7 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -8,7 +8,7 @@ body: Thank you for taking the time to fill out this bug report! Please carefully read the contribution docs before creating a bug report - πŸ‘‰ https://github.com/thriving-dev/java-library-template/blob/main/CONTRIBUTING.md + πŸ‘‰ https://github.com/thriving-dev/micronaut-gradle-renovate-example/blob/main/CONTRIBUTING.md - type: textarea id: bug-description attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 6842356..f6fa1cc 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true contact_links: - name: πŸ’¬ Discussions - url: https://github.com/thriving-dev/java-library-template/discussions + url: https://github.com/thriving-dev/micronaut-gradle-renovate-example/discussions about: Use discussions if you have another issue, an idea for improvement or for asking questions. diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index c786924..683843b 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -8,7 +8,7 @@ body: Thank you for taking the time to fill out this feature request! Please carefully read the contribution docs before suggesting a new feature - πŸ‘‰ https://github.com/thriving-dev/java-library-template/blob/main/CONTRIBUTING.md + πŸ‘‰ https://github.com/thriving-dev/micronaut-gradle-renovate-example/blob/main/CONTRIBUTING.md - type: textarea id: feature-description attributes: @@ -30,7 +30,7 @@ body: label: Final checks description: Before submitting, please make sure you do the following options: - - label: Read the [contribution guide](https://github.com/thriving-dev/java-library-template/blob/main/CONTRIBUTING.md). + - label: Read the [contribution guide](https://github.com/thriving-dev/micronaut-gradle-renovate-example/blob/main/CONTRIBUTING.md). required: true - - label: Check existing [discussions](https://github.com/thriving-dev/java-library-template/discussions) and [issues](https://github.com/thriving-dev/java-library-template/issues). + - label: Check existing [discussions](https://github.com/thriving-dev/micronaut-gradle-renovate-example/discussions) and [issues](https://github.com/thriving-dev/micronaut-gradle-renovate-example/issues). required: true diff --git a/.github/template/README.md b/.github/template/README.md deleted file mode 100644 index 0bf94a3..0000000 --- a/.github/template/README.md +++ /dev/null @@ -1,181 +0,0 @@ -# %REPO_NAME% - -[![Use this template](https://img.shields.io/badge/from-java--library--template-brightgreen?logo=dropbox)](https://github.com/thriving-dev/java-library-template/generate) -[![Java CI](https://github.com/%REPO_OWNER%/%REPO_NAME%/actions/workflows/1.pipeline.yml/badge.svg)](https://github.com/%REPO_OWNER%/%REPO_NAME%/actions/workflows/1.pipeline.yml) -[![Maven Central](https://img.shields.io/maven-central/v/%ARTIFACT_GROUP%/%ARTIFACT_NAME%.svg)](https://central.sonatype.com/artifact/%ARTIFACT_GROUP%/%ARTIFACT_NAME%) -[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) -[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://%REPO_OWNER%.github.io/%REPO_NAME%/javadoc/) - -Automated migration completed, enjoy the template. - -## Features -- πŸ₯· One-click **automated initial project migration workflow** (GitHub Action) -- **Java 21** (corretto) 🀝 **Gradle Kotlin DSL**, version catalog -- **GitHub Actions CI/CD pipeline**, πŸ‘· efficient build pipeline, caching, integration tests, test report & failed test annotations -- πŸš€ **One-click release** process + **publish** to **Maven Central** -- **Security & 🚦 Vulnerability scan** with **[trivy](https://github.com/aquasecurity/trivy)** & GitHub CodeQL Analysis -- **Automated dependency updates** with **[Renovate](https://github.com/renovatebot/renovate)** πŸ€– -- **Javadoc** deployed with **GitHub Pages** -- Open Source **Community ready** (Code of Conduct, Contribution guidelines, Issue & PR Templates) - -## Quick Start -1. [Use this template](https://github.com/thriving-dev/java-library-template/generate) to create your own repository -2. Create & provide a PAT (Personal Access Token) for the CI/CD pipeline - - Three workflows commit and push changes to the repository and therefore require additional permissions. ('migrate-repo-template', 'publish-javadoc', 'gradle-release') - - The jobs expect a secret by the name `CI_GITHUB_TOKEN` that holds a PAT with _write_ permission for _Content_. - - To create a new access token, the following steps are required (ref [GitHub documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token)): - 1. If the new repo owner is an organisation, **enrol** the organisation for '**Fine-grained personal access tokens**'. In the organisation ['Settings > Third-party Access > Personal access tokens'](https://github.com/organizations/%REPO_OWNER%/settings/personal-access-tokens). - 2. Head to the [Developer settings](https://github.com/settings/tokens?type=beta) and **enrol** your personal account for the new '**Fine-grained personal access tokens**'. (That's a one-off for your account and you might already have done this before) - 3. Next, click on the button '**Generate new token**' and create a token for the target _**Resource owner**_, with access to your project and the following '**Repository Permissions**' - * **Contents:** **Read** and **Write** access to code - * **Metadata:** **Read** access to metadata - - image - - 4. Provide your new PAT either as an Organisation secret or a Repository secret with the name `CI_GITHUB_TOKEN`. - - - -3. Trigger the '**!! INITIAL: Migrate Repo Template !!**' workflow - - ℹ️ This workflow automatically 'migrates' all files in your new repository, updating the **gradle project group**, **module name**, **package names**, and **all references** to the repo `/`. - - - Head over to **Actions** (1) - - on the left-hand side select the topmost workflow '**!! INITIAL: Migrate Repo Template !!**' (2) - - click the **Run workflow** button (3) - - **fill out** the form & **start** the pipeline (4)(5) - - ![image](https://github.com/thriving-dev/java-library-template/assets/10864443/41a380d5-e521-4050-9296-9f5bee4088e6) - -4. Final one-off tasks - * Choose & update the LICENSE, [here](LICENSE) - * Update _Maven Publication_ details [here](%ARTIFACT_NAME%/build.gradle.kts#L6-L13) - * [Configure GitHub Pages](#prerequisites-configure-github-pages) to deploy branch 'gh-pages' (Javadoc) - * Add secrets required for [publishing to Maven Central](#prerequisites-sonatype-credentials--gpg-signing-key) - * Install & configure renovate app ([instructions](#prerequisites-enable--configure-renovate)) - -## Project Structure -The project template consists of three top-level _folders_: -* `.github/`: Defines the GitHub Actions CI tasks and templates for new pull requests, issues, etc. -* `gradle/`: Contains Gradle Configuration files such as the Gradle [Version Catalog](https://docs.gradle.org/current/userguide/platforms.html) and the Gradle Wrapper. -* `%ARTIFACT_NAME%/`: The library source code (Gradle sub-project). - -In addition, following _files_ are worth highlighting: -* `gradle/libs.versions.toml`: A [conventional file](https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml) to declare a version catalog. -* `settings.gradle.kts`: The multi-project Gradle settings file. Here are all the sub-projects defined. -* `gradle.properties`: Holds the library version, needed & maintained by the CI/CD pipeline [release process](#release-process). -* `**/build.gradle.kts`: Gradle build file - -## CI/CD Pipeline -The heart of this template is the ['Main GitHub Actions CI/CD Pipeline'](https://github.com/%REPO_OWNER%/%REPO_NAME%/actions/workflows/1.pipeline.yml). - -![image](https://github.com/thriving-dev/java-library-template/assets/10864443/8e5436c3-f807-4617-9e77-6d21e9dfb7c2) - -The workflow encompasses multiple jobs, modelled and linked with dependencies and conditions. -Based on the context (trigger, ref, input arguments) it meets different use cases: -1. **Check**. Build, test, integration test; code quality & vulnerability scans. - Runs for active PRs - as well as part of all subsequent listed use cases. -2. **Latest**. 'Check', publish SNAPSHOT version to Maven Central and Javadoc (GitHub Pages). - Runs on pushes to the main branch. -3. **Release Process**. 'Check', executes (major|minor|patch) release process via the Gradle plugin. - Manually triggered workflow via GitHub UI/API. -3. **Library Release**. 'Check', publish RELEASE version to Maven Central and Javadoc (GitHub Pages). - Runs for pushed tags. - -## Publish to Maven Central -### Automated Process -The Maven publish process is fully automated and does not require manual action. -- The _main_ branch (per process definition) always is set to the next [SNAPSHOT version](gradle.properties) and is published to the Sonatype snapshot repository with each main CI/CD pipeline run. The pipeline runs e.g. when a PR is merged, but can also be triggered manually. -- Release deployment happens when a new tag is pushed to GitHub. (Part of the [release process](#release-process)) - -### Prerequisites: Sonatype Credentials & GPG Signing Key -The initial setup for your OSSRH repository requires some manual steps and human review (see why), after which your deployment process is typically modified to get components into OSSRH. These are all one time steps. -I recommend to follow the [official guide](https://central.sonatype.org/publish/publish-guide/). - -In order to deploy your components to OSSRH with Gradle, you have to meet the [requirements](https://central.sonatype.org/publish/requirements/) for your metadata in the pom.xml as well as supply the required, signed components. - -> ℹ️ The publish process uses [io.github.gradle-nexus.publish-plugin](https://plugins.gradle.org/plugin/io.github.gradle-nexus.publish-plugin) under the hood. - -The gradle project as well as the CI/CD pipeline is already fully prepared for the publishing process. -The GH actions job [callable.publish-sonatype.yml](.github/workflows/callable.publish-sonatype.yml) requires the following Secrets: - -| Secret name | Value | -|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `OSSRH_USERNAME` | The username of your OSSRH account. | -| `OSSRH_PASSWORD` | The password of your OSSRH account. | -| `GPG_SIGNING_KEY` | The GPG private key to sign your artifacts (in ascii-armored format). You can obtain it with `gpg --armor --export-secret-keys ` or you can create one key online on [pgpkeygen.com](https://pgpkeygen.com). | -| `GPG_SIGNING_PASSPHRASE` | The passphrase for unlocking the secret key. (you picked it when creating the key). | - -Please define the secrets via your repository settings. ([Settings > Security > Secrets and variables > Actions](https://github.com/%REPO_OWNER%/%REPO_NAME%/settings/secrets/actions)) -Preview of Javadoc published to GitHub Pages by the CI/CD pipeline - -## Release Process -### Creating a Release -To release a new version via the CI/CD Pipeline, please follow the instructions below. -- Navigate to Actions (1) -- \> Main Pipeline (2) -- Click 'Run workflow' button (3) -- Select a semver release type with the 'Release Library' dropdown (4) -- 'Run the workflow' (5) - ![image](https://github.com/thriving-dev/java-library-template/assets/10864443/8008fefd-efc3-466d-806f-5cc33eb74b7f) - -The release process includes -- Pipeline run (incl. build & tests) that executes the release plugin (6) -- The release plugin first sets & commits the new version (7a) -- Creates & pushes a new tag (7b) -- Sets the main branch to the next SNAPSHOT version (7c) - ![image](https://github.com/thriving-dev/java-library-template/assets/10864443/dd7694c7-36f2-497e-b768-f9a76516bacb) - -The new version is automatically published to Maven Central! πŸš€ -![image](https://github.com/thriving-dev/java-library-template/assets/10864443/89db0a69-c4ea-4f45-a655-8349d448a4c6) - -### Prerequisites: PAT provided as `CI_GITHUB_TOKEN` -The CI/CD 'gradle-release' job expects a secret by the name `CI_GITHUB_TOKEN` that holds a PAT (Personal Access Token) with permission to push tags as part of the release process. - -If you have been following the Quick Start guide you should already have this configured. Please refer to ['Quick Start' step 2](#quick-start). - -## Javadoc -### Use -A Javadoc website of your library, generated by gradle, is 'published' to GitHub Pages by the CI/CD pipeline. In addition to each released version, the current snapshot version (_main_ branch) is published as `current`. --> visit the [live preview](https://thriving-dev.github.io/java-library-template/javadoc/). - -Preview of Javadoc published to GitHub Pages by the CI/CD pipeline - -### Prerequisites: Configure GitHub Pages -To host the generated Javadoc, configure GitHub Pages for your repository to deploy from branch `gh-pages`. You can also find all deployments under ['pages-build-deployment'](https://github.com/%REPO_OWNER%/%REPO_NAME%/actions/workflows/pages/pages-build-deployment). - -> ℹ️ The branch is created with the first CI/CD pipeline run. ('Publish javadoc' job) - -![image](https://github.com/thriving-dev/java-library-template/assets/10864443/208d68b8-f955-4089-b41a-48a2ef263186) - -## Security & CodeQL Analysis -### Common Vulnerabilities and Exposures (CVE) -The libraries gradle dependencies are scanned for known [CVE](https://www.cve.org/) with **[aquasecurity/trivy](https://github.com/aquasecurity/trivy)**. The scan results can be reviewed and managed under [Security > Vulnerability alerts > Code scanning](https://github.com/%REPO_OWNER%/%REPO_NAME%/security/code-scanning). - -Scans are triggered -1. with each main CI/CD pipeline run -2. Scheduled (weekly) ([ref](.github/workflows/2.scheduled.code-analysis.yml)) - -Preview of a critical CVE listed in the GitHub Security 'Code scanning' overview page - -Please refer to [official GitHub documentation](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning) for more details. - -## Automated Dependency Updates with Renovate -### Dependency Dashboard - - - -### PRs created by renovate bot - - -### Prerequisites: Enable & Configure Renovate -This template ships with a prepared [renovate.json](renovate.json). - -The recommended way to enable renovate is to use the [Renovate GitHub App](https://github.com/apps/renovate). - - -## Credits -- Created by https://github.com/thriving-dev/java-library-template diff --git a/.github/workflows/0.initial.migrate-repo-template.yml b/.github/workflows/0.initial.migrate-repo-template.yml deleted file mode 100644 index 2cd3c6a..0000000 --- a/.github/workflows/0.initial.migrate-repo-template.yml +++ /dev/null @@ -1,153 +0,0 @@ -name: "!! INITIAL: Migrate Repo Template !!" - -on: - workflow_dispatch: - inputs: - group: - description: 'Artifact groupId' - required: true - default: 'org.acme' - type: string - name: - description: 'Artifact artifactId (recommended to align with repo name)' - required: true - default: 'fancy-library-name' - type: string - package: - description: 'Artifact package' - required: true - default: 'org.acme.fancy.lib' - type: string - email: - description: 'Contact email (CODE_OF_CONDUCT.md)' - required: true - default: 'info@yourdomain.com' - type: string - -jobs: - migrate_repo_template: - name: Run Migration - runs-on: ubuntu-latest - if: github.repository != 'thriving-dev/java-library-template' - steps: - - - name: Validate input param 'group' - env: - INPUT_PARAM: ${{ inputs.group }} - run: | - if [[ ! $INPUT_PARAM =~ ^[a-z0-9]([._-]?[a-z0-9]+)*$ ]]; then - echo "Invalid value for 'group' param: $INPUT_PARAM" - echo "Must be all lowercase, no whitespaces, no special characters but '-', '_' and dots, no consecutive dots." - exit 1 - fi - - name: Validate input param 'name' - env: - INPUT_PARAM: ${{ inputs.name }} - run: | - if [[ ! $INPUT_PARAM =~ ^[a-z0-9]([_-]?[a-z0-9]+)*$ ]]; then - echo "Invalid value for 'name': $INPUT_PARAM" - echo "Must be all lowercase, no whitespaces, no special characters but '-', no leading or consecutive dashes." - exit 1 - fi - - name: Validate input param 'package' - env: - INPUT_PARAM: ${{ inputs.package }} - run: | - if [[ ! $INPUT_PARAM =~ ^[a-z_]([._]?[a-z_][a-z0-9_]*)*$ ]]; then - echo "Invalid value for 'package': $INPUT_PARAM" - echo "Must conform to all lowercase, no whitespaces, no special characters but '_', separated by dots, no consecutive dots, no element beginning with a number." - exit 1 - fi - - - name: Checkout project sources - uses: actions/checkout@v4 - with: - ref: main - token: ${{ secrets.CI_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - - - name: Migrate - env: - GITHUB_REPOSITORY_OLD: "thriving-dev/java-library-template" - GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }} - ARTIFACT_GROUP_OLD: "dev.thriving.oss" - ARTIFACT_GROUP_NEW: ${{ inputs.group }} - ARTIFACT_NAME_OLD: "java-library-template" - ARTIFACT_NAME_NEW: ${{ inputs.name }} - PACKAGE_OLD: "dev.thriving.oss.java.library.template" - PACKAGE_NEW: ${{ inputs.package }} - INPUT_EMAIL: ${{ inputs.email }} - run: | - # gradle files - ## gradle.properties - initial version - echo "version=0.0.1-SNAPSHOT" > gradle.properties - - ## build.gradle.kts - sed -i "s/group = \"$ARTIFACT_GROUP_OLD\"/group = \"$ARTIFACT_GROUP_NEW\"/g" build.gradle.kts - - ## settings.gradle.kts - sed -i "s/$ARTIFACT_NAME_OLD/$ARTIFACT_NAME_NEW/g" settings.gradle.kts - - ## java-library-template/build.gradle.kts - sed -i "s@group = \"$ARTIFACT_GROUP_OLD\"@group = \"$ARTIFACT_GROUP_NEW\"@g" java-library-template/build.gradle.kts - sed -i "s@githubRepo = \"$GITHUB_REPOSITORY_OLD\"@githubRepo = \"$GITHUB_REPOSITORY\"@g" java-library-template/build.gradle.kts - sed -i "s@developerId = \"hartmut-co-uk\"@developerId = \"$GITHUB_ACTOR\"@g" java-library-template/build.gradle.kts - sed -i "s@developerName = \"Hartmut Armbruster\"@developerName = \"Your Name\"@g" java-library-template/build.gradle.kts - sed -i "s@developerOrganization = \"thriving.dev\"@developerOrganization = \"ACME Corporation\"@g" java-library-template/build.gradle.kts - sed -i "s@developerOrganizationUrl = \"https://thriving.dev\"@developerOrganizationUrl = \"https://yourdomain.com\"@g" java-library-template/build.gradle.kts - - # gradle module 'java-library-template' - ## rename base folder - mv $ARTIFACT_NAME_OLD $ARTIFACT_NAME_NEW - - ## move files for all srcset to new package name path structure - PACKAGE_PATH_OLD=$(echo "$PACKAGE_OLD" | tr "." "/") - PACKAGE_PATH_NEW=$(echo "$PACKAGE_NEW" | tr "." "/") - for srcset in intTest main test - do - mkdir -p "$ARTIFACT_NAME_NEW/src/$srcset/java/$PACKAGE_PATH_NEW" - mv "$ARTIFACT_NAME_NEW/src/$srcset/java/$PACKAGE_PATH_OLD" "$ARTIFACT_NAME_NEW/src/$srcset/java/$PACKAGE_PATH_NEW" - done - - ## replace package name in java files - #find $ARTIFACT_NAME_NEW -type f -name "*.java" -print0 | xargs -0 sed -i '' -e "s@$PACKAGE_OLD@$PACKAGE_NEW@g" - #find $ARTIFACT_NAME_NEW -type f -name "*.java" -print0 | xargs -0 sed -i '' -e "s@$PACKAGE_OLD@$PACKAGE_NEW@g" - find $ARTIFACT_NAME_NEW -type f -name "*.java" -exec sed -i'' -e "s@$PACKAGE_OLD@$PACKAGE_NEW@g" {} + - - # README from template - mv -f .github/template/README.md README.md - rm -Rf .github/template/ - sed -i "s@%ARTIFACT_GROUP%@$ARTIFACT_GROUP_NEW@g" README.md - sed -i "s@%ARTIFACT_NAME%@$ARTIFACT_NAME_NEW@g" README.md - sed -i "s@%REPO_OWNER%@$GITHUB_REPOSITORY_OWNER@g" README.md - sed -i "s@%REPO_NAME%@$GITHUB_REPOSITORY_NAME@g" README.md - - # CHANGELOG - sed -i "s@$GITHUB_REPOSITORY_OLD@$GITHUB_REPOSITORY@g" CHANGELOG.md - - # CONTRIBUTING - sed -i "s@$GITHUB_REPOSITORY_OLD@$GITHUB_REPOSITORY@g" CONTRIBUTING.md - sed -i "s@$ARTIFACT_NAME_OLD@$GITHUB_REPOSITORY_NAME@g" CONTRIBUTING.md - - # ISSUE_TEMPLATEs - sed -i "s@$GITHUB_REPOSITORY_OLD@$GITHUB_REPOSITORY@g" .github/ISSUE_TEMPLATE/bug-report.yml - sed -i "s@$GITHUB_REPOSITORY_OLD@$GITHUB_REPOSITORY@g" .github/ISSUE_TEMPLATE/config.yml - sed -i "s@$GITHUB_REPOSITORY_OLD@$GITHUB_REPOSITORY@g" .github/ISSUE_TEMPLATE/feature-request.yml - - # CODE_OF_CONDUCT - sed -i "s/info@thriving.dev/$INPUT_EMAIL/g" CODE_OF_CONDUCT.md - - # cleanup this very GitHub Actions workflow yml - rm .github/workflows/0.initial.migrate-repo-template.yml - - - name: Commit files - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git status - git commit -m "chore: INITIAL Migrate Repo Template" - - # Push changes - - name: Push changes - run: | - git push origin main diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d3077f..a690268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Template [x.y.z](https://github.com/thriving-dev/java-library-template/releases/tag/x.y.z) (yyyy-mm-dd) -[a.b.c...x.y.z](https://github.com/thriving-dev/java-library-template/compare/a.b.c...x.y.z) +## Template [x.y.z](https://github.com/thriving-dev/micronaut-gradle-renovate-example/releases/tag/x.y.z) (yyyy-mm-dd) +[a.b.c...x.y.z](https://github.com/thriving-dev/micronaut-gradle-renovate-example/compare/a.b.c...x.y.z) ### Added - for new features diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf700d0..5dbed81 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ -# Contributing to java-library-template +# Contributing to micronaut-gradle-renovate-example First off, thanks for taking the time to contribute! ❀️ @@ -30,11 +30,11 @@ All types of contributions are encouraged and valued. See the [Table of Contents > If you want to ask a question, we assume that you have read the available [Documentation](/README.md). -Before you ask a question, it is best to search for existing [Issues](https://github.com/thriving-dev/java-library-template/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. +Before you ask a question, it is best to search for existing [Issues](https://github.com/thriving-dev/micronaut-gradle-renovate-example/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. If you then still feel the need to ask a question and need clarification, we recommend the following: -- Open an [Issue](https://github.com/thriving-dev/java-library-template/issues/new). +- Open an [Issue](https://github.com/thriving-dev/micronaut-gradle-renovate-example/issues/new). - Provide as much context as you can about what you're running into. - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. @@ -69,7 +69,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform - Make sure that you are using the latest version. - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](/README.md). If you are looking for support, you might want to check [this section](#i-have-a-question)). -- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/thriving-dev/java-library-template/issues?q=label%3Abug). +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/thriving-dev/micronaut-gradle-renovate-example/issues?q=label%3Abug). - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. - Collect information about the bug: - Stack trace (Traceback) @@ -86,7 +86,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform We use GitHub issues to track bugs and errors. If you run into an issue with the project: -- Open an [Issue](https://github.com/thriving-dev/java-library-template/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) +- Open an [Issue](https://github.com/thriving-dev/micronaut-gradle-renovate-example/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. @@ -102,26 +102,26 @@ Once it's filed: ### Suggesting Enhancements -This section guides you through submitting an enhancement suggestion for java-library-template, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. +This section guides you through submitting an enhancement suggestion for micronaut-gradle-renovate-example, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. #### Before Submitting an Enhancement - Make sure that you are using the latest version. - Read the [documentation](/README.md) carefully and find out if the functionality is already covered, maybe by an individual configuration. -- Perform a [search](https://github.com/thriving-dev/java-library-template/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- Perform a [search](https://github.com/thriving-dev/micronaut-gradle-renovate-example/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. #### How Do I Submit a Good Enhancement Suggestion? -Enhancement suggestions are tracked as [GitHub issues](https://github.com/thriving-dev/java-library-template/issues). +Enhancement suggestions are tracked as [GitHub issues](https://github.com/thriving-dev/micronaut-gradle-renovate-example/issues). - Use a **clear and descriptive title** for the issue to identify the suggestion. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. -- **Explain why this enhancement would be useful** to most java-library-template users. You may also want to point out the other projects that solved it better and which could serve as inspiration. +- **Explain why this enhancement would be useful** to most micronaut-gradle-renovate-example users. You may also want to point out the other projects that solved it better and which could serve as inspiration. diff --git a/README.md b/README.md index 7ccad91..ceabcf4 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,12 @@ -# java-library-template 🎨 +# micronaut-gradle-renovate-example [![Use this template](https://img.shields.io/badge/from-java--library--template-brightgreen?logo=dropbox)](https://github.com/thriving-dev/java-library-template/generate) -[![Java CI](https://github.com/thriving-dev/java-library-template/actions/workflows/1.pipeline.yml/badge.svg)](https://github.com/thriving-dev/java-library-template/actions/workflows/1.pipeline.yml) -[![Maven Central](https://img.shields.io/maven-central/v/dev.thriving.oss/java-library-template.svg)](https://central.sonatype.com/artifact/dev.thriving.oss/java-library-template) +[![Java CI](https://github.com/thriving-dev/micronaut-gradle-renovate-example/actions/workflows/1.pipeline.yml/badge.svg)](https://github.com/thriving-dev/micronaut-gradle-renovate-example/actions/workflows/1.pipeline.yml) +[![Maven Central](https://img.shields.io/maven-central/v/dev.thriving.example/micronaut-gradle-renovate-example.svg)](https://central.sonatype.com/artifact/dev.thriving.example/micronaut-gradle-renovate-example) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) -[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://thriving-dev.github.io/java-library-template/javadoc/) -[![CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](http://creativecommons.org/licenses/by-nc-sa/4.0/) - -_TLDR:_ Java Library GitHub Template Repository - -[ Introducing 'java-library-template' in 60s - YouTube](https://www.youtube.com/watch?v=nXs7hSV6ris&list=PL1tfxqbktkFYK5zYjfHxt4wFOus5R9Y3g) +[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://thriving-dev.github.io/micronaut-gradle-renovate-example/javadoc/) +Automated migration completed, enjoy the template. ## Features - πŸ₯· One-click **automated initial project migration workflow** (GitHub Action) @@ -22,9 +18,7 @@ _TLDR:_ Java Library GitHub Template Repository - **Javadoc** deployed with **GitHub Pages** - Open Source **Community ready** (Code of Conduct, Contribution guidelines, Issue & PR Templates) - ## Quick Start -**Demo on YouTube**: [ java-library-template 1/7: Getting started (generate from; create PAT, one-click migrate)](https://www.youtube.com/watch?v=lDfg9D0A-nA&list=PL1tfxqbktkFYK5zYjfHxt4wFOus5R9Y3g) 1. [Use this template](https://github.com/thriving-dev/java-library-template/generate) to create your own repository 2. Create & provide a PAT (Personal Access Token) for the CI/CD pipeline @@ -33,7 +27,7 @@ _TLDR:_ Java Library GitHub Template Repository The jobs expect a secret by the name `CI_GITHUB_TOKEN` that holds a PAT with _write_ permission for _Content_. To create a new access token, the following steps are required (ref [GitHub documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token)): - 1. If the new repo owner is an organisation, **enrol** the organisation for '**Fine-grained personal access tokens**'. In the organisation '**Settings > Third-party Access > Personal access tokens**'. + 1. If the new repo owner is an organisation, **enrol** the organisation for '**Fine-grained personal access tokens**'. In the organisation ['Settings > Third-party Access > Personal access tokens'](https://github.com/organizations/thriving-dev/settings/personal-access-tokens). 2. Head to the [Developer settings](https://github.com/settings/tokens?type=beta) and **enrol** your personal account for the new '**Fine-grained personal access tokens**'. (That's a one-off for your account and you might already have done this before) 3. Next, click on the button '**Generate new token**' and create a token for the target _**Resource owner**_, with access to your project and the following '**Repository Permissions**' * **Contents:** **Read** and **Write** access to code @@ -58,7 +52,7 @@ _TLDR:_ Java Library GitHub Template Repository 4. Final one-off tasks * Choose & update the LICENSE, [here](LICENSE) - * Update _Maven Publication_ details [here](java-library-template/build.gradle.kts#L6-L13) + * Update _Maven Publication_ details [here](micronaut-gradle-renovate-example/build.gradle.kts#L6-L13) * [Configure GitHub Pages](#prerequisites-configure-github-pages) to deploy branch 'gh-pages' (Javadoc) * Add secrets required for [publishing to Maven Central](#prerequisites-sonatype-credentials--gpg-signing-key) * Install & configure renovate app ([instructions](#prerequisites-enable--configure-renovate)) @@ -67,7 +61,7 @@ _TLDR:_ Java Library GitHub Template Repository The project template consists of three top-level _folders_: * `.github/`: Defines the GitHub Actions CI tasks and templates for new pull requests, issues, etc. * `gradle/`: Contains Gradle Configuration files such as the Gradle [Version Catalog](https://docs.gradle.org/current/userguide/platforms.html) and the Gradle Wrapper. -* `java-library-template/`: The library source code (Gradle sub-project). +* `micronaut-gradle-renovate-example/`: The library source code (Gradle sub-project). In addition, following _files_ are worth highlighting: * `gradle/libs.versions.toml`: A [conventional file](https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml) to declare a version catalog. @@ -76,7 +70,7 @@ In addition, following _files_ are worth highlighting: * `**/build.gradle.kts`: Gradle build file ## CI/CD Pipeline -The heart of this template is the 'Main GitHub Actions CI/CD Pipeline'. See it in [Actions](https://github.com/thriving-dev/java-library-template/actions/workflows/1.pipeline.yml) (πŸ‘»). +The heart of this template is the ['Main GitHub Actions CI/CD Pipeline'](https://github.com/thriving-dev/micronaut-gradle-renovate-example/actions/workflows/1.pipeline.yml). ![image](https://github.com/thriving-dev/java-library-template/assets/10864443/8e5436c3-f807-4617-9e77-6d21e9dfb7c2) @@ -115,7 +109,7 @@ The GH actions job [callable.publish-sonatype.yml](.github/workflows/callable.pu | `GPG_SIGNING_KEY` | The GPG private key to sign your artifacts (in ascii-armored format). You can obtain it with `gpg --armor --export-secret-keys ` or you can create one key online on [pgpkeygen.com](https://pgpkeygen.com). | | `GPG_SIGNING_PASSPHRASE` | The passphrase for unlocking the secret key. (you picked it when creating the key). | -Please define the secrets via your repository settings. (Settings > Security > Secrets and variables > Actions) +Please define the secrets via your repository settings. ([Settings > Security > Secrets and variables > Actions](https://github.com/thriving-dev/micronaut-gradle-renovate-example/settings/secrets/actions)) Preview of Javadoc published to GitHub Pages by the CI/CD pipeline ## Release Process @@ -151,7 +145,7 @@ A Javadoc website of your library, generated by gradle, is 'published' to GitHub Preview of Javadoc published to GitHub Pages by the CI/CD pipeline ### Prerequisites: Configure GitHub Pages -To host the generated Javadoc, configure GitHub Pages for your repository to deploy from branch `gh-pages`. You can also find all deployments under ['pages-build-deployment'](https://github.com/thriving-dev/java-library-template/actions/workflows/pages/pages-build-deployment). +To host the generated Javadoc, configure GitHub Pages for your repository to deploy from branch `gh-pages`. You can also find all deployments under ['pages-build-deployment'](https://github.com/thriving-dev/micronaut-gradle-renovate-example/actions/workflows/pages/pages-build-deployment). > ℹ️ The branch is created with the first CI/CD pipeline run. ('Publish javadoc' job) @@ -159,7 +153,7 @@ To host the generated Javadoc, configure GitHub Pages for your repository to dep ## Security & CodeQL Analysis ### Common Vulnerabilities and Exposures (CVE) -The libraries gradle dependencies are scanned for known [CVE](https://www.cve.org/) with **[aquasecurity/trivy](https://github.com/aquasecurity/trivy)**. The scan results can be reviewed and managed under 'Security > Vulnerability alerts > Code scanning'. +The libraries gradle dependencies are scanned for known [CVE](https://www.cve.org/) with **[aquasecurity/trivy](https://github.com/aquasecurity/trivy)**. The scan results can be reviewed and managed under [Security > Vulnerability alerts > Code scanning](https://github.com/thriving-dev/micronaut-gradle-renovate-example/security/code-scanning). Scans are triggered 1. with each main CI/CD pipeline run @@ -170,11 +164,6 @@ Scans are triggered Please refer to [official GitHub documentation](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning) for more details. ## Automated Dependency Updates with Renovate - -ℹ️ Renovate (RenovateBot) is a software tool that automates the process of keeping software dependencies up-to-date by scanning code repositories, identifying outdated dependencies, and generating automated pull requests to update them. - -It’s Open Source and Community-Driven, supports a wide range of programming languages and package managers, and integrates with GitHub & Gitlab as well as other popular CI/CD systems. - ### Dependency Dashboard @@ -189,8 +178,4 @@ The recommended way to enable renovate is to use the [Renovate GitHub App](https ## Credits -- inspired by https://github.com/cortinico/kotlin-android-template -- PR & issue templates copied / adapted from https://github.com/nuxt/nuxt - - -

java-library-template by thriving.dev is licensed under CC BY-NC-SA 4.0

+- Created by https://github.com/thriving-dev/java-library-template diff --git a/build.gradle.kts b/build.gradle.kts index aa3f45f..c48f88d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ -group = "dev.thriving.oss" +group = "dev.thriving.example" plugins { alias(libs.plugins.publish) diff --git a/gradle.properties b/gradle.properties index c6d0f18..6b09920 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=1.1.1-SNAPSHOT +version=0.0.1-SNAPSHOT diff --git a/java-library-template/build.gradle.kts b/micronaut-gradle-renovate-example/build.gradle.kts similarity index 93% rename from java-library-template/build.gradle.kts rename to micronaut-gradle-renovate-example/build.gradle.kts index 9f96f54..e7527a5 100644 --- a/java-library-template/build.gradle.kts +++ b/micronaut-gradle-renovate-example/build.gradle.kts @@ -1,4 +1,4 @@ -group = "dev.thriving.oss" +group = "dev.thriving.example" object Meta { const val release = "https://s01.oss.sonatype.org/service/local/" @@ -6,11 +6,11 @@ object Meta { const val desc = "OSS GitHub Java Library Template Repository" const val license = "Apache-2.0" const val licenseUrl = "https://opensource.org/licenses/Apache-2.0" - const val githubRepo = "thriving-dev/java-library-template" + const val githubRepo = "thriving-dev/micronaut-gradle-renovate-example" const val developerId = "hartmut-co-uk" - const val developerName = "Hartmut Armbruster" - const val developerOrganization = "thriving.dev" - const val developerOrganizationUrl = "https://thriving.dev" + const val developerName = "Your Name" + const val developerOrganization = "ACME Corporation" + const val developerOrganizationUrl = "https://yourdomain.com" } java { diff --git a/java-library-template/src/intTest/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateIntegrationTest.java b/micronaut-gradle-renovate-example/src/intTest/java/dev/thriving/example/app/template/JavaLibraryTemplateIntegrationTest.java similarity index 91% rename from java-library-template/src/intTest/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateIntegrationTest.java rename to micronaut-gradle-renovate-example/src/intTest/java/dev/thriving/example/app/template/JavaLibraryTemplateIntegrationTest.java index 8a28f20..5c32e17 100644 --- a/java-library-template/src/intTest/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateIntegrationTest.java +++ b/micronaut-gradle-renovate-example/src/intTest/java/dev/thriving/example/app/template/JavaLibraryTemplateIntegrationTest.java @@ -1,4 +1,4 @@ -package dev.thriving.oss.java.library.template; +package dev.thriving.example.app; import org.junit.jupiter.api.Test; diff --git a/java-library-template/src/main/java/dev/thriving/oss/java/library/template/JavaLibraryTemplate.java b/micronaut-gradle-renovate-example/src/main/java/dev/thriving/example/app/template/JavaLibraryTemplate.java similarity index 92% rename from java-library-template/src/main/java/dev/thriving/oss/java/library/template/JavaLibraryTemplate.java rename to micronaut-gradle-renovate-example/src/main/java/dev/thriving/example/app/template/JavaLibraryTemplate.java index 23ef197..10e1230 100644 --- a/java-library-template/src/main/java/dev/thriving/oss/java/library/template/JavaLibraryTemplate.java +++ b/micronaut-gradle-renovate-example/src/main/java/dev/thriving/example/app/template/JavaLibraryTemplate.java @@ -1,4 +1,4 @@ -package dev.thriving.oss.java.library.template; +package dev.thriving.example.app; /** * Javadoc for {@link JavaLibraryTemplate} diff --git a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java b/micronaut-gradle-renovate-example/src/test/java/dev/thriving/example/app/template/JavaLibraryTemplateTest.java similarity index 94% rename from java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java rename to micronaut-gradle-renovate-example/src/test/java/dev/thriving/example/app/template/JavaLibraryTemplateTest.java index dcfa6e2..88994ea 100644 --- a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java +++ b/micronaut-gradle-renovate-example/src/test/java/dev/thriving/example/app/template/JavaLibraryTemplateTest.java @@ -1,4 +1,4 @@ -package dev.thriving.oss.java.library.template; +package dev.thriving.example.app; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/settings.gradle.kts b/settings.gradle.kts index f105b4f..a4dbc63 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,3 @@ -rootProject.name = "java-library-template" +rootProject.name = "micronaut-gradle-renovate-example" -include("java-library-template") +include("micronaut-gradle-renovate-example")