-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix bug with mavenSettings in WrapperRunner while running tests locally #21890
Conversation
ia3andy
commented
Dec 2, 2021
The current behavior is the same as Maven's, so I'm -1 to this change |
What kind of use-case is this fixing? |
I suppose there could be a relative path evaluation that could go wrong. But just to clarify. |
IMHO if the |
If it's a relative path though, it could be resolved correctly against the current project but not the one it is passed to. So, perhaps, here we should be making sure we are always propagating an absolute path. But again it would be good to clarify what issue Andy ran into. |
maven is working fine locally without this file.. this bug was introduced when we started reading |
@gastaldi I don't think we should propagate the |
Here is when it started: #21673 |
I think the question is if the -s is explicitly set in the original command. |
@gastaldi no it's using the properties, I am not setting it manually. |
We should propagate what's been set in the original command. If it's an invalid path, that's the user's fault, the error should not be swallowed |
So I guess the fix is to make sure that |
I don't think we can can know if Maven is failing only when explicitly using So maybe it's not the best solution, but it's better than the current code.. |
@gastaldi if you have a better solution to not propagate |
It's okay to fail if the parameters are wrong, I think the bug is that -s is specified here but not in the original command |
We check whether |
We should always propagate it with |
35c030a
to
6eb683c
Compare
...projects/tools/devtools-testing/src/main/java/io/quarkus/devtools/testing/WrapperRunner.java
Outdated
Show resolved
Hide resolved
6eb683c
to
49dd31b
Compare
@@ -105,7 +107,7 @@ public static int run(Path projectDir, Wrapper wrapper) { | |||
private static String getMavenSettingsArg() { | |||
final String mavenSettings = System.getProperty("maven.settings"); | |||
if (mavenSettings != null) { | |||
return mavenSettings; | |||
return Files.exists(Paths.get(mavenSettings)) ? mavenSettings : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick: use Path.of
instead :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's a shortcut you are right. I think we can live with it :)
@@ -105,7 +107,7 @@ public static int run(Path projectDir, Wrapper wrapper) { | |||
private static String getMavenSettingsArg() { | |||
final String mavenSettings = System.getProperty("maven.settings"); | |||
if (mavenSettings != null) { | |||
return mavenSettings; | |||
return Files.exists(Paths.get(mavenSettings)) ? mavenSettings : null; | |||
} | |||
return BootstrapMavenOptions.newInstance().getOptionValue(BootstrapMavenOptions.ALTERNATE_USER_SETTINGS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW shouldn't we make this result an absolute path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth making sure the ALTERNATE_USER_SETTINGS is an absolute path.
Failing Jobs - Building 49dd31b
Full information is available in the Build summary check run. Failures⚙️ Gradle Tests - JDK 11 Windows #- Failing: integration-tests/gradle
📦 integration-tests/gradle✖
|
Error seems unrelated. @aloubyansky should we merge? |