Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with snyk-prevent-gh-commit-status-linux #31

Open
ramanasisu opened this issue Jun 28, 2021 · 6 comments
Open

Issue with snyk-prevent-gh-commit-status-linux #31

ramanasisu opened this issue Jun 28, 2021 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@ramanasisu
Copy link

/snyk-prevent-gh-commit-status-linux
before i run the above command i need to run snyk test with outputfile option, snyk test fails when run as a stand alone.with mvn snyk plugin mvn snyk:test works fine, as we pass -s settings.xml (this has the url to our artifactory server).is there any way to pass settings.xml with snyk command?or can we use /snyk-prevent-gh-commit-status-linux,with mvn snyk plugin??

@aarlaud
Copy link
Contributor

aarlaud commented Jun 28, 2021

snyk-prevent-gh-commit-status uses snyk-delta under the hood, and snyk-delta doesn't care where the results come from as long as they are in the expected format.

In this case, I would suggest to use the maven plugin and add the --json-file-output option as arg, using the same CLI option (maven plugin uses the cli under the hood) to dump the json results into a json file that you can just then pass to snyk-prevent.

Note: I'm assuming you're using the latest maven plugin here, which does use the CLI unlike the previous versions.

Wanna give this a shot and let us know how it goes?

@aarlaud
Copy link
Contributor

aarlaud commented Jun 28, 2021

action item on our side is more a documentation matter here it feels like.

@aarlaud aarlaud added the documentation Improvements or additions to documentation label Jun 28, 2021
@ramanasisu
Copy link
Author

We are using snyk plugin 1.2.9 , guess its the latest version
I added the following to the mvn snyk plugin part


--json-file-output=snykTestResults.json

${SNYK_API_TOKEN}
false


The snykTestResults.json is not visible in the location from where mvn snyk:test is run.

@ghost
Copy link

ghost commented Jul 7, 2021

@ramanasisu v2.0.0 is the latest version. See https://github.com/snyk/snyk-maven-plugin which includes a migration guide.

Can you upgrade and try again?

@ramanasisu
Copy link
Author

Upgraded snyk-maven-plugin to 2.0.0 and the mvn snyk:test -Psnyk -s settings.xml fails, which actually works with snyk-maven-plugin 1.2.9.
snyk-maven-plugin:2.0.0:test (default-cli) @ onp-root ---
[INFO] Snyk Executable Path: /Users/venkattir/Library/Application Support/Snyk/snyk-macos
[INFO] Snyk CLI Version: 1.657.0 (standalone)

@ghost
Copy link

ghost commented Jul 9, 2021

@ramanasisu Can you share the failure logs with us? And if you have any relevant configuration in your pom.xml. Feel free to omit anything private.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants