Skip to content

Commit 5d13ecc

Browse files
committed
chore: remove output/.gradle and output/.m2 refs
Signed-off-by: behnazh-w <[email protected]>
1 parent e930b66 commit 5d13ecc

File tree

7 files changed

+2
-450
lines changed

7 files changed

+2
-450
lines changed

docker/user.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ fi
5252
# The directory that could be mounted to the host machine file systems should
5353
# have the owner as the current user in the host machine.
5454
chown --recursive macaron:macaron "$HOME"/.m2
55-
chown --recursive macaron:macaron "$HOME"/.gradle
5655
chown --recursive macaron:macaron "$HOME"/output
5756

5857
# Run the provided Macaron command with the user macaron.

docs/source/pages/output_files.rst

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Top level structure
2020
.. code-block::
2121
2222
output/
23-
├── .gradle/
24-
├── .m2/
2523
├── build_log/
2624
├── git_repos/
2725
├── reports/
@@ -182,18 +180,10 @@ This file stores the log messages from the latest run of Macaron.
182180
build_log
183181
^^^^^^^^^
184182

185-
This is the directory for storing the log from running external components such as `CycloneDx SBOM Maven plugin <https://github.com/CycloneDX/cyclonedx-maven-plugin>`_, `CycloneDx SBOM Gradle plugin <https://github.com/CycloneDX/cyclonedx-gradle-plugin>`_ or the `slsa-verifier <https://github.com/slsa-framework/slsa-verifier>`_.
183+
This is the directory for storing the log from running external components, such as `slsa-verifier <https://github.com/slsa-framework/slsa-verifier>`_.
186184

187185
^^^^^^^^^^^^^^^
188186
sbom_debug.json
189187
^^^^^^^^^^^^^^^
190188

191189
This file contain the debug information for running the SBOM generator to obtain dependencies of a repository.
192-
193-
^^^^^^^^^^^^^^^
194-
.m2 and .gradle
195-
^^^^^^^^^^^^^^^
196-
197-
These two directories cache the content of ``~/.m2`` and ``~/.gradle`` in the Docker container between different runs (which are
198-
mainly updated by the CycloneDX SBOM plugins).
199-
This will helps subsequent runs on the same target repository faster.

scripts/release_scripts/run_macaron.sh

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,8 @@ else
380380
echo "Setting default output directory to ${output}."
381381
fi
382382

383-
# Mount the necessary .m2 and .gradle directories.
384-
m2_dir="${output}/.m2"
385-
gradle_dir="${output}/.gradle"
386-
383+
# Mount the output directory.
387384
mount_dir_rw_allow_create "" "$output" "${MACARON_WORKSPACE}/output"
388-
mount_dir_rw_allow_create "" "$m2_dir" "${MACARON_WORKSPACE}/.m2"
389-
mount_dir_rw_allow_create "" "$gradle_dir" "${MACARON_WORKSPACE}/.gradle"
390385

391386
# Determine the local repos path to be mounted into ${MACARON_WORKSPACE}/output/git_repos/local_repos/
392387
if [[ -n "${arg_local_repos_path:-}" ]]; then
@@ -498,10 +493,6 @@ else
498493
# This is because:
499494
# - By default if --local-maven-repo is not used, Macaron uses $HOME/.m2 of the current
500495
# environment as the local maven repo.
501-
# - If --local-maven-repo is not set when Macaron is running in the Docker container, it will try to
502-
# use $HOME/.m2 WITHIN the container. This is not desirable as this $HOME/.m2 is being used
503-
# by the cyclonedx plugins for dependency resolution, which requires read write. We treat the local
504-
# maven repo as a read only directory, hence they cannot share.
505496
else
506497
local_maven_repo_in_container="${MACARON_WORKSPACE}/analyze_local_maven_repo_readonly"
507498
output_local_maven_repo="${output}/analyze_local_maven_repo_readonly"
@@ -535,21 +526,8 @@ if [[ -n "${arg_datalog_policy_file:-}" ]]; then
535526
mount_file "-f/--file" "$datalog_policy_file" "$datalog_policy_file_in_container" "ro,Z"
536527
fi
537528

538-
# Determine that ~/.gradle/gradle.properties exists to be mounted into ${MACARON_WORKSPACE}/gradle.properties
539-
if [[ -f "$HOME/.gradle/gradle.properties" ]]; then
540-
mounts+=("-v" "$HOME/.gradle/gradle.properties":"${MACARON_WORKSPACE}/gradle.properties:ro,Z")
541-
fi
542-
543-
# Determine that ~/.m2/settings.xml exists to be mounted into ${MACARON_WORKSPACE}/settings.xml
544-
if [[ -f "$HOME/.m2/settings.xml" ]]; then
545-
mounts+=("-v" "$HOME/.m2/settings.xml":"${MACARON_WORKSPACE}/settings.xml:ro,Z")
546-
fi
547-
548529
# Set up proxy.
549530
# We respect the host machine's proxy environment variables.
550-
# For Maven and Gradle projects that Macaron needs to analyzes, the proxy configuration
551-
# for Maven wrapper `mvnw` and Gradle wrapper `gradlew` are set using `MAVEN_OPTS` and
552-
# `GRADLE_OPTS` environment variables.
553531
proxy_var_names=(
554532
"http_proxy"
555533
"https_proxy"
@@ -559,8 +537,6 @@ proxy_var_names=(
559537
"HTTPS_PROXY"
560538
"FTP_PROXY"
561539
"NO_PROXY"
562-
"MAVEN_OPTS"
563-
"GRADLE_OPTS"
564540
)
565541

566542
for v in "${proxy_var_names[@]}"; do
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ steps:
1515
- name: Run macaron analyze
1616
kind: analyze
1717
options:
18-
ini: config.ini
1918
main_args:
2019
- -lr
2120
- ./output/git_repos/local_repos

tests/integration/cases/apache_maven_local_path_with_branch_name_digest_deps_cyclonedx_maven/config.ini

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)