Skip to content

Commit

Permalink
Maven local could be in a different location (#3690)
Browse files Browse the repository at this point in the history
* Maven local could be in a different location

* Check if file is found in default maven local

* Fix skip, add comment

* formatting

* formatting

Co-authored-by: Tim te Beek <[email protected]>

* add equals case with ~/.m2/repository

---------

Co-authored-by: Tim te Beek <[email protected]>
  • Loading branch information
pstreef and timtebeek authored Nov 15, 2023
1 parent 33c985f commit ac5cdc9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,11 @@ public Pom download(GroupArtifactVersion gav,
if (!f.exists()) {
continue;
}
String fullDefaultMavenLocalUri = MavenRepository.MAVEN_LOCAL_USER_NEUTRAL.getUri().replace("~", System.getProperty("user.home"));
if (!repo.getUri().equals(MavenRepository.MAVEN_LOCAL_USER_NEUTRAL.getUri()) && !repo.getUri().startsWith(fullDefaultMavenLocalUri)) {
// Non-default local Maven dependencies can not be shared between users, so we skip the repo
continue;
}

try (FileInputStream fis = new FileInputStream(f)) {
RawPom rawPom = RawPom.parse(fis, Objects.equals(versionMaybeDatedSnapshot, gav.getVersion()) ? null : versionMaybeDatedSnapshot);
Expand Down

0 comments on commit ac5cdc9

Please sign in to comment.