snyk-mvn-plugin
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -18,9 +18,21 @@ var parse = require('./parse-mvn'); | ||
.then(function (result) { | ||
return { | ||
plugin: { | ||
name: 'bundled:maven', | ||
runtime: 'unknown', | ||
}, | ||
package: parse(result, options.dev), | ||
}; | ||
var parseResult = {}; | ||
try { | ||
parseResult = parse(result, options.dev); | ||
} catch (error) { | ||
console.log('\nAn unknown error occurred. ' + | ||
'Please include the trace below when reporting to Snyk:', error, '\n'); | ||
return Promise.reject(''); | ||
} | ||
if (parseResult.ok) { | ||
return { | ||
plugin: { | ||
name: 'bundled:maven', | ||
runtime: 'unknown', | ||
}, | ||
package: parseResult.data, | ||
}; | ||
} | ||
return Promise.reject(parseResult.message || | ||
'An internal error has occured. Please contact Snyk for support.'); | ||
}); | ||
@@ -27,0 +39,0 @@ } |
@@ -9,6 +9,16 @@ module.exports = parseTree; | ||
// Parse the output from 'mvn dependency:tree -DoutputType=dot' | ||
// Requires Maven >= 2.2 | ||
function parseTree(text, withDev) { | ||
text = text.replace(logLabel, ''); | ||
return getRootProject(text, withDev); | ||
try { | ||
return { | ||
ok: true, | ||
data: getRootProject(text, withDev), | ||
}; | ||
} catch (error) { | ||
return { | ||
ok: false, | ||
message: error.message, | ||
error: error, | ||
}; | ||
} | ||
} | ||
@@ -18,2 +28,7 @@ | ||
var projects = text.match(digraph); | ||
if (!projects) { | ||
throw new Error('Error: Cannot find dependency information. ' + | ||
'Please make sure that Apache Maven Dependency Plugin ' + | ||
'version 2.2 or above is installed.'); | ||
} | ||
var root = getProject(projects[0], null, withDev); | ||
@@ -20,0 +35,0 @@ // Add any subsequent projects to the root as dependencies |
@@ -26,3 +26,3 @@ { | ||
}, | ||
"version": "1.0.1" | ||
"version": "1.0.2" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6957
177