Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gradle.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export const getGradleSpringBootVersion = async (parsedGradle) => {
// Handle build.gradle, which allows 3.2.+ format
return springBootPlugin[0].version.replace('+', 'x');
}
// there are likely more places we could search for this variable, but we'll start here
if (parsedGradle?.buildscript?.ext?.springBootVersion) {
return String(parsedGradle?.buildscript?.ext?.springBootVersion).replace('+', 'x');
}
console.log('No Spring Boot version found.');
return '';
};
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spring-boot-dependency-checker",
"version": "0.3.0",
"version": "0.3.1",
"description": "Spring Boot Dependency Checker - validate that you're using the versions Spring Boot has approved with your project.",
"keywords": [
"spring boot",
Expand Down
11 changes: 5 additions & 6 deletions pom.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ const getSpringBootProperties = async (filename) => {

export const getPomDependenciesWithVersions = async (parsedPom) => {
let allDependencies = [];
// if it's not an array, a single dependency has been declared and it doesn't apply
if (Array.isArray(parsedPom?.project?.dependencies?.dependency)) {
allDependencies = allDependencies.concat(parsedPom.project.dependencies.dependency.filter(dep => dep.version));
if (parsedPom?.project?.dependencies?.dependency) {
allDependencies = allDependencies.concat(parsedPom.project.dependencies.dependency);
}
if (Array.isArray(parsedPom?.project?.dependencyManagement?.dependencies?.dependency)) {
allDependencies = allDependencies.concat(parsedPom.project.dependencyManagement.dependencies.dependency.filter(dep => dep.version));
if (parsedPom?.project?.dependencyManagement?.dependencies?.dependency) {
allDependencies = allDependencies.concat(parsedPom.project.dependencyManagement.dependencies.dependency);
}
return allDependencies;
return allDependencies.filter(dep => dep.version);
};

export const getPomSpringBootVersion = async (parsedPom) => {
Expand Down