diff --git a/.github/deploy-settings.xml b/.github/deploy-settings.xml index 5351c9a6ff..4fb918c520 100644 --- a/.github/deploy-settings.xml +++ b/.github/deploy-settings.xml @@ -6,6 +6,16 @@ com.sonatype.maven.plugins org.sonatype.plugins + + ${env.RELEASE_GPG_KEYNAME} + ${env.RELEASE_GPG_PASSPHRASE} + + true + never + + ossrh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a53cb5990..3626ccc01f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,11 @@ name: Build on: - push: - branches-ignore: - - 'gh-*' - - 'docs/**' +# push: +# branches-ignore: +# - 'gh-*' +# - 'docs/**' + workflow_dispatch: jobs: build: diff --git a/.github/workflows/release-rollback.yml b/.github/workflows/release-rollback.yml new file mode 100644 index 0000000000..1087de7559 --- /dev/null +++ b/.github/workflows/release-rollback.yml @@ -0,0 +1,63 @@ +name: Release + +on: + workflow_dispatch: + inputs: + release-version: + description: 'Release version to remove e.g 3.0.0. It will delete tag v3.0.0 and branch v3.0.x' + required: true + revert-to: + description: 'The commit to revert to on the branch that originated the release' + required: true + +jobs: + rollback: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: | + ~/.m2/repository + !~/.m2/repository/fr/sii/ + key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }} + - name: Prepare git + run: | + git config user.email github-actions@github.com + git config user.name github-actions + - name: "Remove tag" + continue-on-error: true + run: | + git push origin --delete v${{ github.event.inputs.release-version }} + - name: "Remove fix branch" + continue-on-error: true + run: | + RELEASE_VERSION=${{ github.event.inputs.release-version }} + FIX_BRANCH="v${RELEASE_VERSION%.*}.x" + git push origin --delete "$FIX_BRANCH" + - name: "Remove release commits" + continue-on-error: true + run: | + git pull + LATEST_COMMIT="$(git log -1 --format=%H)" + echo "LATEST_COMMIT=$LATEST_COMMIT" + echo "github.event.inputs.revert-to=${{ github.event.inputs.revert-to }}" + if [ "$LATEST_COMMIT" != "${{ github.event.inputs.revert-to }}" ]; then + ROLLBACK_BACKUP_BRANCH="rollback/backup/$LATEST-COMMIT" + git branch "$ROLLBACK_BACKUP_BRANCH" + git push origin "$ROLLBACK_BACKUP_BRANCH" + git reset --hard ${{ github.event.inputs.revert-to }} + git push --force + fi + # TODO: remove artifact from Maven repository: possible ? +# - name: "Remove artifact" +# if: always() +# run: + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83349edaea..54aee66e02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,40 @@ name: Release +# Process +# ------- +# +# 1) mvn release:prepare +# => change version for release in pom.xml files to vX.Y.0 +# => update readme +# => run unit+integration tests +# => commit +# => tag +# => change version for future developments in pom.xml files to vU.V.0-SNAPSHOT +# +# 2) Trigger a full build on tagged version and wait for result +# => build from tag +# => run unit+integration tests +# => run classpath-tests +# => generate javadoc +# +# 3) mvn release:perform to finish the release +# => deploy on Sonatype +# +# 4) Trigger a site generation on tagged version +# +# 5) Create branch for fixes +# => change versions to vX.Y.1-SNAPSHOT +# +# +# Rollback +# -------- +# +# 1) mvn release:rollback +# 2) delete tag +# 3) restore previous commit (before version changes) +# 3) mvn release:clean +# 4) remove from Sonatype if deployed + on: workflow_dispatch: inputs: @@ -11,9 +46,231 @@ on: description: 'Next dev version' required: true default: '3.1.0-SNAPSHOT' + fix-version: + description: 'Fixes version' + required: true + default: '3.0.1-SNAPSHOT' jobs: - mutation-tests: +# FIXME: maven-release-plugin can't be used due to issue: https://issues.apache.org/jira/browse/MRELEASE-920 +# release: +# runs-on: ubuntu-18.04 +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-java@v1 +# with: +# java-version: 8 +# - name: Cache Maven packages +# uses: actions/cache@v2 +# with: +# path: | +# ~/.m2/repository +# !~/.m2/repository/fr/sii/ +# key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} +# restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }} +# - name: "Release" +# run: +# ./mvnw release:prepare +# -DreleaseVersion=${{ github.event.inputs.release-version }} +# -DdevelopmentVersion=${{ github.event.inputs.next-dev-version }} +# -B + release: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: | + ~/.m2/repository + !~/.m2/repository/fr/sii/ + key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }} + - name: Prepare git + run: | + git config user.email github-actions@github.com + git config user.name github-actions + - name: "Set release version (${{ github.event.inputs.release-version }})" + run: | + ./mvnw versions:set -DnewVersion=${{ github.event.inputs.release-version }} -DprocessAllModules + ./mvnw com.google.code.maven-replacer-plugin:replacer:replace -N + ./mvnw versions:commit + - name: "Generate README.adoc" + run: + ./mvnw initialize '-Dreadme.skip=false' + - name: "Build to ensure that it works fine" + run: + ./mvnw clean install '-Dmaven.test.redirectTestOutputToFile=true' + - name: "Commit release version" + run: | + git add . + git commit -m "release(${{ github.event.inputs.release-version }}) Prepare for release" + git push + + test-release: + needs: [release] + runs-on: ubuntu-18.04 + steps: + - uses: aurelien-baudet/workflow-dispatch@master + with: + token: ${{ secrets.TRIGGER_WORKFLOW_TOKEN }} + workflow: build.yml + wait-for-completion-interval: 10m + wait-for-completion-timeout: 4h +# ref: v${{ github.event.inputs.release-version }} + + deploy-release: + needs: [test-release] + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: | + ~/.m2/repository + !~/.m2/repository/fr/sii/ + key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }} + - name: Prepare git + run: | + git config user.email github-actions@github.com + git config user.name github-actions + - run: git pull + - name: "Tag release version" + run: | + git tag -a "v${{ github.event.inputs.release-version }}" -m "release(${{ github.event.inputs.release-version }}) Release" + git push origin "v${{ github.event.inputs.release-version }}" + - name: "Import GPG key" + uses: crazy-max/ghaction-import-gpg@v3 + with: + gpg-private-key: ${{ secrets.RELEASE_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.RELEASE_GPG_PASSPHRASE }} +# - name: "Deploy release" +# run: +# ./mvnw -Prelease deploy +# --settings .github/deploy-settings.xml +# '-DskipTests=true' +# -B + + set-next-version: + needs: [deploy-release] + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: | + ~/.m2/repository + !~/.m2/repository/fr/sii/ + key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }} + - name: Prepare git + run: | + git config user.email github-actions@github.com + git config user.name github-actions + - run: git pull + - name: "Set next development version on master (${{ github.event.inputs.next-dev-version }})" + run: | + ./mvnw versions:set -DnewVersion=${{ github.event.inputs.next-dev-version }} -DprocessAllModules + ./mvnw com.google.code.maven-replacer-plugin:replacer:replace -N + ./mvnw versions:commit + - name: "Generate README.adoc" + run: + ./mvnw initialize '-Dreadme.skip=false' + - name: "Commit next development iteration" + run: | + git add . + git commit -m "release(${{ github.event.inputs.release-version }}) Prepare for next development iteration" + git push + + update-site: + needs: [set-next-version] + runs-on: ubuntu-18.04 + steps: + - uses: aurelien-baudet/workflow-dispatch@master + with: + token: ${{ secrets.TRIGGER_WORKFLOW_TOKEN }} + workflow: update-site.yml + ref: v${{ github.event.inputs.release-version }} + + create-or-update-fix-branch: + needs: [update-site] + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: | + ~/.m2/repository + !~/.m2/repository/fr/sii/ + key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }} + - name: Prepare git + run: | + git config user.email github-actions@github.com + git config user.name github-actions + - name: "Get fix branch" + run: + RELEASE_VERSION=${{ github.event.inputs.release-version }} + FIX_BRANCH="v${RELEASE_VERSION%.*}.x" + echo "FIX_BRANCH=$FIX_BRANCH" >> $GITHUB_ENV + - name: "Set version" + run: | + echo "FIX_BRANCH=$FIX_BRANCH" + EXISTS=$(git ls-remote --heads origin ${FIX_BRANCH}) + if [ -z "$EXISTS" ]; then + git checkout "v${{ github.event.inputs.release-version }}" + git checkout -b "$FIX_BRANCH" + else + git checkout "$FIX_BRANCH" + fi + ./mvnw versions:set -DnewVersion=${{ github.event.inputs.fix-version }} -DprocessAllModules + ./mvnw com.google.code.maven-replacer-plugin:replacer:replace -N + ./mvnw versions:commit + - name: "Generate README.adoc" + run: + ./mvnw initialize '-Dreadme.skip=false' + - name: "Create fix branch or update it" + run: + git add . + git commit -m "chore(bump) Change version number for next fix version" + git push + + rollback: + needs: [release, test-release, deploy-release, set-next-version, update-site, create-or-update-fix-branch] + if: always() runs-on: ubuntu-18.04 steps: - - run: echo "foo" \ No newline at end of file + - uses: aurelien-baudet/workflow-dispatch@master + with: + token: ${{ secrets.TRIGGER_WORKFLOW_TOKEN }} + inputs: | + { + "release-version": "${{ github.event.inputs.release-version }}", + "revert-to": "${{ github.sha }}" + } + workflow: release-rollback.yml + wait-for-completion-interval: 1m + wait-for-completion-timeout: 1h + \ No newline at end of file diff --git a/README.adoc b/README.adoc index e183222f6f..b1ec9eb646 100644 --- a/README.adoc +++ b/README.adoc @@ -17,7 +17,7 @@ endif::[] :toc: preamble :toclevels: 3 -image:https://img.shields.io/maven-central/v/fr.sii.ogham/ogham-all.svg["Latest Release Standalone", link="https://mvnrepository.com/artifact/fr.sii.ogham/ogham-all/2.0.0"] +image:https://img.shields.io/maven-central/v/fr.sii.ogham/ogham-all.svg["Latest Release Standalone", link="https://mvnrepository.com/artifact/fr.sii.ogham/ogham-all/3.0.0-SNAPSHOT"] image:https://img.shields.io/badge/License-Apache%202.0-lightgrey.svg["License", link="https://opensource.org/licenses/Apache-2.0"] image:https://github.com/groupe-sii/ogham/workflows/Build/badge.svg?branch=master["Build Status", link="https://github.com/groupe-sii/ogham/actions?query=workflow%3ABuild"] @@ -33,7 +33,7 @@ image:https://sonarcloud.io/api/project_badges/measure?project=fr.sii.ogham%3Aog -- -image::http://groupe-sii.github.io/ogham/v2.0.0/presentation/showcase.png[Showcase, link=http://groupe-sii.github.io/ogham/v2.0.0/showcase-video.html] +image::http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/presentation/showcase.png[Showcase, link=http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/showcase-video.html] ''' @@ -44,10 +44,10 @@ image::http://groupe-sii.github.io/ogham/v2.0.0/presentation/showcase.png[Showca [%autowidth.stretch] |=== -| **v2.0.0** (Latest release) | **v3.0.0-SNAPSHOT** (Current development) -| http://groupe-sii.github.io/ogham/v2.0.0[site] | http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT[site] -| https://github.com/groupe-sii/ogham/tree/v2.0.0[code] | https://github.com/groupe-sii/ogham/tree/master[code] -| http://groupe-sii.github.io/ogham/v2.0.0/presentation/showcase.html[showcase] | http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/presentation/showcase.html[showcase] +| **v3.0.0-SNAPSHOT** (Latest release) | **v3.0.0-SNAPSHOT** (Current development) +| http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT[site] | http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT[site] +| https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT[code] | https://github.com/groupe-sii/ogham/tree/master[code] +| http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/presentation/showcase.html[showcase] | http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/presentation/showcase.html[showcase] |=== @@ -104,12 +104,12 @@ image:src/docs/resources/images/icons/maven-logo.png[Maven,width=118,height=30] fr.sii.ogham ogham-all - 2.0.0 + 3.0.0-SNAPSHOT ... ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/pom.xml?ts={tabsize}[View code of an example pom.xml] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/pom.xml?ts={tabsize}[View code of an example pom.xml] ''' @@ -122,7 +122,7 @@ image:src/docs/resources/images/icons/gradlephant-logo.png[Gradle,width=114,heig ---- ... dependencies { - implementation 'fr.sii.ogham:ogham-all:2.0.0' + implementation 'fr.sii.ogham:ogham-all:3.0.0-SNAPSHOT' } ---- @@ -169,7 +169,7 @@ image:src/docs/resources/images/icons/maven-logo.png[Maven,width=118,height=30] fr.sii.ogham ogham-spring-boot-starter-all - 2.0.0 + 3.0.0-SNAPSHOT ... @@ -187,7 +187,7 @@ image:src/docs/resources/images/icons/gradlephant-logo.png[Gradle,width=114,heig ... dependencies { - implementation 'fr.sii.ogham:ogham-spring-boot-starter-all:2.0.0' + implementation 'fr.sii.ogham:ogham-spring-boot-starter-all:3.0.0-SNAPSHOT' ... } ---- @@ -227,7 +227,7 @@ image:src/docs/resources/images/icons/maven-logo.png[Maven,width=118,height=30] fr.sii.ogham ogham-spring-boot-starter-all - 2.0.0 + 3.0.0-SNAPSHOT @@ -264,7 +264,7 @@ image:src/docs/resources/images/icons/gradlephant-logo.png[Gradle,width=114,heig ... dependencies { - implementation 'fr.sii.ogham:ogham-spring-boot-starter-all:2.0.0' // <1> + implementation 'fr.sii.ogham:ogham-spring-boot-starter-all:3.0.0-SNAPSHOT' // <1> implementation 'org.springframework.boot:spring-boot-starter-freemarker' // <2> implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' // <3> @@ -338,7 +338,7 @@ is easy but may import dependencies that you don't need. For example, you may only need FreeMarker but not Thymeleaf. Or you may only need to send emails through SMTP but never use SendGrid. -See how to http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#select-features-standalone[select features]. +See how to http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#select-features-standalone[select features]. == Usage @@ -347,17 +347,17 @@ See how to http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#select-feat [NOTE] ==== All samples with templates are using ThymeLeaf as template engine. For FreeMarker samples, -take a look at http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#freemarker[FreeMarker section]. +take a look at http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#freemarker[FreeMarker section]. ==== === Send Email [NOTE] ==== -The samples are available in the https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage[sample-standard-usage sub-project]. +The samples are available in the https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage[sample-standard-usage sub-project]. All samples shown bellow are using SMTP for sending email. -See http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#sendgrid[Sending email through SendGrid] +See http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#sendgrid[Sending email through SendGrid] to know how to send email using SendGrid HTTP API. ==== @@ -413,7 +413,7 @@ public class BasicSample { <3> Create a MessagingService instance <4> Send an email with a subject and a simple body. The sender address is automatically set using `ogham.email.from.default-value` property -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/BasicSample.java?ts={tabsize}[Source code of the sample]. +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/BasicSample.java?ts={tabsize}[Source code of the sample]. _____ @@ -422,7 +422,7 @@ _____ The construction of the email is done using a fluent API in order to chain calls and to have a more readable code. -Properties are directly provided in the code. You can instead http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#properties-handling[use a configuration file]. +Properties are directly provided in the code. You can instead http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#properties-handling[use a configuration file]. .Email address format @@ -486,7 +486,7 @@ public class HtmlTemplateSample { <5> Indicate the path to the HTML template file (in the classpath) <6> Use any bean object for replacing variables in template -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlTemplateSample.java?ts={tabsize}[Source code of the sample]. +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlTemplateSample.java?ts={tabsize}[Source code of the sample]. ''' @@ -510,7 +510,7 @@ image:src/docs/resources/images/icons/thymeleaf.jpg[width=30,height=30] ThymeLea <2> Use the `name` attribute value in the template <3> Use the `value` attribute value in the template -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/thymeleaf/simple.html?ts={tabsize}[Source code of the HTML template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/thymeleaf/simple.html?ts={tabsize}[Source code of the HTML template] _____ @@ -527,7 +527,7 @@ The `template` method requires two pieces of information: The path to the template is a string that may contain a *lookup* prefix. The lookup prefix is used to indicate where to search the template (from file system, from classpath or anywhere else). Here we explicitly ask to load the template from classpath (using prefix `classpath:`). If no lookup is defined, -classpath is used by default. See http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#resource-resolution[Resource resolution section] for more information. +classpath is used by default. See http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#resource-resolution[Resource resolution section] for more information. The variables are any object you are using in your application. No need to convert your object to a particular format. Directly use what you want. @@ -583,7 +583,7 @@ image:src/docs/resources/images/icons/java-logo.png[width=16,height=30] Java ---- <1> Subject is no more in Java code -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlTemplateWithSubjectSample.java?ts={tabsize}[Source code of the sample] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlTemplateWithSubjectSample.java?ts={tabsize}[Source code of the sample] ''' @@ -609,7 +609,7 @@ image:src/docs/resources/images/icons/thymeleaf.jpg[width=30,height=30] ThymeLea NOTE: The subject of the email will be `Subject of the email - Welcome foo !` -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/thymeleaf/simpleWithSubject.html?ts={tabsize}[Source code of the HTML template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/thymeleaf/simpleWithSubject.html?ts={tabsize}[Source code of the HTML template] _____ @@ -663,7 +663,7 @@ public class TextTemplateWithSubjectSample { ---- <1> Subject is no more in Java code -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/TextTemplateWithSubjectSample.java?ts={tabsize}[Source code of the sample] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/TextTemplateWithSubjectSample.java?ts={tabsize}[Source code of the sample] ''' @@ -680,7 +680,7 @@ Foo bar ${value} NOTE: The subject of the email will be `Welcome foo !` -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/freemarker/simpleWithSubject.txt.ftl?ts={tabsize}[Source code of the text template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/freemarker/simpleWithSubject.txt.ftl?ts={tabsize}[Source code of the text template] _____ @@ -759,7 +759,7 @@ image:src/docs/resources/images/icons/java-logo.png[width=16,height=30] Java `/template/withImagesAndCss/resources.txt.ftl` for the text alternative) <2> The template context -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlWithImagesAndCssTemplateSample.java?ts={tabsize}[Source code of the sample] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlWithImagesAndCssTemplateSample.java?ts={tabsize}[Source code of the sample] ''' @@ -834,7 +834,7 @@ determined <6> Same as <3> <7> The image is not inlined by Ogham. This can be useful to embed it manually. -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/withImagesAndCss/resources.html?ts={tabsize}[Source code of the HTML template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/withImagesAndCss/resources.html?ts={tabsize}[Source code of the HTML template] ''' @@ -1020,7 +1020,7 @@ The call order between `text()` and `html()` doesn't matter (unlike using `.cont The underlying `Content` is a `MultiContent`. ===== -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlAndTextSample.java?ts={tabsize}[Source code of the sample] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlAndTextSample.java?ts={tabsize}[Source code of the sample] _____ @@ -1085,7 +1085,7 @@ extension). The underlying `Content` is a `MultiTemplateContent`. ===== -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlAndTextTemplateSample.java?ts={tabsize}[Source code of the sample] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlAndTextTemplateSample.java?ts={tabsize}[Source code of the sample] ''' @@ -1098,7 +1098,7 @@ image:src/docs/resources/images/icons/thymeleaf-text.jpg[width=30,height=30] Tex [[${name}]] [[${value}]] ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/thymeleaf/simple.txt?ts={tabsize}[Source code of the text template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/thymeleaf/simple.txt?ts={tabsize}[Source code of the text template] ''' @@ -1121,7 +1121,7 @@ image:src/docs/resources/images/icons/thymeleaf-html.jpg[width=30,height=30] HTM ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/thymeleaf/simple.html?ts={tabsize}[Source code of the HTML template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/thymeleaf/simple.html?ts={tabsize}[Source code of the HTML template] _____ @@ -1194,7 +1194,7 @@ for HTML located at `/template/thymeleaf/simple.html` and one for text located a extension). The HTML template uses Thymeleaf while the text template uses FreeMarker. <2> The object used for evaluation as usual when using templates (same object used for both HTML and text) -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlAndTextMixedTemplateEnginesSample.java?ts={tabsize}[Source code of the sample] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/HtmlAndTextMixedTemplateEnginesSample.java?ts={tabsize}[Source code of the sample] ''' @@ -1207,7 +1207,7 @@ image:src/docs/resources/images/icons/freemarker-logo.png[width=60,height=24] Te ${name} ${value} ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/mixed/simple.txt.ftl?ts={tabsize}[Source code of the text template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/mixed/simple.txt.ftl?ts={tabsize}[Source code of the text template] ''' @@ -1229,7 +1229,7 @@ image:src/docs/resources/images/icons/thymeleaf.jpg[width=30,height=30] HTML tem ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/mixed/simple.html?ts={tabsize}[Source code of the HTML template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/mixed/simple.html?ts={tabsize}[Source code of the HTML template] _____ @@ -1283,7 +1283,7 @@ image:src/docs/resources/images/icons/java-logo.png[width=16,height=30] Java <1> Attach a PDF file that exists in the classpath to the email. The name of the attachment uses the name of the file <2> Use an `InputStream` and name the attachment -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/WithAttachmentSample.java?ts={tabsize}[Source code of the sample] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/email/WithAttachmentSample.java?ts={tabsize}[Source code of the sample] _____ @@ -1291,7 +1291,7 @@ _____ Attaching a file to the email is quite simple. You just need to provide the path to the file. The file is loaded from classpath but could also be loaded from file system or anywhere else -(see http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#resource-resolution[ resource resolution section]). In case you are using a file, +(see http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#resource-resolution[ resource resolution section]). In case you are using a file, the name of the attachment displayed in the email is automatically determined (`test.pdf` in the example). It is often not possible to handle files directly. In that case you will use `InputStream` or @@ -1320,21 +1320,21 @@ disposition is automatically set to `ContentDisposition.INLINE`. ==== Other email features -See user guide to read about http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#email-usage[the many other features]. +See user guide to read about http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#email-usage[the many other features]. === Send SMS [NOTE] ==== -The samples are available in the https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage[sample-standard-usage sub-project]. +The samples are available in the https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage[sample-standard-usage sub-project]. All samples shown bellow are using SMPP for sending SMS. The https://en.wikipedia.org/wiki/Short_Message_Peer-to-Peer[SMPP] protocol is the standard way to send SMS. Only a subset of SMPP properties are used in following samples. The whole list of SMPP properties is available -in http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#advanced-smpp-configuration[advanced configuration]. +in http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#advanced-smpp-configuration[advanced configuration]. -See http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#ovh[Sending SMS through OVH] to know how to send SMS using OVH HTTP API. +See http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#ovh[Sending SMS through OVH] to know how to send SMS using OVH HTTP API. ==== ==== First SMS using an existing SMPP server @@ -1389,7 +1389,7 @@ public class BasicSample { <9> Send a SMS with a simple message. The sender phone number is automatically set using `ogham.sms.from.default-value` property -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/sms/BasicSample.java?ts={tabsize}[Source code of the sample]. +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/sms/BasicSample.java?ts={tabsize}[Source code of the sample]. _____ @@ -1398,7 +1398,7 @@ _____ The construction of the SMS is done using a fluent API in order to chain calls and to have a more readable code. -Properties are directly provided in the code. You can instead http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#properties-handling[use a configuration file]. +Properties are directly provided in the code. You can instead http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#properties-handling[use a configuration file]. ==== Use a template for SMS content @@ -1453,7 +1453,7 @@ set using `ogham.sms.from.default-value` property <5> Indicate the path to the template file (in the classpath) <6> Use any bean object for replacing variables in template -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/sms/TemplateSample.java?ts={tabsize}[Source code of the sample]. +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/sms/TemplateSample.java?ts={tabsize}[Source code of the sample]. ''' @@ -1465,7 +1465,7 @@ image:src/docs/resources/images/icons/thymeleaf.jpg[width=30,height=30] ThymeLea [[${name}]] [[${value}]] ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/resources/template/thymeleaf/simple.txt?ts={tabsize}[Source code of the template] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/resources/template/thymeleaf/simple.txt?ts={tabsize}[Source code of the template] _____ @@ -1482,7 +1482,7 @@ The `template` method requires two pieces of information: The path to the template is a string with a *lookup* prefix. The lookup prefix is used to indicate where to search the template (from file system, from classpath or anywhere else). Here we explicitly ask to load the template from classpath (using prefix `classpath:`). If no lookup is defined, -classpath is used by default. See http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#resource-resolution[Resource resolution section] for more information. +classpath is used by default. See http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#resource-resolution[Resource resolution section] for more information. The variables are any object you are using in your application. No need to convert your object to a particular format. Directly use what you want. @@ -1537,7 +1537,7 @@ public class LongMessageSample { } ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/sms/LongMessageSample.java?ts={tabsize}[Source code of the sample]. +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/main/java/fr/sii/ogham/sample/standard/sms/LongMessageSample.java?ts={tabsize}[Source code of the sample]. @@ -1567,7 +1567,7 @@ By default, Ogham sends the SMS using 8-bit encoding. ==== Other SMS features -Ogham provides http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#sms-usage[many other features]. +Ogham provides http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#sms-usage[many other features]. == Testing @@ -1590,12 +1590,12 @@ image:src/docs/resources/images/icons/maven-logo.png[Maven,width=118,height=30] fr.sii.ogham ogham-test-utils - 2.0.0 + 3.0.0-SNAPSHOT test ---- -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/pom.xml?ts={tabsize}[View code of an example pom.xml] +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/pom.xml?ts={tabsize}[View code of an example pom.xml] ''' @@ -1608,7 +1608,7 @@ image:src/docs/resources/images/icons/gradlephant-logo.png[Gradle,width=114,heig [source, groovy, subs=attributes+] ---- dependencies { - testImplementation 'fr.sii.ogham:ogham-test-utils:2.0.0' + testImplementation 'fr.sii.ogham:ogham-test-utils:3.0.0-SNAPSHOT' } ---- @@ -1633,7 +1633,7 @@ This will include: [TIP] ==== You can -http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#testing-tools-eclipse-static-imports[configure Eclipse] +http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#testing-tools-eclipse-static-imports[configure Eclipse] to provide autocompletion for static imports. ==== @@ -1718,7 +1718,7 @@ public class EmailTestSample { <15> Assert that received email has no attachment -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/test/java/fr/sii/ogham/sample/test/EmailTestSample.java?ts={tabsize}[Source code of the sample]. +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/test/java/fr/sii/ogham/sample/test/EmailTestSample.java?ts={tabsize}[Source code of the sample]. _____ @@ -1790,7 +1790,7 @@ public class SmsTestSample { <9> Assert that the recipient phone number is `0601020304` -https://github.com/groupe-sii/ogham/tree/v2.0.0/sample-standard-usage/src/test/java/fr/sii/ogham/sample/test/SmsTestSample.java?ts={tabsize}[Source code of the sample]. +https://github.com/groupe-sii/ogham/tree/v3.0.0-SNAPSHOT/sample-standard-usage/src/test/java/fr/sii/ogham/sample/test/SmsTestSample.java?ts={tabsize}[Source code of the sample]. _____ @@ -1801,19 +1801,19 @@ _____ Ogham provides many other tool features: -* http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#testing-email[Email assertions and tools]. -* http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#testing-sms[SMS assertions and tools]. -* http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#random-ports[Use random ports to parallelize tests]. +* http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#testing-email[Email assertions and tools]. +* http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#testing-sms[SMS assertions and tools]. +* http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#random-ports[Use random ports to parallelize tests]. == Advanced configuration -http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#section-advanced-configuration[See advanced configuration in full documentation] +http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#section-advanced-configuration[See advanced configuration in full documentation] == Extend -http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#section-extend[See how to extend in full documentation] +http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#section-extend[See how to extend in full documentation] == Tips -http://groupe-sii.github.io/ogham/v2.0.0/user-manual.html#section-tips[See tips in full documentation] +http://groupe-sii.github.io/ogham/v3.0.0-SNAPSHOT/user-manual.html#section-tips[See tips in full documentation] diff --git a/pom.xml b/pom.xml index 127dc1d14e..0548a9b8fc 100644 --- a/pom.xml +++ b/pom.xml @@ -1250,7 +1250,7 @@ true false release,mutation-testing - deploy post-site site:stage + deploy v@{project.version} @@ -1598,7 +1598,7 @@ ossrh https://oss.sonatype.org/ - true + false