Skip to content

Commit

Permalink
Merge pull request #988 from snyk/feat/report-java-and-mvn-version
Browse files Browse the repository at this point in the history
feat: add java and maven version to analytics
  • Loading branch information
Mila Votradovec authored Jan 31, 2020
2 parents eea5146 + 23cbd4c commit 42fa08c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"snyk-go-plugin": "1.11.1",
"snyk-gradle-plugin": "3.2.4",
"snyk-module": "1.9.1",
"snyk-mvn-plugin": "2.7.0",
"snyk-mvn-plugin": "2.8.0",
"snyk-nodejs-lockfile-parser": "1.17.0",
"snyk-nuget-plugin": "1.16.0",
"snyk-php-plugin": "1.7.0",
Expand Down
16 changes: 16 additions & 0 deletions src/lib/snyk-test/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,22 @@ async function assembleLocalPayloads(
await spinner(spinnerLbl);
const deps = await getDepsFromPlugin(root, options);
analytics.add('pluginName', deps.plugin.name);
const javaVersion = _.get(
deps.plugin,
'meta?.versionBuildInfo?.metaBuildVersion.javaVersion',
null,
);
const mvnVersion = _.get(
deps.plugin,
'meta?.versionBuildInfo?.metaBuildVersion.mvnVersion',
null,
);
if (javaVersion) {
analytics.add('javaVersion', javaVersion);
}
if (mvnVersion) {
analytics.add('mvnVersion', mvnVersion);
}

for (const scannedProject of deps.scannedProjects) {
const pkg = scannedProject.depTree;
Expand Down

0 comments on commit 42fa08c

Please sign in to comment.