Skip to content

Conversation

@suztomo
Copy link
Member

@suztomo suztomo commented Nov 19, 2025

This change makes it easy to run tests with controlled dependencies via Maven properties.

This change is helpful in both pull request approach and branch approach. For example, we can update the version of the google-cloud-logging dependency by mvn versions:set-property -DpropertiesVersionsFile=dependency-upgrade.properties where dependency-upgrade.properties has:

google-cloud-logging.version=3.23.8
google-cloud-monitoring.version=3.81.0
google-cloud-spanner.version=6.103.0
google-cloud-spanner-jdbc.version=2.34.0
google-cloud-storage.version=2.60.0

https://www.mojohaus.org/versions/versions-maven-plugin/set-property-mojo.html

Note that java-logging-logback will use only google-cloud-logging.version property but the command accepts multiple entries there.

.mvn/maven.config v.s. mvn versions:set-property

Both approach can create a commit to run builds. I prefer mvn versions:set-property because the resulting pull request is mergeable.

We cannot use a property for the parent pom version

A site note: I tried to use a property in the parent pom version, but it did not work:

suztomo@suztomo98:~/java-logging-logback$ mvn install
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/google/cloud/sdk-platform-java-config/$%7Bsdk-platform-java-config.version%7D/sdk-platform-java-config-$%7Bsdk-platform-java-config.version%7D.pom

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: logging Issues related to the googleapis/java-logging-logback API. labels Nov 19, 2025
@suztomo suztomo changed the title maven ci test ci: make it easy to change the dependencies via .mvn/maven.config Nov 19, 2025
@suztomo suztomo marked this pull request as ready for review November 19, 2025 22:07
@suztomo suztomo requested review from a team as code owners November 19, 2025 22:07
@suztomo suztomo changed the title ci: make it easy to change the dependencies via .mvn/maven.config ci: make it easy to change the dependencies via "mvn version:set-property" Nov 20, 2025
Comment on lines +30 to +37
echo "mvn dependency:tree for google-cloud-logging and gax"
mvn dependency:tree -Dverbose -Dincludes=com.google.cloud:google-cloud-logging,com.google.api:gax

echo "mvn help:effective-pom"
mvn help:effective-pom -Dverbose

echo "Installing the project"

Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, while it's not strictly needed, the commands are here to confirm the effect of dependency changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: logging Issues related to the googleapis/java-logging-logback API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants