Skip to content

Conversation

@sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

@sschuberth sschuberth force-pushed the maven-artifact-repo-query-fix branch 3 times, most recently from acd6347 to f0ddcea Compare February 15, 2023 16:20
@sschuberth sschuberth marked this pull request as ready for review February 15, 2023 16:25
@sschuberth sschuberth requested a review from a team as a code owner February 15, 2023 16:25
@sschuberth sschuberth force-pushed the maven-artifact-repo-query-fix branch 3 times, most recently from 66068db to af583bf Compare February 16, 2023 15:21
@sschuberth sschuberth requested a review from a team as a code owner February 16, 2023 15:21
mnonnenmacher
mnonnenmacher previously approved these changes Feb 16, 2023
Copy link
Member

@mnonnenmacher mnonnenmacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but it looks like there are more expected test results you need to update.

@sschuberth
Copy link
Member Author

Approved, but it looks like there are more expected test results you need to update.

The failing test pass for me locally (also see my message on Slack). Would you mind checking whether GradleKotlinScriptFunTest and SbtFunTest pass locally for you, too?

@sschuberth
Copy link
Member Author

On CI, I for example see

https://repo.maven.apache.org/maven2/org/jetbrains/annotations/13.0/annotations-13.0.jar

being used instead of

https://jcenter.bintray.com/org/jetbrains/annotations/13.0/annotations-13.0.jar

@mnonnenmacher
Copy link
Member

The failing test pass for me locally (also see my message on Slack). Would you mind checking whether GradleKotlinScriptFunTest and SbtFunTest pass locally for you, too?

Yes, tests pass locally.

@sschuberth
Copy link
Member Author

Yes, tests pass locally.

As I'm totally clueless by now, I've filed actions/setup-java#454.

@mnonnenmacher
Copy link
Member

As I'm totally clueless by now, I've filed actions/setup-java#454.

Did you already try to clear the settings.xml after the setup-java task?

@sschuberth
Copy link
Member Author

Did you already try to clear the settings.xml after the setup-java task?

Not after setup-java, but I instructed setup-java to not overwrite it (after I created an empty one).

@sschuberth sschuberth marked this pull request as draft February 20, 2023 16:25
@sschuberth sschuberth force-pushed the maven-artifact-repo-query-fix branch 5 times, most recently from 719717d to eb918e8 Compare February 20, 2023 20:58
@sschuberth sschuberth force-pushed the maven-artifact-repo-query-fix branch from 1c6b117 to 56802f8 Compare February 21, 2023 08:19
@sschuberth sschuberth changed the title fix(MavenSupport): Correct querying of artifact repos declared in POMs Fix issues with querying Maven artifacts from different repositories Feb 21, 2023
@sschuberth sschuberth marked this pull request as ready for review February 21, 2023 09:07
@sschuberth sschuberth requested review from a team, fviernau and mnonnenmacher February 21, 2023 09:08
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Consider artifact repositories declared in POMs with lowest priority for
Maven (see [1]) and not at all for Gradle (see [2]).

Adjust the expected results for affected tests accordingly. E.g.
`multi-kotlin-project` indeed only declares JCenter as a repository [3].

Fixes #6488.

[1]: https://maven.apache.org/guides/mini/guide-multiple-repositories.html#repository-order
[2]: https://docs.gradle.org/current/userguide/declaring_repositories.html#strict_limitation_to_declared_repositories
[3]: https://github.com/oss-review-toolkit/ort/blob/f6c9386/analyzer/src/funTest/assets/projects/external/multi-kotlin-project/build.gradle.kts#L13

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Previously, the cache for the remote artifacts only used the artifact
coordinates as the cache key. But if the list of repos to query changes,
there may be another match for the same artifact in another repo. Thus,
also take the list of repos into account for the cache key.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
The comment was no in-line with the code anyway, so address this by
avoiding the outer condition for the log level completely.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@sschuberth sschuberth force-pushed the maven-artifact-repo-query-fix branch from 56802f8 to 4879ca5 Compare February 21, 2023 12:02
@sschuberth sschuberth enabled auto-merge (rebase) February 21, 2023 12:02
@sschuberth sschuberth dismissed fviernau’s stale review February 21, 2023 12:02

Comment addressed.

@sschuberth sschuberth merged commit acfd617 into main Feb 21, 2023
@sschuberth sschuberth deleted the maven-artifact-repo-query-fix branch February 21, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants