diff options
| author | Lucas Charles <me@lucascharles.me> | 2019-03-15 16:21:35 +0000 |
|---|---|---|
| committer | Lucas Charles <me@lucascharles.me> | 2019-03-15 16:21:35 +0000 |
| commit | 5a2172e9693e7a0cbdb17c636ec8acb5faee8261 (patch) | |
| tree | 4d8aaceb3367bb0026f4cb90994c237a327b25f8 | |
| parent | 2b30578f6c4d8904549de389de1448e727007331 (diff) | |
| parent | 4199a6a4ea45c38b547766510286f8cea253d98c (diff) | |
Merge branch '6838-skip-tests-for-maven-install' into 'master'v1.2.3
Skip "test" phase for Maven projects when installing the dependencies
See merge request gitlab-org/security-products/license-management!24
| -rw-r--r-- | .gitlab-ci.yml | 2 | ||||
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | README.md | 26 | ||||
| -rwxr-xr-x | run.sh | 2 |
4 files changed, 32 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5668f2..0b9a51e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,7 +78,7 @@ QA:java-maven: extends: .QA variables: QA_PROJECT: java-maven - QA_REF: ccec8318 + QA_REF: bab3d5b0 QA:python-pip: extends: .QA diff --git a/CHANGELOG.md b/CHANGELOG.md index 65acbc0..5818e98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # GitLab License management changelog +## v1.2.3 + +- Add ability to configure the `mvn install` execution for Maven projects via `MAVEN_CLI_OPTS` (!24) +- Skip `"test"` phase by default when running `mvn install` for Maven projects (!24) + ## v1.2.2 - Bump LicenseFinder to 5.6.2 @@ -40,9 +40,15 @@ docker run --rm --volume "/path/to/my/project":/code license-management analyze You can run integration tests on the image like this: ```sh -docker run --rm license-management /test/test.sh +docker run --rm license-management /test/test.sh project_name git_ref ``` +where: + +- `project_name` is the project slug among the +[test projects for security products](https://gitlab.com/gitlab-org/security-products/tests/) (e.g. `java-maven`) +- `git_ref` is the Git ref to checkout and scan against (e.g. `master`) + ## Supported languages and package managers The following table shows which languages and package managers are supported. @@ -67,6 +73,24 @@ and run your custom command to setup your environment with a custom package mana registry.gitlab.com/gitlab-org/security-products/license-management:latest analyze /code ``` +## Settings + +The License Management tool can be customized with environments variables for some project types. + +| Environment variable | Project type | Function | +|----------------------|--------------|----------| +| MAVEN_CLI_OPTS | Java (Maven) | Additional arguments for the mvn executable. If not supplied, defaults to `-DskipTests`. | + + +Inject the required environment variables to the docker command using the [`--env` option flag](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file) +or its shorthand form (`--env MY_SETTING_VAR`) if the configuration comes from an external environment. + + +*Caution:* if you supply the `MAVEN_CLI_OPTS` for a Maven project, don't forget to append `-DskipTests` to save time by skipping the test suite. + +*Tip:* in case you still need to run tests during license management check, supply `MAVEN_CLI_OPTS=-DskipTests=false` +to the docker command. + ## Versioning and release process @@ -153,7 +153,7 @@ case "$COMMAND" in if test -f pom.xml ; then # Install Java Maven dependencies. - mvn install + mvn install "${MAVEN_CLI_OPTS:--DskipTests}" fi if test -f build.gradle ; then |
