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

Gradle 3.16 fails with missing required property additionalForcedProperties #44367

Closed
kdubb opened this issue Nov 7, 2024 · 15 comments · Fixed by #44399
Closed

Gradle 3.16 fails with missing required property additionalForcedProperties #44367

kdubb opened this issue Nov 7, 2024 · 15 comments · Fixed by #44399
Milestone

Comments

@kdubb
Copy link
Contributor

kdubb commented Nov 7, 2024

Describe the bug

Upgrading to 3.16.1 gives me a Gradle plugin error when attempting to build images (using Jib). The error seems to be an interaction with other plugins (specifically a code generation plugin). Although I have no idea what the issue actually is, and the same project worked in many previous versions of Quarkus.

Note that we have a pretty complex Gradle multi-module project. I have created a reproducer that captures that complexity.

Expected behavior

Gradle builds images as it did in 3.15 and previous

Actual behavior

Building images fails with:

FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':data-service:quarkusAppPartsBuild' (type 'QuarkusBuildCacheableAppParts').
  - In plugin 'io.quarkus' type 'io.quarkus.gradle.tasks.QuarkusBuildCacheableAppParts' property 'additionalForcedProperties' doesn't have a configured value.

    Reason: This property isn't marked as optional and no value has been configured.

    Possible solutions:
      1. Assign a value to 'additionalForcedProperties'.
      2. Mark property 'additionalForcedProperties' as optional.

    For more information, please refer to https://docs.gradle.org/8.9/userguide/validation_problems.htm

How to Reproduce?

quarkus-complex-project.zip

Run ./gradlew -Dquarkus.container-image.build=true build to see the error.

The plugin sundayGenerator (see plugins section of gradle/libs.versions.toml) is what causes the failure once added (does not even need to be configured to do any code generation).

I've recreated a basic version of that plugin @ buildSrc/src/main/kotlin/Zerox.gradle.kts. It does all the same steps but just copies some code from a directory in the project... this plugin does not fail despite doing nearly the exact same steps as the Sunday Generator (which is visible at https://github.com/outfoxx/sunday-generator in the gradle-plugin directory.

FYI, I maintain the Sunday Generator plugin. It's up to date with the latest Gradle, and I can see no reason why it should offend the Quarkus plugin

Output of uname -a or ver

macOS 15.0.1

Output of java -version

Java 21

Quarkus version or git rev

3.16.1

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.9

Additional information

No response

@kdubb kdubb added the kind/bug Something isn't working label Nov 7, 2024
Copy link

quarkus-bot bot commented Nov 7, 2024

/cc @geoand (jib,kotlin), @glefloch, @quarkusio/devtools

@jbonofre
Copy link

jbonofre commented Nov 7, 2024

FYI, the problem happens with quarkusBuild also (not only with jib).
I saw that building one project individually works, but a full build doesn't.

As share on zulip this morning:

  • maybe additionalForcedProperties property should be actually optional in the quarkusAppPartsBuild task ?
  • should I force a value for this property ?

@jbonofre
Copy link

jbonofre commented Nov 7, 2024

Just tested with Quarkus 3.16.2 and same issue. So, we should fix that for 3.16.3.

I'm working on a PR.

@jbonofre
Copy link

jbonofre commented Nov 7, 2024

For clarify: it's an issue with Quarkus 3.16.1 with Gradle in some "configuration".

jbonofre added a commit to jbonofre/polaris that referenced this issue Nov 7, 2024
@aloubyansky
Copy link
Member

Yes, this shouldn't be required. FYI @cdsap
@jbonofre feel free to open a PR. Thanks!

@jbonofre
Copy link

jbonofre commented Nov 8, 2024

@aloubyansky here we go ;) thanks !

@guitcastro
Copy link

Is there any workaround for it?

@cdsap
Copy link
Contributor

cdsap commented Nov 8, 2024

@aloubyansky, I'm still investigating the issue.

In a simple multi-module project, the issue does not appear. However, in the reproducer provided by @kdubb, the issue is triggered when the common project applies the sunday-generator plugin. I'm reviewing the code to identify what specifically triggers this behavior on the common-db task.

If I remove the plugin from the common module, the build passes: Link to Build Scan.

@cdsap
Copy link
Contributor

cdsap commented Nov 9, 2024

Added a first proposal solution for this issue #44399, but I will explore more options

@nining
Copy link

nining commented Nov 10, 2024

Is there any workaround, or should I wait for the next release?

@kdubb
Copy link
Contributor Author

kdubb commented Nov 11, 2024

@nining The workaround seems to be targeting a specific module (e.g. ./gradlew module_name:build); Gradle still ensures all the dependent modules are built as needed. If you need to build multiple modules, you have to invoke Gradle multiple times.

@cdsap
Copy link
Contributor

cdsap commented Nov 12, 2024

Another generic workaround is to define in the root build gradle the quarkus plugin without applying it:

 plugins {
    alias(libs.plugins.quarkus) apply false
 }

I tested the reproducer of this issue and with this workaround it works:
Reproducer Build Scan: https://ge.solutions-team.gradle.com/s/gg54xme7udczs
Reproducer with the root build gradle workaround: https://ge.solutions-team.gradle.com/s/opqnmmh4jigj2

It looks like the Gradle issue is gradle/gradle#17559 and it was discussed in the recent presentation https://speakerdeck.com/aurimas/gradle-the-build-system-that-loves-to-hate-you?slide=79

My proposal #44399 is still using the BuildService so won't fix entirely the issue, I'm exploring if it makes more sense to implement a different alternative to process the additional forced properties. ImageBuild and ImagePush can use inputs/outputs without problems, the only remaining issue would be nativeArgs(Action<Map<String, ?>> action) of the QuarkusBuild task.

@kdubb
Copy link
Contributor Author

kdubb commented Nov 14, 2024

@cdsap Thanks for the workaround. Fixed our behemoth of a project as well!

@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Nov 14, 2024
jbonofre added a commit to jbonofre/polaris that referenced this issue Nov 14, 2024
@HerrDerb
Copy link
Contributor

Thanks for the fix 🙂👍 any chance for 3.17 instead of 3.18?

@aloubyansky
Copy link
Member

It has a backport label set, so it will be considered. FYI @gsmet

@gsmet gsmet modified the milestones: 3.18 - main, 3.16.4 Nov 19, 2024
jbonofre added a commit to jbonofre/polaris that referenced this issue Nov 20, 2024
jbonofre added a commit to jbonofre/polaris that referenced this issue Nov 21, 2024
adutra pushed a commit to adutra/polaris that referenced this issue Nov 22, 2024
adutra pushed a commit to adutra/polaris that referenced this issue Nov 23, 2024
adutra pushed a commit to adutra/polaris that referenced this issue Nov 25, 2024
adutra pushed a commit to adutra/polaris that referenced this issue Nov 25, 2024
adutra pushed a commit to adutra/polaris that referenced this issue Nov 25, 2024
benkard pushed a commit to benkard/quarkus-googlecloud-jsonlogging that referenced this issue Nov 27, 2024
…oud-jsonlogging!25)

This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io.quarkus:quarkus-extension-processor](https://github.com/quarkusio/quarkus) |  | minor | `3.16.3` -> `3.17.0` |
| [io.quarkus:quarkus-extension-maven-plugin](https://github.com/quarkusio/quarkus) | build | minor | `3.16.3` -> `3.17.0` |
| [io.quarkus:quarkus-bom](https://github.com/quarkusio/quarkus) | import | minor | `3.16.3` -> `3.17.0` |
| [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | minor | `3.16.3` -> `3.17.0` |
| [org.jboss.logmanager:jboss-logmanager](https://jboss.org) ([source](https://github.com/jboss-logging/jboss-logmanager)) | optional | minor | `3.0.6.Final` -> `3.1.0.Final` |

---

### Release Notes

<details>
<summary>quarkusio/quarkus</summary>

### [`v3.17.0`](quarkusio/quarkus@3.16.4...3.17.0)

[Compare Source](quarkusio/quarkus@3.16.4...3.17.0)

### [`v3.16.4`](https://github.com/quarkusio/quarkus/releases/tag/3.16.4)

[Compare Source](quarkusio/quarkus@3.16.3...3.16.4)

##### Complete changelog

-   [#&#8203;37040](quarkusio/quarkus#37040) - The flyway extension generates Kubernetes resources as if quarkus.flyway.enabled was a runtime property
-   [#&#8203;42446](quarkusio/quarkus#42446) - Add explanation/concept for extension maturity model
-   [#&#8203;44367](quarkusio/quarkus#44367) - Gradle 3.16 fails with missing required property `additionalForcedProperties`
-   [#&#8203;44399](quarkusio/quarkus#44399) - Declaring explicitly the build service in the QuarkusBuildTask
-   [#&#8203;44433](quarkusio/quarkus#44433) - Reflection free serializers ArrayIndexOutOfBoundsException
-   [#&#8203;44438](quarkusio/quarkus#44438) - Gradle `buildForkOptions` no longer used since quarkus 3.16.1
-   [#&#8203;44457](quarkusio/quarkus#44457) - Support for short and uncommon field names like set, get, and is
-   [#&#8203;44468](quarkusio/quarkus#44468) - Use `QUARKUS_FLYWAY_ACTIVE` instead of `QUARKUS_FLYWAY_ENABLED` env in Kubernetes resources
-   [#&#8203;44472](quarkusio/quarkus#44472) - Kotlin native Jackson serialization regression: EmptyList & EmptyMap missing
-   [#&#8203;44480](quarkusio/quarkus#44480) - Fix nullpointer on null code websockets-next
-   [#&#8203;44493](quarkusio/quarkus#44493) - Using BuildForkOptions in QuarkusBuildTask
-   [#&#8203;44494](quarkusio/quarkus#44494) - Register Kotlin's empty list and map for reflection
-   [#&#8203;44505](quarkusio/quarkus#44505) - Log in smallrye-jwt and oauth2 extensions when no bearer access token is available
-   [#&#8203;44507](quarkusio/quarkus#44507) - Fixed Timestamp not being set for otel log signals
-   [#&#8203;44509](quarkusio/quarkus#44509) - Updates to Infinispan 15.0.11.Final
-   [#&#8203;44515](quarkusio/quarkus#44515) - Coordinated Vert.x 4.5.11 upgrades
-   [#&#8203;44531](quarkusio/quarkus#44531) - Correct image file name to resolve broken image
-   [#&#8203;44537](quarkusio/quarkus#44537) - Update smallrye-jwt to 4.6.1
-   [#&#8203;44545](quarkusio/quarkus#44545) - Wrong index of ParameterizedType argument of Map when register type to be generated in JacksonCodeGenerator
-   [#&#8203;44571](quarkusio/quarkus#44571) - Update `CacheJsonRPCService.java` reference
-   [#&#8203;44574](quarkusio/quarkus#44574) - Grammar corrections for en-us

</details>

<details>
<summary>jboss-logging/jboss-logmanager</summary>

### [`v3.1.0.Final`](https://github.com/jboss-logging/jboss-logmanager/releases/tag/v3.1.0.Final): 3.1.0.Final

[Compare Source](jboss-logging/jboss-logmanager@3.0.6.Final...v3.1.0.Final)

#### What's Changed

-   \[LOGMGR-345] Ensure logger FQCN is correct for system logger by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#457
-   Migrate tests to keep the log files that were created. Put the log fi… by [@&#8203;jamezp](https://github.com/jamezp) in jboss-logging/jboss-logmanager#459
-   Bump org.junit:junit-bom from 5.10.1 to 5.10.2 by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#461
-   \[LOGMGR-346] Bump org.jboss.modules:jboss-modules from 2.1.2.Final to 2.1.3.Final by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#462
-   \[LOGMGR-347] Do not use deprecated SmallRye Common OS `Process` by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#464
-   \[LOGMGR-349] Bump org.eclipse.parsson:parsson from 1.1.5 to 1.1.6 by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#466
-   \[LOGMGR-351] Fix periodic file rotation by week, month, year. by [@&#8203;alex-pumpkin](https://github.com/alex-pumpkin) in jboss-logging/jboss-logmanager#468
-   Bump org.jboss.modules:jboss-modules from 2.1.3.Final to 2.1.5.Final by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#467
-   \[LOGMGR-350] Avoid TCCL when configuring the log manager by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#469
-   \[LOGMGR-351] Remove the deprecated per-deployment logging options. by [@&#8203;jamezp](https://github.com/jamezp) in jboss-logging/jboss-logmanager#471
-   Bump org.junit:junit-bom from 5.10.2 to 5.10.3 by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#478
-   Bump org.jboss.byteman:byteman-bmunit5 from 4.0.22 to 4.0.23 by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#476
-   Bump org.junit:junit-bom from 5.10.3 to 5.11.2 by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#488
-   Bump org.junit:junit-bom from 5.11.2 to 5.11.3 by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#490
-   \[LOGMGR-354] Avoid expensive JLine setup on JDK 23+ by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#491
-   Save head encoding on sanitized String(s) by [@&#8203;franz1981](https://github.com/franz1981) in jboss-logging/jboss-logmanager#492
-   Use `NO_FORMAT` when using parameterless log methods by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#493
-   Switch to formal module descriptor by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#494
-   Module descriptor updates by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#496
-   Bump org.jboss.modules:jboss-modules from 2.1.5.Final to 2.1.6.Final by [@&#8203;dependabot](https://github.com/dependabot) in jboss-logging/jboss-logmanager#495
-   Add smart service provider method by [@&#8203;dmlloyd](https://github.com/dmlloyd) in jboss-logging/jboss-logmanager#497

#### New Contributors

-   [@&#8203;alex-pumpkin](https://github.com/alex-pumpkin) made their first contribution in jboss-logging/jboss-logmanager#468
-   [@&#8203;franz1981](https://github.com/franz1981) made their first contribution in jboss-logging/jboss-logmanager#492

**Full Changelog**: jboss-logging/jboss-logmanager@3.0.4.Final...v3.1.0.Final

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
adutra pushed a commit to adutra/polaris that referenced this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants