-
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
Correct filtering syntax and hardcode variable that cannot be resolved #35275
Conversation
@@ -12,8 +12,8 @@ | |||
<maven.compiler.release>11</maven.compiler.release> | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | |||
<surefire-plugin.version>${surefire-plugin.version}</surefire-plugin.version> | |||
<quarkus.version>@project.version</quarkus.version> | |||
<surefire-plugin.version>3.1.2</surefire-plugin.version> |
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.
<surefire-plugin.version>3.1.2</surefire-plugin.version> | |
<surefire-plugin.version>${version.surefire.plugin}</surefire-plugin.version> |
Just FYI, @holly-cummins, you don't have to do it again. The properties are defined here https://github.com/quarkusio/quarkus/blob/main/build-parent/pom.xml#L33-L35
I would do it to all the projects, TBH. I am not sure we are keeping all these plugin versions in-sync with the main build. If they are different for no specific reason, this causes extra artifact resolutions, take space on FS and time to download.
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.
Ah, it's the unexpected wording of the main property that meant it didn't resolve, and when I searched for it I couldn't find it. All I found were other resource-filtered projects that were also hardcoding the property value.
The main pom uses version.surefire.plugin
rather than surefire-plugin.version
, which is the word-order we use for most other properties (such as 'quarkus.version`).
It looks like we're pretty inconsistent across the codebase.
- We hardcode the surefire plugin version to 3.1.2 in 65 places
- We define or use a variable called
version.surefire.plugin
in 20 places - We define or use a variable called
surefire-plugin.version
in 39 places
So
- the centralised property is pretty unsuccessful, and is used in less than a third of usages
- the unexpected name of the centralised property probably isn't helping it to be used
- there's a lot of hardcoding of the surefire plugin version across our pom.xmls
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.
I looked at the other two properties in that file which use the 'non-standard' word order, version.exec.plugin
and version.enforcer.plugin
. It looks like the unexpected word order is because we're inheriting from jboss.
It might be that the pragmatic thing to do is define a centralised surefire-plugin.version
that's set to have the value of version.surefire.plugin
. Then we can stay in sync with the jboss-inherited content, while improving discoverability.
The version.exec.plugin
is only used in one other place, and that place hardcodes a value anyway. The version.enforcer.plugin
is used in 12 places, but actually, every single place it's used except one is to hardcode a value. We also have a similar enforcer-api.version
property which is used in a few places.
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 might be that the pragmatic thing to do is define a centralised
surefire-plugin.version
that's set to have the value ofversion.surefire.plugin
. Then we can stay in sync with the jboss-inherited content, while improving discoverability.
+1
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
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, we will need to clean up this Surefire situation at some point.
I discovered when I re-enabled the tests in #35124 that some of the resource filtering adjustments didn't quite work. Because the tests were disabled for the merge, I didn't notice. I've now corrected a syntax error in the
@
variable declaration, and hardcoded the surefire plugin version, as other resource filtered tests do. With these changes, the tests now behave in the expected way.If we want to resolve the hardcoding we could set a global variable and then do a pass of all the filtered resources, but I'll leave that for another change.