Skip to content

Commit

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

Co-authored-by: Rex P <[email protected]>
  • Loading branch information
2 people authored and julieqiu committed May 2, 2023
1 parent 59c3cd2 commit b8dd9ce
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 b8dd9ce

Please sign in to comment.