From ef53a78534aa2aab25dc0b5ad1593cb5f819655d Mon Sep 17 00:00:00 2001 From: Elias Ricken de Medeiros <26007058+erdemedeiros@users.noreply.github.com> Date: Mon, 7 Dec 2020 14:29:52 +0100 Subject: [PATCH 1/5] Make sure artifacts look up is done first on Maven Central While looking up for artifacts to download, Maven will use first the repositories defined in the settings and if it's not found it will default to Maven Central. Considering that most of the dependencies are coming from Central it's better to put Maven Central in the first place in the repository list to reduce the amount of time spent looking for the artifact in the wrong repository. --- .travis.settings.xml | 21 +++++++++++++++++++++ pom.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/.travis.settings.xml b/.travis.settings.xml index e60b0e0c4c..7f7046689e 100644 --- a/.travis.settings.xml +++ b/.travis.settings.xml @@ -6,6 +6,15 @@ true + + central + Central Repository + https://repo.maven.apache.org/maven2 + default + + false + + alfresco-internal @@ -19,6 +28,18 @@ + + central + Central Repository + https://repo.maven.apache.org/maven2 + default + + false + + + never + + alfresco-internal Alfresco Internal Repository diff --git a/pom.xml b/pom.xml index 2f571e587d..dc595daa68 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,15 @@ + + central + Central Repository + https://repo.maven.apache.org/maven2 + default + + false + + alfresco-internal Alfresco Internal Repository @@ -51,6 +60,18 @@ + + central + Central Repository + https://repo.maven.apache.org/maven2 + default + + false + + + never + + alfresco-private Alfresco Internal Repository @@ -99,12 +120,33 @@ rm-benchmark + + central + Central Repository + https://repo.maven.apache.org/maven2 + default + + false + + alfresco-internal https://artifacts.alfresco.com/nexus/content/groups/private + + central + Central Repository + https://repo.maven.apache.org/maven2 + default + + false + + + never + + alfresco-private https://artifacts.alfresco.com/nexus/content/groups/private From 1e08767c5916da372833f338d20c38092f355fbd Mon Sep 17 00:00:00 2001 From: cagache Date: Mon, 15 Mar 2021 15:18:38 +0200 Subject: [PATCH 2/5] exclude enterprise tests when commit contains [tests on community] --- travis/.travis.tests-stage.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/travis/.travis.tests-stage.yml b/travis/.travis.tests-stage.yml index c774080e8d..a9f5a019c8 100644 --- a/travis/.travis.tests-stage.yml +++ b/travis/.travis.tests-stage.yml @@ -11,7 +11,7 @@ jobs: target_paths: $TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER install: - | - if [[ ${TRAVIS_BRANCH} == *community* ]]; then + if [[ ${TRAVIS_COMMIT_MESSAGE} == *"[tests on community]"* ]]; then travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-community-repo -am else travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am @@ -19,7 +19,7 @@ jobs: - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-community-rest-api -am before_script: - | - if [[ ${TRAVIS_BRANCH} == *community* ]]; then + if [[ ${TRAVIS_COMMIT_MESSAGE} == *"[tests on community]"* ]]; then bash scripts/startAlfresco.sh $COMMUNITY_REPO_PATH false else bash scripts/startAlfresco.sh $ENTERPRISE_REPO_PATH false @@ -30,6 +30,7 @@ jobs: - name: "Enterprise Rest API Tests" stage: Tests + if: commit_message !~ /\[tests on community\]/ addons: artifacts: paths: @@ -51,6 +52,7 @@ jobs: - name: "Enterprise Rest API WORM Tests" stage: Tests + if: commit_message !~ /\[tests on community\]/ addons: artifacts: paths: @@ -72,6 +74,7 @@ jobs: - name: "Enterprise Rest API Cluster Tests" stage: Tests + if: commit_message !~ /\[tests on community\]/ addons: artifacts: paths: From ae26bd387b6b8f169c2db1107bc2b66eaaeb0e09 Mon Sep 17 00:00:00 2001 From: "Cezar.Leahu" Date: Tue, 16 Mar 2021 16:25:11 +0200 Subject: [PATCH 3/5] APPS-886 Clean up Mvn Repo configuration --- .travis.settings.xml | 12 +---------- pom.xml | 48 -------------------------------------------- 2 files changed, 1 insertion(+), 59 deletions(-) diff --git a/.travis.settings.xml b/.travis.settings.xml index e60b0e0c4c..3ad1180aae 100644 --- a/.travis.settings.xml +++ b/.travis.settings.xml @@ -22,18 +22,8 @@ alfresco-internal Alfresco Internal Repository - https://artifacts.alfresco.com/nexus/content/groups/internal - - - alfresco-public - Alfresco Public Repository https://artifacts.alfresco.com/nexus/content/groups/public - - alfresco-private - Alfresco Private Repository - https://artifacts.alfresco.com/nexus/content/groups/private - @@ -55,7 +45,7 @@ ${env.MAVEN_PASSWORD} - alfresco-private + alfresco-public ${env.MAVEN_USERNAME} ${env.MAVEN_PASSWORD} diff --git a/pom.xml b/pom.xml index 3e3cd228fd..551a2dc363 100644 --- a/pom.xml +++ b/pom.xml @@ -34,42 +34,6 @@ 3.3.9 - - - alfresco-internal - Alfresco Internal Repository - https://artifacts.alfresco.com/nexus/content/groups/internal/ - - - alfresco-public - https://artifacts.alfresco.com/nexus/content/groups/public - - - alfresco-public-snapshots - https://artifacts.alfresco.com/nexus/content/groups/public-snapshots - - - - - - alfresco-private - Alfresco Internal Repository - https://artifacts.alfresco.com/nexus/content/groups/private - - - alfresco-public - https://artifacts.alfresco.com/nexus/content/groups/public - - - alfresco-plugin-public - https://artifacts.alfresco.com/nexus/content/groups/public - - - alfresco-plugin-public-snapshots - https://artifacts.alfresco.com/nexus/content/groups/public-snapshots - - - alfresco-internal @@ -98,18 +62,6 @@ rm-automation rm-benchmark - - - alfresco-internal - https://artifacts.alfresco.com/nexus/content/groups/private - - - - - alfresco-private - https://artifacts.alfresco.com/nexus/content/groups/private - - From d3e7a3e36b2f35bc662b678754bf98810e661b94 Mon Sep 17 00:00:00 2001 From: "Cezar.Leahu" Date: Thu, 18 Mar 2021 23:20:52 +0200 Subject: [PATCH 4/5] APPS-886 Update readme with ~/.m2/setting.xml setup instructions [skip ci] --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 1be9cc9782..970ebe6346 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,22 @@ ## Contributing Please refer to our [How to contribute](/CONTRIBUTING.md) guide and our [Contributor Covenant Code of Conduct](/CODE_OF_CONDUCT.md). +## Configuring the ~/.m2/settings.xml file for local development +In order to be able to pull all the necessary project dependencies, the alfresco Maven +repositories should be configured in your local `~/.m2/settings.xml` file on your workstation. + +The necessary `` and `` configuration is available in the +[.travis.settings.xml](.travis.settings.xml) file (_alfresco-internal_ profile), +which is used by the project 's CI pipeline. +Just copy the **alfresco-internal** profile into your own `~/m2/repository.xml`. +You will also need to define an `alfresco-internal` server, but with your own Alfresco Nexus +credentials. + +For additional instructions you can check the official Maven documentation: +* [setting up repositories](https://maven.apache.org/guides/mini/guide-multiple-repositories.html) +* [setting up servers](https://maven.apache.org/settings.html#servers) +* [password encryption](https://maven.apache.org/guides/mini/guide-encryption.html) + ## Configuring and starting Alfresco/Share * Clone the project (e.g. `git clone git@github.com:Alfresco/governance-services.git`) * Import the project as a maven project From 7678d26a1e4402ea5e0a055725e047871b037fbc Mon Sep 17 00:00:00 2001 From: cagache Date: Mon, 22 Mar 2021 12:14:59 +0200 Subject: [PATCH 5/5] Run the security scans on the AGS build only on the master and release branches --- .travis.yml | 9 --------- travis/.travis.tests-stage.yml | 5 +++++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 887038834c..9827c05550 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,6 @@ stages: - name: Build AGS - name: Tests if: commit_message !~ /\[skip tests\]/ - - name: Security Scans - name: Release if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message =~ /\[(community|enterprise) release .*\]/ - name: Publish @@ -72,11 +71,3 @@ jobs: before_script: source scripts/setUpMavenPhase.sh script: - travis_retry travis_wait 35 mvn -B -q ${MAVEN_PHASE} -Dskip.integrationtests=false -f rm-benchmark/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - - - name: "Source Clear Scan (SCA)" - stage: Security Scans - script: travis_wait 30 bash scripts/source_clear.sh - - name: "Static Analysis (SAST)" - stage: Security Scans - script: - - echo "Static Analysis (SAST)" diff --git a/travis/.travis.tests-stage.yml b/travis/.travis.tests-stage.yml index a9f5a019c8..f5afdff84c 100644 --- a/travis/.travis.tests-stage.yml +++ b/travis/.travis.tests-stage.yml @@ -209,3 +209,8 @@ jobs: after_script: - bash scripts/getLogs.sh - bash scripts/cleanup.sh + + - name: "Source Clear Scan (SCA)" + stage: Tests + if: branch = master OR branch =~ /release\/V3.\d+.*/ + script: travis_wait 30 bash scripts/source_clear.sh