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

Correct filtering syntax and hardcode variable that cannot be resolved #35275

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Member

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 of version.surefire.plugin. Then we can stay in sync with the jboss-inherited content, while improving discoverability.

+1

<quarkus.version>@project.version@</quarkus.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.bom.artifact-id>quarkus-bom</quarkus.bom.artifact-id>
<surefire-plugin.version>${surefire-plugin.version}</surefire-plugin.version>
<quarkus.version>@project.version</quarkus.version>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
<quarkus.version>@project.version@</quarkus.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
<quarkus.version>@project.version@</quarkus.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down