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

update-properties goal ignores a property if it's also used in configuration (?) #1200

Open
jakub-bochenski opened this issue Dec 18, 2024 · 6 comments

Comments

@jakub-bochenski
Copy link

jakub-bochenski commented Dec 18, 2024

The report shows there are new versions:

 
[INFO] The following dependencies in Dependencies have newer versions:
[INFO]   com.google.dagger:dagger .............................. 2.52 -> 2.53.1

but the update-properties goal doesn't even consider the dagger.version property:

[INFO] --- versions:2.18.0:update-properties (default-cli) @ server ---
[INFO] Property ${jooq.version}: Leaving unchanged as 3.19.16

display-property-updates also ignores it:

[INFO] The following version properties are referencing the newest available version:
[INFO]   ${jooq.version} ............................................. 3.19.16

The property is defined in the same way as the jooq.version that is processed correctly.

        <dagger.version>2.52</dagger.version>
        <jooq.version>3.19.16</jooq.version>

what is the reason? How can I make the update-properties goal update it.

I'm using a property to keep the version, because you can't manage plugin dependencies via dependencyManagement (and you need to add dagger to your compiler plugin).

The difference between dagger.version and jooq.version is that I use dagger.version to set regular dependency version and in configuration of kotlin-maven-plugin; I use jooq.version to set regular and plugin versions.

Could using the property in configuration of plugin be the reason that versions is ignoring it?

                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <configuration>
                    <jvmTarget>${jvm.release}</jvmTarget>
                    <args>
                        <arg>-Xcontext-receivers</arg>
                    </args>
                </configuration>
                <executions>
                    <execution>
                        <id>kapt</id>
                        <goals>
                            <goal>kapt</goal>
                        </goals>
                        <configuration>
                            <annotationProcessorPaths>
                                <annotationProcessorPath>
                                    <groupId>com.google.dagger</groupId>
                                    <artifactId>dagger-compiler</artifactId>
                                    <version>${dagger.version}</version>
                                </annotationProcessorPath>
                            </annotationProcessorPaths>
                        </configuration>
                    </execution>


@jakub-bochenski
Copy link
Author

You can reproduce it on this project mrp.tar.gz

@jakub-bochenski
Copy link
Author

@jakub-bochenski
Copy link
Author

The plugin is also missing postgres.driver.version which is used as a dependency version and twice as plugin dependency version

@jakub-bochenski
Copy link
Author

So it seems that using a property as dependency version and also using it as:

  • plugin version - project/build/pluginManagement/plugins/plugin/version - is processed
  • plugin dependency version - project/build/pluginManagement/plugins/plugin/dependencies/dependency/version - is ignored
  • plugin configuration - project/build/pluginManagement/plugins/plugin/configuration - is ignored

@andrzejj0
Copy link
Contributor

I have briefly looked at the code and I think the same applies to display-property-updates, set-property, property-updates-report.

Also, build extensions are also not scanned for properties (unless an extension also happens to be a plugin).

@andrzejj0
Copy link
Contributor

SO: https://stackoverflow.com/q/79289041/1237617

This may happen: goals do not yet share the same backend operations to retrieve data, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants