Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maven.settings property to the test plugins and remove maven.repo in favor of maven.repo.local #15530

Merged

Conversation

aloubyansky
Copy link
Member

Otherwise devtools tests will be failing to locate the 999-SNAPSHOT artifacts.

@aloubyansky aloubyansky requested a review from famod March 8, 2021 09:40
@quarkus-bot quarkus-bot bot added the area/dependencies Pull requests that update a dependency file label Mar 8, 2021
@aloubyansky
Copy link
Member Author

@famod I actually can't recall what depends on maven.repo. Could you remind me please?

@aloubyansky
Copy link
Member Author

Ok, there is one other issue.

build-parent/pom.xml Outdated Show resolved Hide resolved
@aloubyansky aloubyansky force-pushed the maven-repo-local-test-plugins branch from 87a3da2 to b57dc39 Compare March 8, 2021 10:28
@famod
Copy link
Member

famod commented Mar 8, 2021

@famod I actually can't recall what depends on maven.repo. Could you remind me please?

Well, it was first introduced here (back in 2018): 83a48e9

Occurences in current code:

grep -R --exclude-dir=target --include='*.java' '"maven.repo"' .
./test-framework/maven/src/main/java/io/quarkus/maven/it/MojoTestBase.java:        String repo = System.getProperty("maven.repo");
./test-framework/maven/src/main/java/io/quarkus/maven/it/verifier/RunningInvoker.java:        String repo = System.getProperty("maven.repo");

@famod
Copy link
Member

famod commented Mar 8, 2021

I wonder if this should be set in Codestarts etc. as well?

PS: The more system properties we have to set, the more appealing becomes an automatic "bridging" via a Maven extension (the discussion we had just recently).

@famod
Copy link
Member

famod commented Mar 8, 2021

I also wonder whether the localRepository system property should be used instead, which is already set by surefire: #11449 (comment)

@aloubyansky
Copy link
Member Author

I also wonder whether the localRepository system property should be used instead, which is already set by surefire: #11449 (comment)

Of course, If it's set by surefire. Sorry, I missed it. I should adjust the bootstrap maven resolver to pick it up directly.

@aloubyansky
Copy link
Member Author

@famod I actually can't recall what depends on maven.repo. Could you remind me please?

Well, it was first introduced here (back in 2018): 83a48e9

Occurences in current code:

grep -R --exclude-dir=target --include='*.java' '"maven.repo"' .
./test-framework/maven/src/main/java/io/quarkus/maven/it/MojoTestBase.java:        String repo = System.getProperty("maven.repo");
./test-framework/maven/src/main/java/io/quarkus/maven/it/verifier/RunningInvoker.java:        String repo = System.getProperty("maven.repo");

Ah, thanks. We could just use one property instead of multiple.

@famod
Copy link
Member

famod commented Mar 8, 2021

TBH, I do get that it's important that the right local repo ist used, but isn't there more to it?
I mean, it seems the remote (!) repos from the custom settings.xml are not being picked up...

@famod
Copy link
Member

famod commented Mar 8, 2021

Regarding all these properties: I'm +10 to reduce the number of them, to like primarily maven.repo.local and secondarily (as a fallback) localRepository.

@aloubyansky
Copy link
Member Author

TBH, I do get that it's important that the right local repo ist used, but isn't there more to it?
I mean, it seems the remote (!) repos from the custom settings.xml are not being picked up...

Perhaps, I missed something. What's the evidence of that?

@famod
Copy link
Member

famod commented Mar 8, 2021

TBH, I do get that it's important that the right local repo ist used, but isn't there more to it?
I mean, it seems the remote (!) repos from the custom settings.xml are not being picked up...

Perhaps, I missed something. What's the evidence of that?

This: #15513 (comment)
It's trying to download from repo.maven.apache.org but should be using maven-central.storage-download.googleapis.com from https://github.com/quarkusio/quarkus/blob/master/.github/mvn-settings.xml instead, no?

@aloubyansky
Copy link
Member Author

Sorry, which log is this quoting?

@famod
Copy link
Member

famod commented Mar 8, 2021

https://github.com/quarkusio/quarkus/pull/15513/checks?check_run_id=2043450734
Better download the log though. Btw, there are also successful downloads from central in that log...

@aloubyansky
Copy link
Member Author

Thanks @famod Apparently the env vars aren't propagated by the Maven invoker. It seems like we've always had this issue to me. I'll include the fix in this PR.

@famod
Copy link
Member

famod commented Mar 8, 2021

@aloubyansky beware though that JVM_TEST_MAVEN_OPTS is passed to mvn explicitly (as arguments):

run: mvn $JVM_TEST_MAVEN_OPTS install -pl 'integration-tests/maven' ${{ needs.build-jdk11.outputs.gib_args }}

It's only an env var because it makes it easier to handle in a GH workflow.

@aloubyansky aloubyansky force-pushed the maven-repo-local-test-plugins branch from b57dc39 to 16ea369 Compare March 8, 2021 17:36
@quarkus-bot quarkus-bot bot added area/jbang Issues related to when using jbang.dev with Quarkus area/maven area/testing labels Mar 8, 2021
@aloubyansky aloubyansky force-pushed the maven-repo-local-test-plugins branch from 16ea369 to f499aee Compare March 9, 2021 15:17
@aloubyansky
Copy link
Member Author

I removed maven.repo in favor of maven.repo.local and added maven.settings.

@aloubyansky aloubyansky changed the title Pass the local maven repo path to the tests as maven.repo.local system property Add maven.settings property to the test plugins and remove maven.repo in favor of maven.repo.local Mar 9, 2021
@@ -119,6 +120,7 @@ public MavenProcessInvocationResult execute(List<String> goals, Map<String, Stri
//just running GC
request.setMavenOpts("-Xmx128m");
}
MojoTestBase.passUserSettings(request);
Copy link
Member

Choose a reason for hiding this comment

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

In conjunction with https://github.com/quarkusio/quarkus/pull/15530/files#r590560562, maybe that method should be located in some util class in the verifier package instead of the test base class?

Copy link
Member

Choose a reason for hiding this comment

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

I'm also wondering whether MavenProcessInvoker should do the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's pretty much where this is used though. I liked the idea of wrapping the invoker. And the RunningInvoker is already overriding execute.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see MavenProcessInvoker being used directly though.

…m property and the maven settings as mave.settings property
Copy link
Member

@famod famod left a comment

Choose a reason for hiding this comment

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

LGTM now!

I'm a bit puzzled by localRepository though, but I'll switch to Zulip to clarify that.

@aloubyansky aloubyansky merged commit e0ad931 into quarkusio:master Mar 10, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/jbang Issues related to when using jbang.dev with Quarkus area/kotlin area/maven area/scala area/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants