diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..962f3db --- /dev/null +++ b/.editorconfig @@ -0,0 +1,61 @@ +# Version: 1.5.0 (Using https://semver.org/) +# Updated: 2020-03-09 +# See https://github.com/RehanSaeed/EditorConfig/releases for release notes. +# See https://github.com/RehanSaeed/EditorConfig for updates to this file. +# See http://EditorConfig.org for more information about .editorconfig files. + +########################################## +# Common Settings +########################################## + +# This file is the top-most EditorConfig file +root = true + +# All Files +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 + +########################################## +# File Extension Settings +########################################## + +# XML Configuration Files +[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}] +indent_size = 2 + +# JSON Files +[*.{json,json5,webmanifest}] +indent_size = 2 + +# YAML Files +[*.{yml,yaml}] +indent_size = 2 + +# Markdown Files +[*.md] +max_line_length = off +trim_trailing_whitespace = false + +# Web Files +[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue}] +indent_size = 2 + +# Batch Files +[*.{cmd,bat}] +end_of_line = crlf + +# Bash Files +[*.sh] +end_of_line = lf + +# Java Files +[*.java] +indent_size = 4 +max_line_length = 120 +continuation_indent_size = 8 diff --git a/.github/workflows/maven-java-feature.yml b/.github/workflows/maven-java-feature.yml new file mode 100644 index 0000000..223048e --- /dev/null +++ b/.github/workflows/maven-java-feature.yml @@ -0,0 +1,69 @@ +name: Maven CI for Java for Feature/Bugfix Branch + +on: + push: + branches-ignore: + - 'develop' + - 'release/*' + - 'master' + - 'hotfix/*' + - 'support/*' + +jobs: + maven-build-test-verify: + name: Maven test, package and deploy Java project + runs-on: ubuntu-latest + steps: + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Maven version + run: mvn -version + env: + SERVER_USERNAME: $GITHUB_ACTOR + SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} + - name: Check out from version control + uses: actions/checkout@v2 + - name: Cache Maven dependencies + uses: actions/cache@v1 + env: + cache-name: cache-maven-dependencies + with: + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2-${{ env.cache-name }}- + ${{ runner.os }}-m2- + ${{ runner.os }}- + - name: Get Maven Project information + id: maven-project-info + run: | + echo "$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "$(mvn help:evaluate -Dexpression=project.packaging -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + env: + SERVER_USERNAME: $GITHUB_ACTOR + SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} + - name: Build with Maven + run: mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml + env: + SERVER_USERNAME: $GITHUB_ACTOR + SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} + - name: Unit Test with Maven + run: mvn -U -Dmaven.main.skip test --file pom.xml --settings .github/workflows/settings.xml + env: + SERVER_USERNAME: $GITHUB_ACTOR + SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} + - name: Verify with Maven + run: mvn -U -Dmaven.main.skip -Dunit.test.skip verify --file pom.xml --settings .github/workflows/settings.xml + env: + SERVER_USERNAME: $GITHUB_ACTOR + SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} + #TODO - name: Set Leak Period [SonarQube] + #TODO run: checkout du parent commun + #TODO run: mvn -U clean verify '-Dmaven.test.failure.ignore=true' + #TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]r' '-Dsonar.buildbreaker.skip=true' '-Dsonar.projectVersion=#d0b75832' + #TODO - name: Quality Gate [SonarQube] + #TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]' '-Dsonar.gitlab.ref_name=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.commit_sha=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.project_id=3555' diff --git a/.github/workflows/maven-java.yml b/.github/workflows/maven-java.yml index 07f8a55..f1e48f6 100644 --- a/.github/workflows/maven-java.yml +++ b/.github/workflows/maven-java.yml @@ -1,6 +1,10 @@ name: Maven CI for Java -on: [push] +on: + push: + branches-ignore: + - 'feature/*' + - 'bugfix/*' jobs: gihub-context-get-info: @@ -18,6 +22,22 @@ jobs: env: JOB_CONTEXT: ${{ toJson(job) }} run: echo "$JOB_CONTEXT" + - name: Dump steps context + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + - name: Dump runner context + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "$RUNNER_CONTEXT" + - name: Dump strategy context + env: + STRATEGY_CONTEXT: ${{ toJson(strategy) }} + run: echo "$STRATEGY_CONTEXT" + - name: Dump matrix context + env: + MATRIX_CONTEXT: ${{ toJson(matrix) }} + run: echo "$MATRIX_CONTEXT" maven-build-test-package-deploy-site: name: Maven test, package and deploy Java project @@ -28,13 +48,13 @@ jobs: with: java-version: 1.8 - name: Maven version - run: mvn -version --file pom.xml --settings .github/workflows/settings.xml + run: mvn -version env: SERVER_USERNAME: $GITHUB_ACTOR SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} - name: Check out from version control uses: actions/checkout@v2 - - name: Cache Maven packages + - name: Cache Maven dependencies uses: actions/cache@v1 env: cache-name: cache-maven-dependencies @@ -45,38 +65,33 @@ jobs: ${{ runner.os }}-m2-${{ env.cache-name }}- ${{ runner.os }}-m2- ${{ runner.os }}- - - name: Get groupId - run: mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate '-Dexpression=project.groupId' -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml - env: - SERVER_USERNAME: $GITHUB_ACTOR - SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} - - name: Get artifactId - run: mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate '-Dexpression=project.artifactId' -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml - env: - SERVER_USERNAME: $GITHUB_ACTOR - SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} - - name: Get version - id: build-version-initial - run: mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate '-Dexpression=project.version' -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml + - name: Get Maven Project information + id: maven-project-info + run: | + echo "$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "::set-output name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" + echo "::set-output name=PACKAGING::$(mvn help:evaluate -Dexpression=project.packaging -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)" env: SERVER_USERNAME: $GITHUB_ACTOR SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} - #TODEL - name: Get short SHA - #TODEL id: short-sha - #TODEL run: | - #TODEL echo "Version initiale: ${MVN_VERSION}" - #TODEL echo "::set-env name=COMMIT_ID_SHORT::${GITHUB_SHA::8}" - #TODEL - name: Create version number - #TODEL id: create-version-number - #TODEL uses: frabert/replace-string-action@v1.1 - #TODEL with: - #TODEL pattern: "^(.*)-SNAPSHOT$" - #TODEL string: ${{env.MVN_VERSION}} - #TODEL replace-with: "$1-${COMMIT_ID_SHORT}-SNAPSHOT" - #TODEL - name: Set version number - #TODEL run: | - #TODEL echo "New version: ${{ steps.create-version-number.outputs.replaced }}" - #TODEL mvn versions:set -DnewVersion=${{ steps.create-version-number.outputs.replaced }} + - name: Get short SHA + id: short-sha + run: | + echo "Maven Project version: ${{ steps.maven-project-info.outputs.VERSION }}" + echo "::set-output name=COMMIT_ID_SHORT::${GITHUB_SHA::8}" + - name: Create version number + id: create-version-number + uses: frabert/replace-string-action@v1.1 + with: + pattern: "^(.*)-SNAPSHOT$" + string: ${{ steps.maven-project-info.outputs.VERSION }} + replace-with: "$1-${{ steps.short-sha.outputs.COMMIT_ID_SHORT }}-SNAPSHOT" + - name: Set version number + if: endsWith( steps.maven-project-info.outputs.VERSION, '-SNAPSHOT' ) && ( steps.maven-project-info.outputs.PACKAGING != 'pom' ) + run: | + echo "New version: ${{ steps.create-version-number.outputs.replaced }}" + mvn versions:set -DnewVersion=${{ steps.create-version-number.outputs.replaced }} --file pom.xml - name: Build with Maven run: mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml env: @@ -99,7 +114,7 @@ jobs: #TODO - name: Quality Gate [SonarQube] #TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]' '-Dsonar.gitlab.ref_name=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.commit_sha=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.project_id=3555' - name: Publish to GitHub Packages Apache Maven - run: mvn -U -Dmaven.main.skip -Dunit.test.skip -Dintegration.test.skip deploy --file pom.xml --settings .github/workflows/settings.xml + run: mvn -U -Dmaven.main.skip -Dunit.test.skip -Dverify.skip jar:jar@default-jar assembly:single@make-assembly source:jar-no-fork@attach-sources javadoc:jar@attach-javadocs deploy --file pom.xml --settings .github/workflows/settings.xml env: SERVER_USERNAME: $GITHUB_ACTOR SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}} diff --git a/.github/workflows/settings.xml b/.github/workflows/settings.xml index ae2e253..e1dbe0d 100644 --- a/.github/workflows/settings.xml +++ b/.github/workflows/settings.xml @@ -1,51 +1,51 @@ - - github - + + github + - - - github - - - central - https://repo1.maven.org/maven2 - - true - always - - - true - daily - - - - github - GitHub Release bdelion/maven-packages Apache Maven Packages - https://maven.pkg.github.com/bdelion/maven-packages - - true - always - - - true - daily - - - - - + + + github + + + central + https://repo1.maven.org/maven2 + + true + always + + + true + daily + + + + github + GitHub Release bdelion/maven-packages Apache Maven Packages + https://maven.pkg.github.com/bdelion/maven-packages + + true + always + + + true + daily + + + + + - - - github - ${env.SERVER_USERNAME} - ${env.SERVER_PASSWORD} - - + + + github + ${env.SERVER_USERNAME} + ${env.SERVER_PASSWORD} + + - - - - \ No newline at end of file + + + + diff --git a/.gitignore b/.gitignore index 9cf7322..6601acd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ - -# Created by https://www.gitignore.io/api/git,java,maven,eclipse,intellij,intellij+all,visualstudio,visualstudiocode -# Edit at https://www.gitignore.io/?templates=git,java,maven,eclipse,intellij,intellij+all,visualstudio,visualstudiocode +# Created by https://www.gitignore.io/api/git,java,maven,eclipse,intellij,intellij+all,visualstudiocode +# Edit at https://www.gitignore.io/?templates=git,java,maven,eclipse,intellij,intellij+all,visualstudiocode ### Eclipse ### .metadata @@ -281,352 +280,4 @@ buildNumber.properties # Ignore all local history of files .history -### VisualStudio ### -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp_proj -*_wpftmp.csproj -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# End of https://www.gitignore.io/api/git,java,maven,eclipse,intellij,intellij+all,visualstudio,visualstudiocode +# End of https://www.gitignore.io/api/git,java,maven,eclipse,intellij,intellij+all,visualstudiocode diff --git a/.travis.yml b/.travis.yml index 49dd69c..0c1e754 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,34 @@ jdk: cache: directories: - $HOME/.m2 -install: true - -script: - - mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml - - mvn -U -Dmaven.main.skip test --file pom.xml --settings .github/workflows/settings.xml - - mvn -U -Dmaven.main.skip -Dunit.test.skip verify --file pom.xml --settings .github/workflows/settings.xml - - mvn -U -Dmaven.main.skip -Dunit.test.skip -Dintegration.test.skip deploy --file pom.xml --settings .github/workflows/settings.xml - - mvn -U site --file pom.xml --settings .github/workflows/settings.xml \ No newline at end of file +install: skip + +stages: + - name: Get Maven Project information + - name: Build, Test and Verify with Maven + - name: Deploy and make Site + if: type = push AND branch =~ /^((develop|master)|((release|hotfix|support)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$/ + +jobs: + include: + - stage: Get Maven Project information + name: Get groupId + script: echo $(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml) + - script: echo $(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml) + name: Get artifactId + - script: echo $(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml) + name: Get version + - script: echo $(mvn help:evaluate -Dexpression=project.packaging -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml) + name: Get packaging + + - stage: Build, Test and Verify with Maven + script: + - mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml + - mvn -U -Dmaven.main.skip test --file pom.xml --settings .github/workflows/settings.xml + - mvn -U -Dmaven.main.skip -Dunit.test.skip verify --file pom.xml --settings .github/workflows/settings.xml + + - stage: Deploy and make Site + name: Publish to GitHub Packages Apache Maven + script: + - mvn -U -Dmaven.main.skip -Dunit.test.skip -Dverify.skip jar:jar@default-jar assembly:single@make-assembly source:jar-no-fork@attach-sources javadoc:jar@attach-javadocs deploy --file pom.xml --settings .github/workflows/settings.xml + - mvn -U site --file pom.xml --settings .github/workflows/settings.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 4be6e2a..b72bbe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,16 @@ # Changelog > NOTE : Le format est basé sur [Keep a Changelog], -et ce projet adhère à [Semantic Versioning]. +> et ce projet adhère à [Semantic Versioning]. Tous les changements notables apportés à ce projet seront documentés dans ce fichier. ## [Unreleased] > ## [8.1.0] - 2020-mm-jj -> -> * Intégration plus propre de Jacoco. -> * Intégration plus propre de SonarCloud. +> +> - Intégration plus propre de Jacoco. +> - Intégration plus propre de SonarCloud. ## [8.0.0] - 2020-mm-jj @@ -18,35 +18,35 @@ Download at TODO ### Added -* :pencil: Nouveau README.md. -* :pencil: Mise en place CHANGELOG.md. +- :pencil: Nouveau README.md. +- :pencil: Mise en place CHANGELOG.md. ### Changed -* +\* ### Deprecated -* +\* ### Removed -* +\* ### Fixed -* +\* ### Security -* +\* ### Dependencies -* +\* -[Keep a Changelog]: https://keepachangelog.com/fr/1.0.0/ -[Semantic Versioning]: https://semver.org/lang/fr/ -[Unreleased]: https://github.com/bdelion/java-parent/compare/8.0.0...HEAD +[keep a changelog]: https://keepachangelog.com/fr/1.0.0/ +[semantic versioning]: https://semver.org/lang/fr/ +[unreleased]: https://github.com/bdelion/java-parent/compare/8.0.0...HEAD [8.0.1]: https://github.com/bdelion/java-parent/compare/8.0.1...8.0.0 -[8.0.0]: https://github.com/bdelion/java-parent/releases/tag/8.0.0 \ No newline at end of file +[8.0.0]: https://github.com/bdelion/java-parent/releases/tag/8.0.0 diff --git a/README.md b/README.md index be6ca96..cfde026 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ > `java-parent` est un pom qui permet de gérer pour mes dév Java Training : > -> * les versions des dépendances obligatoires. -> * les phases de builds communes. +> - les versions des dépendances obligatoires. +> - les phases de builds communes. ## :house: [Homepage] @@ -33,13 +33,13 @@ Ajouter au `pom.xml` de votre composant : ## :construction_worker: Fabriqué avec -* [Visual Studio Code] - Editeur de code source. +- [Visual Studio Code] - Editeur de code source. ## :busts_in_silhouette: Authors :bust_in_silhouette: **Bertrand DELION** -* Github: [@bdelion] +- Github: [@bdelion] Voir aussi la liste des [contributeurs] ayant participés à ce projet. @@ -60,30 +60,29 @@ Pour les versions disponibles, voir [les tags de ce projet]. ## :link: Liens utiles -* :pencil: Documentation : [Wiki] -* :building_construction: Build : - * [Job Travis CI] - * [Github Actions] -* Repository : [GitHub Package Registry] +- :pencil: Documentation : [Wiki] +- :building_construction: Build : + - [Job Travis CI] + - [Github Actions] +- Repository : [GitHub Package Registry] ## :spider_web: Dependency -* [Dependencies] - Dépendances de ce projet -* [Dependents] - Projets dépendants de celui-ci +- [Dependencies] - Dépendances de ce projet +- [Dependents] - Projets dépendants de celui-ci - -[Make a README]: https://www.makeareadme.com/#template-1 -[Homepage]: https://github.com/bdelion/java-parent/tree/master -[Visual Studio Code]: https://code.visualstudio.com/ +[make a readme]: https://www.makeareadme.com/#template-1 +[homepage]: https://github.com/bdelion/java-parent/tree/master +[visual studio code]: https://code.visualstudio.com/ [@bdelion]: https://github.com/bdelion [contributeurs]: https://github.com/bdelion/java-parent/graphs/contributors -[CHANGELOG]: CHANGELOG.md +[changelog]: CHANGELOG.md [issues]: https://github.com/bdelion/java-parent/issues -[SemVer]: http://semver.org/ +[semver]: http://semver.org/ [les tags de ce projet]: https://github.com/bdelion/java-parent/tags -[Wiki]: https://github.com/bdelion/java-parent/wiki -[Job Travis CI]: https://travis-ci.com/bdelion/java-parent -[Github Actions]: https://github.com/bdelion/java-parent/actions -[GitHub Package Registry]: https://github.com/bdelion/java-parent/packages -[Dependencies]: https://github.com/bdelion/java-parent/network/dependencies -[Dependents]: https://github.com/bdelion/java-parent/network/dependents \ No newline at end of file +[wiki]: https://github.com/bdelion/java-parent/wiki +[job travis ci]: https://travis-ci.com/bdelion/java-parent +[github actions]: https://github.com/bdelion/java-parent/actions +[github package registry]: https://github.com/bdelion/java-parent/packages +[dependencies]: https://github.com/bdelion/java-parent/network/dependencies +[dependents]: https://github.com/bdelion/java-parent/network/dependents diff --git a/pom.xml b/pom.xml index 8b7073c..18adaf9 100644 --- a/pom.xml +++ b/pom.xml @@ -1,637 +1,669 @@ - - 4.0.0 + + 4.0.0 - + - - fr.fifiz.socle.java - java-parent - 8.0.0-SNAPSHOT - pom - FIFIZ :: Socle Java :: java-parent - Pom parent Java de mes projets - - https://bdelion.github.io/java-parent/ - + + fr.fifiz.socle.java + java-parent + 8.0.0-SNAPSHOT + pom + FIFIZ :: Socle Java :: java-parent + Pom parent Java de mes projets - - FIFIZ Company - https://bdelion.github.io/ - + + https://bdelion.github.io/java-parent/ + - - - bdelion - Bertrand Delion - bertrand.delion@free.fr - https://github.com/bdelion - FIFIZ Company - https://github.com/bdelion - +1 - - Architect - Developer - - - + + FIFIZ Company + https://bdelion.github.io/ + - - - - https://github.com/bdelion/java-parent - scm:git:git://github.com/bdelion/java-parent.git - scm:git:git@github.com:bdelion/java-parent.git - HEAD - - - https://github.com/bdelion/java-parent/issues - GitHub Issues - - - GitHub Actions - https://github.com/bdelion/java-parent/actions - + + + bdelion + Bertrand Delion + bertrand.delion@free.fr + https://github.com/bdelion + FIFIZ Company + https://github.com/bdelion + +1 + + Architect + Developer + + + - - - github - GitHub Snapshot bdelion/maven-packages Apache Maven Packages - https://maven.pkg.github.com/bdelion/maven-packages - - - - github - GitHub Release bdelion/maven-packages Apache Maven Packages - https://maven.pkg.github.com/bdelion/${project.artifactId} - - - - - - github - GitHub bdelion/maven-packages Apache Maven Packages - https://github.com/bdelion - - true - - - true - - - + + + + https://github.com/bdelion/java-parent + scm:git:git://github.com/bdelion/java-parent.git + scm:git:git@github.com:bdelion/java-parent.git + HEAD + + + https://github.com/bdelion/java-parent/issues + GitHub Issues + + + GitHub Actions + https://github.com/bdelion/java-parent/actions + - - - 1.8 - UTF-8 - - 3.6.3 - - - 3.0.0-M3 - 2.7 - - 1.8 - - 3.1.0 - 3.0.0-M1 - 3.0.0-M1 - - 3.1.0 - 3.8.1 - - ${java.version} - ${java.version} - UTF-8 - true - true - false - false - - 3.2.0 - 3.2.0 - 3.2.1 - 3.1.2 - 3.0.0 - - 4.0.0 - - 5.6.1 - 3.0.0-M4 - 3.0.0-M4 - 0.8.5 - ${project.build.directory}/coverage-reports/jacoco-ut.exec - ${project.build.directory}/coverage-reports/jacoco-it.exec - + + + github + GitHub Release bdelion/maven-packages Apache Maven Packages + https://maven.pkg.github.com/bdelion/${project.artifactId} + + + + + + github + GitHub bdelion/maven-packages Apache Maven Packages + https://github.com/bdelion + + true + + + true + + + + + + + 1.8 + UTF-8 + + 3.6.3 + + + 3.0.0-M3 + 2.7 + + 1.8 + + 3.1.0 + 3.0.0-M1 + 3.0.0-M1 + + 3.1.0 + 3.8.1 + + ${java.version} + ${java.version} + UTF-8 + true + true + false + false + + 3.2.0 + 3.2.0 + 3.2.1 + 3.2.0 + 3.1.2 + 3.0.0 + + 4.0.0 + + 5.6.2 + 3.0.0-M4 + 3.0.0-M4 + 0.8.5 + ${project.build.directory}/coverage-reports/jacoco-ut.exec + ${project.build.directory}/coverage-reports/jacoco-it.exec + - - true - - 3.9.0 - + + true + + 3.9.0 + 3.0.0 + 2.3 + - - - - - org.junit.jupiter - junit-jupiter-api - ${junit.version} - test - - - org.junit.jupiter - junit-jupiter-engine - ${junit.version} - test - - - + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + - - - - - - + + - - pl.project13.maven - git-commit-id-plugin - ${git-commit-id-plugin.version} - - true - - ${maven.main.skip} - full - json - false - false - - git.build.host - git.commit.id.abbrev - - - true - - ${project.build.outputDirectory}/git-properties.json - - - - get-the-git-infos - - revision - - initialize - - - - + ${maven.main.skip} + full + json + false + false + + git.build.host + git.commit.id.abbrev + + + true + + ${project.build.outputDirectory}/git-properties.json + + + + get-the-git-infos + + revision + + initialize + + + + - - org.apache.maven.plugins - maven-resources-plugin - ${maven-resources-plugin.version} - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco-maven-plugin.version} - - - - - pre-unit-test - test-compile - - prepare-agent - - - - ${unit.test.skip} - - ${jacoco.utReportPath} - ${jacoco.utReportPath} - - surefireArgLine - - - - - post-unit-test - test - - report - - - - ${unit.test.skip} - - ${jacoco.utReportPath} - - ${project.reporting.outputDirectory}/jacoco-ut - - - - - - pre-integration-test - pre-integration-test - - prepare-agent-integration - - - - ${integration.test.skip} - - ${jacoco.itReportPath} - ${jacoco.itReportPath} - - failsafeArgLine - - - - - post-integration-test - post-integration-test - - report-integration - - - - ${integration.test.skip} - - ${jacoco.itReportPath} - - ${project.reporting.outputDirectory}/jacoco-it - - - - merge-unit-and-integration - post-integration-test - - merge - - - - - ${project.build.directory}/coverage-reports/ - - *.exec - - - - ${project.build.directory}/coverage-reports/merged.exec - - - - create-merged-report - post-integration-test - - report-aggregate - - - ${project.build.directory}/coverage-reports/merged.exec - ${project.reporting.outputDirectory}/jacoco-aggregate - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - false - alphabetical - - ${surefireArgLine} - - ${unit.test.skip} - - - **/*IT.* - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${maven-jar-plugin.version} - - - - true - true - - - ${project.name} - ${project.version} - ${project.groupId}.${project.artifactId} - ${maven.build.timestamp} - ${git.commit.id.abbrev} - - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${maven-failsafe-plugin.version} - - alphabetical - - ${failsafeArgLine} - - ${integration.test.skip} - - **/*IT.* - - - - - integration-tests - integration-test - - integration-test - - - - - verify-integration-tests - verify - - verify - - - - - + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + + + pre-unit-test + test-compile + + prepare-agent + + + + ${unit.test.skip} + + ${jacoco.utReportPath} + ${jacoco.utReportPath} + + surefireArgLine + + + + + post-unit-test + test + + report + + + + ${unit.test.skip} + + ${jacoco.utReportPath} + + ${project.reporting.outputDirectory}/jacoco-ut + + + + + + pre-integration-test + pre-integration-test + + prepare-agent-integration + + + + ${verify.skip} + + ${jacoco.itReportPath} + ${jacoco.itReportPath} + + failsafeArgLine + + + + + post-integration-test + post-integration-test + + report-integration + + + + ${verify.skip} + + ${jacoco.itReportPath} + + ${project.reporting.outputDirectory}/jacoco-it + + + + merge-unit-and-integration + post-integration-test + + merge + + + + + ${project.build.directory}/coverage-reports/ + + *.exec + + + + ${project.build.directory}/coverage-reports/merged.exec + + + + create-merged-report + post-integration-test + + report-aggregate + + + ${project.build.directory}/coverage-reports/merged.exec + ${project.reporting.outputDirectory}/jacoco-aggregate + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + false + alphabetical + + ${surefireArgLine} + + ${unit.test.skip} + + + **/*IT.* + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + default-jar + none + + + + + + true + true + + + ${project.name} + ${project.version} + ${project.groupId}.${project.artifactId} + ${maven.build.timestamp} + ${git.commit.id.abbrev} + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + alphabetical + + ${failsafeArgLine} + + ${verify.skip} + + **/*IT.* + + + + + integration-tests + integration-test + + integration-test + + + + + verify-integration-tests + verify + + verify + + + + + - - - org.apache.maven.plugins - maven-assembly-plugin - ${maven-assembly-plugin.version} - - ${maven-assembly-plugin-skip} - - - jar-with-dependencies - - - - - ${main-class} - true - true - - - ${project.name} - ${project.version} - ${project.groupId}.${project.artifactId} - ${maven.build.timestamp} - ${git.commit.id.abbrev} - - - - - - make-assembly - - package - - single - - - - - - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin.version} - - - attach-sources - package - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - ${maven-dependency-plugin.version} - - - analyze - - analyze-only - - - true - - - org.junit.jupiter:junit-jupiter-*:: - org.apache.logging.log4j:log4j-core:: - - true - - - - - - + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven-assembly-plugin.version} + + ${maven-assembly-plugin-skip} + + + jar-with-dependencies + + + + + ${main-class} + true + true + + + ${project.name} + ${project.version} + ${project.groupId}.${project.artifactId} + ${maven.build.timestamp} + ${git.commit.id.abbrev} + + + + + + make-assembly + + package + + single + + + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + analyze + + analyze-only + + + true + true + + org.apache.logging.log4j:log4j-core:: + + true + + + + + + - - - - org.apache.maven.plugins - maven-clean-plugin - ${maven-clean-plugin.version} - - - - pl.project13.maven - git-commit-id-plugin - - - - org.jacoco - jacoco-maven-plugin - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - - org.apache.maven.plugins - maven-source-plugin - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - org.apache.maven.plugins - maven-install-plugin - ${maven-install-plugin.version} - - - - org.apache.maven.plugins - maven-deploy-plugin - ${maven-deploy-plugin.version} - - - - org.apache.maven.plugins - maven-site-plugin - ${maven-site-plugin.version} - - - fr - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${maven-project-info-reports-plugin} - - - + + + + org.apache.maven.plugins + maven-clean-plugin + ${maven-clean-plugin.version} + + + + pl.project13.maven + git-commit-id-plugin + + + + org.jacoco + jacoco-maven-plugin + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + org.apache.maven.plugins + maven-install-plugin + ${maven-install-plugin.version} + + + + org.apache.maven.plugins + maven-deploy-plugin + ${maven-deploy-plugin.version} + + + + org.apache.maven.plugins + maven-site-plugin + ${maven-site-plugin.version} + + + fr + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + ${maven-project-info-reports-plugin} + + + - - - - org.jacoco - jacoco-maven-plugin - ${jacoco-maven-plugin.version} - - - jacoco-report - - report - - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - - - - jacoco-report-integration - - report-integration - - - ${project.build.directory}/coverage-reports/jacoco-it.exec - - - - jacoco-report-aggregate - - report-aggregate - - - ${project.build.directory}/coverage-reports/merged.exec - - - - - - org.apache.maven.plugins - maven-surefire-report-plugin - ${maven-surefire-plugin.version} - - - unit-tests - - report-only - - - - integration-tests - - failsafe-report-only - - - - - - + + + + org.apache.maven.plugins + maven-jxr-plugin + ${maven-jxr-plugin.version} + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + jacoco-report + + report + + + ${project.build.directory}/coverage-reports/jacoco-ut.exec + + + + jacoco-report-integration + + report-integration + + + ${project.build.directory}/coverage-reports/jacoco-it.exec + + + + jacoco-report-aggregate + + report-aggregate + + + ${project.build.directory}/coverage-reports/merged.exec + + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${maven-surefire-plugin.version} + + + unit-tests + + report-only + + + + integration-tests + + failsafe-report-only + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + + javadoc-no-fork + + + + + + org.apache.maven.plugins + maven-changelog-plugin + ${maven-changelog-plugin.version} + + + - - - project-controls-check - - - - - org.apache.maven.plugins - maven-enforcer-plugin - ${maven-enforcer-plugin.version} - - - enforce-rules-controls - - enforce - - - - - ${maven.version} - - - ${java.version} - - - Définissez plugin.version ! - - - enforces that the project doesn't have duplicate declared dependencies. - - - true - - A banned dependency or plugin was found! - - - - No Snapshots Allowed in releases! - true - - - - - + + - - - ${maven.main.skip} - - - - enforce-display-info - validate - - display-info - - - - - - - org.codehaus.mojo - versions-maven-plugin - ${versions-maven-plugin.version} - - - validate - - display-plugin-updates - display-dependency-updates - display-property-updates - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - ${maven-antrun-plugin.version} - - - validate - - run - - - - Displaying value of pom.xml element - [distributionManagement.repository.name] ${project.distributionManagement.repository.name} - [distributionManagement.repository.url] ${project.distributionManagement.repository.url} - [maven.main.skip] ${maven.main.skip} - [skipMain] ${skipMain} - [maven.test.skip] ${maven.test.skip} - [unit.test.skip] ${unit.test.skip} - [integration.test.skip] ${unit.test.skip} - [skipTests] ${skipTests} - [skip.unit.tests] ${skip.unit.tests} - [maven-assembly-plugin-skip] ${maven-assembly-plugin-skip} - - - - - - - - - + + + ${maven.main.skip} + + + + enforce-display-info + validate + + display-info + + + + + + + org.codehaus.mojo + versions-maven-plugin + ${versions-maven-plugin.version} + + + validate + + display-plugin-updates + display-dependency-updates + display-property-updates + + + + + + + +