Skip to content

Commit

Permalink
add MVN_REPO_URL envvar as an alternative repository manager to downl…
Browse files Browse the repository at this point in the history
…oad the jar from.

Issue veracode#18
  • Loading branch information
Macadoshis authored and Saad BENBOUZID committed Apr 20, 2022
1 parent e86714c commit 5468d72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ Veracode recommends that you use the toplevel parameter if you want to ensure th

With the scan deleted automatically, you can create subsequent scans without having to manually delete an incomplete scan.

## Environment variables

### `MVN_REPO_URL`

**Optional** STRING - Set to use an alternative maven repository.

If `MVN_REPO_URL` is set then the jar wrapper is downloaded from this url. Otherwise the default central will be used (`https://repo1.maven.apache.org/maven2`).

## Example usage

The following example will upload all files contained within the folder_to_upload to Veracode and start a static scan.
Expand Down
10 changes: 7 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,20 @@ fi

echo " -createprofile \"$createprofile\"" >> runJava.sh


if [ ! -n "$MVN_REPO_URL" ]; then
MVN_REPO_URL="https://repo1.maven.apache.org/maven2"
fi

#below pulls latest wrapper version. alternative is to pin a version like so:
#javawrapperversion=21.5.7.7

javawrapperversion=$(curl https://repo1.maven.org/maven2/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/maven-metadata.xml | grep latest | cut -d '>' -f 2 | cut -d '<' -f 1)
echo $MVN_REPO_URL

javawrapperversion=$(curl $MVN_REPO_URL/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/maven-metadata.xml | grep latest | cut -d '>' -f 2 | cut -d '<' -f 1)

#echo "javawrapperversion: $javawrapperversion"

curl -sS -o VeracodeJavaAPI.jar "https://repo1.maven.org/maven2/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/$javawrapperversion/vosp-api-wrappers-java-$javawrapperversion.jar"
curl -sS -o VeracodeJavaAPI.jar "$MVN_REPO_URL/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/$javawrapperversion/vosp-api-wrappers-java-$javawrapperversion.jar"
chmod 777 runJava.sh
cat runJava.sh
./runJava.sh

0 comments on commit 5468d72

Please sign in to comment.