Skip to content

Commit

Permalink
feat: improved error message when pom dependency version not found (#253
Browse files Browse the repository at this point in the history
)

Co-authored-by: Rex P <[email protected]>
  • Loading branch information
raboof and another-rex authored Mar 7, 2023
1 parent edb698a commit 2f90916
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/lockfile/parse-maven-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ func (mld MavenLockDependency) resolveVersionValue(lockfile MavenLockFile) strin

fmt.Fprintf(
os.Stderr,
"Failed to resolve version of %s: property \"%s\" could not be found",
"Failed to resolve version of %s: property \"%s\" could not be found for \"%s\"\n",
mld.GroupID+":"+mld.ArtifactID,
results[1],
lockfile.GroupID+":"+lockfile.ArtifactID,
)

return "0"
Expand All @@ -58,6 +59,8 @@ func (mld MavenLockDependency) ResolveVersion(lockfile MavenLockFile) string {
type MavenLockFile struct {
XMLName xml.Name `xml:"project"`
ModelVersion string `xml:"modelVersion"`
GroupID string `xml:"groupId"`
ArtifactID string `xml:"artifactId"`
Properties MavenLockProperties `xml:"properties"`
Dependencies []MavenLockDependency `xml:"dependencies>dependency"`
ManagedDependencies []MavenLockDependency `xml:"dependencyManagement>dependencies>dependency"`
Expand Down

0 comments on commit 2f90916

Please sign in to comment.