-
Notifications
You must be signed in to change notification settings - Fork 3k
Use existing Maven BootstrapSessionListener to hint Surefire about required JVM parameters #50915
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
base: main
Are you sure you want to change the base?
Conversation
…quired JVM parameters
|
I haven't tried this but reading How do I use properties set by other plugins in argLine?, i was wondering whether adding some generic |
Status for workflow
|
If we do end up going down this route, we should at least log a message that we were not able to apply the proper flags automatically. |
Yes of course, I plan warnings and proper deprecations. I do have alternative ways to set the flags - it's just that I like them less (they imply the agent approach with self-attach, discussed on the other PR). Essentially this gives us the opportunity to let people migrate to better approaches by nudging them rather than having a strong requirement, and gradually nudge them to better approaches. In practice I think I'd like to get people to add |
I'm not following @aloubyansky , could you elaborate? Do you mean people should be adding this to their project? My goal was to figure out ways to set what people need w/o them having to change their build scripts. |
|
For a newly generated project, the surefire config looks like this currently: What we could consider doing is introducing a project property, e.g. So far, this would be equivalent to what we have. But That way we have a specific Quarkus property to override, which has its pros and cons. It doesn't require enabling extensions but it does require running a We already do some optimization steps in |
|
I see, thanks for the details! However I was really hoping for a solution in which we could control the Surefire arguments w/o the user needing to make changes to existing projects - it seems like that's not possible :-/ Now, having concluded that our users will need to make some changes: shouldn't we rather suggest users to enable pugin extensions? I'd much rather ask to add a single one-liner, which we can easily validate. My hope is that it's more future proof: should we need further evolutions, including in other areas, we can make them transparently without having to ask users to make changes yet again. This makes me think, actually, that I could already patch the extension today to check if extensions are enabled and suggest to do it when not. |
As I make progress on #49920 , it's becoming clear that we'll need all JVM modes to start with some new JVM flags.
In some cases we can automate this transparently, in others it's harder - it seems likely that we'll end up with needing people to apply some minor migration steps to set necessary parameters.
Among all "modes" which I'm trying to cover - Surefire is particularly problematic.
This particular PR is an attempt to mitigate some such needs, by setting the required parameters to Surefire automatically.
N.B.
This is only effective if people use
<extensions>true</extensions>in their pom.xml (Quarkus plugin config)But at least those who do would have a better experience
I'm fairly annoyed by this limitation, but couldn't find a way to make it work universally and transparently. An alternative would be for people to add the required settings in
.mvn/maven.config- but I'm inclined to pursue all such venues, so that at least those having Maven extensions enabled have some additional benefits deriving from it.For these reasons this PR is independent from #49920 : it's not requiring it, and the other patch can't rely on it.
For those people not having extensions enabled, I'm afraid they'll have to add some JVM flags expicitly in their pom (to be defined, and documented, as I finish #49920).
Finally, since it might be detabable if we want to apply this - I'd rather debate this approach separately and in isolation from the larger work, so I'd start by merging this if there are no objections: should be harmless when it's not useful.
WDYT, @aloubyansky , @gsmet , @geoand ?