Skip to content

Commit

Permalink
👻 refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Mar 11, 2024
1 parent 18afa85 commit 4b401e7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions provider/internal/java/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,10 @@ func explode(ctx context.Context, log logr.Logger, archivePath, projectPath stri
if dep.foundOnline {
dependencies = append(dependencies, dep)
// copy this into m2 repo to avoid downloading again
destPath := m2Repo
for _, subPath := range strings.Split(dep.GroupId, ".") {
destPath = filepath.Join(destPath, subPath)
}
for _, subPath := range strings.Split(dep.ArtifactId, ".") {
destPath = filepath.Join(destPath, subPath)
}
destPath = filepath.Join(destPath, dep.Version, filepath.Base(filePath))
groupPath := filepath.Join(strings.Split(dep.GroupId, ".")...)
artifactPath := filepath.Join(strings.Split(dep.ArtifactId, ".")...)
destPath := filepath.Join(m2Repo, groupPath, artifactPath,
dep.Version, filepath.Base(filePath))
if err := moveFile(filePath, destPath); err != nil {
log.V(8).Error(err, "failed moving jar to m2 local repo")
} else {
Expand Down

0 comments on commit 4b401e7

Please sign in to comment.