Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
69 changes: 69 additions & 0 deletions .github/workflows/maven-java-feature.yml
Original file line number Diff line number Diff line change
@@ -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'
81 changes: 48 additions & 33 deletions .github/workflows/maven-java.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Maven CI for Java

on: [push]
on:
push:
branches-ignore:
- 'feature/*'
- 'bugfix/*'

jobs:
gihub-context-get-info:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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}}
Expand Down
92 changes: 46 additions & 46 deletions .github/workflows/settings.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
</repository>
<repository>
<id>github</id>
<name>GitHub Release bdelion/maven-packages Apache Maven Packages</name>
<url>https://maven.pkg.github.com/bdelion/maven-packages</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
</repository>
</repositories>
</profile>
</profiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
</repository>
<repository>
<id>github</id>
<name>GitHub Release bdelion/maven-packages Apache Maven Packages</name>
<url>https://maven.pkg.github.com/bdelion/maven-packages</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>${env.SERVER_USERNAME}</username>
<password>${env.SERVER_PASSWORD}</password>
</server>
</servers>
<servers>
<server>
<id>github</id>
<username>${env.SERVER_USERNAME}</username>
<password>${env.SERVER_PASSWORD}</password>
</server>
</servers>

<pluginGroups></pluginGroups>
<proxies></proxies>
<mirrors></mirrors>
</settings>
<pluginGroups></pluginGroups>
<proxies></proxies>
<mirrors></mirrors>
</settings>
Loading