Simplify Maven build - #1894
Conversation
PR Summary
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1894 +/- ##
============================================
+ Coverage 92.45% 92.52% +0.07%
- Complexity 3569 3571 +2
============================================
Files 347 347
Lines 7052 7052
Branches 675 675
============================================
+ Hits 6520 6525 +5
+ Misses 369 366 -3
+ Partials 163 161 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
What's the propose of this PR, and what's with these commit messages. If you use an AI, please use one which isn't silly. Also, why is the upper bound of maven removed? |
Hi there. Sorry for the lack of explanations for the changes! I do not use AI, those silly commit messages are 100% mine ^^. You must be talking in particular about "Let configuration breath": I did not mind about it since merge with squash would overwrite it. I can change it if needed. The upper bound of maven isn't removed, the range definition is replaced with the simpler syntax: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1893 by simplifying the Maven build configuration: it consolidates Java build/release version properties and streamlines the Kotlin Maven plugin setup using the extensions mechanism.
Changes:
- Replace
releaseJavaVersion/buildJavaVersionwith a singlejava.versionproperty and use it for compiler release. - Simplify Kotlin Maven plugin configuration by switching to
extensions=trueand removing explicit executions/sourceDirs wiring. - Minor cleanup/formatting adjustments in
pom.xml(comments, whitespace, property empty tag style).
| <version>${kotlin.version}</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> |
| <requireJavaVersion> | ||
| <version>[${buildJavaVersion},)</version> | ||
| <version>${java.version}</version> | ||
| </requireJavaVersion> |
| <groupId>org.jetbrains.kotlin</groupId> | ||
| <artifactId>kotlin-maven-plugin</artifactId> | ||
| <version>${kotlin.version}</version> | ||
| <executions> | ||
| <execution> | ||
| <id>compile</id> | ||
| <phase>compile</phase> | ||
| <goals> | ||
| <goal>compile</goal> | ||
| </goals> | ||
| <configuration> | ||
| <sourceDirs> | ||
| <source>src/main/java</source> | ||
| <source>target/generated-sources/annotations</source> | ||
| </sourceDirs> | ||
| </configuration> | ||
| </execution> | ||
| <execution> | ||
| <id>test-compile</id> | ||
| <phase>test-compile</phase> | ||
| <goals> | ||
| <goal>test-compile</goal> | ||
| </goals> | ||
| <configuration> | ||
| <sourceDirs> | ||
| <source>src/test/java</source> | ||
| <source>target/generated-test-sources/test-annotations</source> | ||
| <source>src/test/kotlin</source> | ||
| </sourceDirs> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| <configuration> | ||
| <jvmTarget>${releaseJavaVersion}</jvmTarget> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>default-compile</id> | ||
| <phase>none</phase> | ||
| </execution> | ||
| <execution> | ||
| <id>default-testCompile</id> | ||
| <phase>none</phase> | ||
| </execution> | ||
| <execution> | ||
| <id>compile</id> | ||
| <phase>compile</phase> | ||
| <goals> | ||
| <goal>compile</goal> | ||
| </goals> | ||
| </execution> | ||
| <execution> | ||
| <id>testCompile</id> | ||
| <phase>test-compile</phase> | ||
| <goals> | ||
| <goal>testCompile</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| <extensions>true</extensions> | ||
| </plugin> |
| <requireMavenVersion> | ||
| <!-- https://maven.apache.org/docs/history.html --> | ||
| <version>[3.9,)</version> | ||
| <version>3.9</version> | ||
| </requireMavenVersion> |
There was a problem hiding this comment.
I think this is the concern that @bodiam had. It's nice for devs to be able to use a higher version if they have it available and/or for renovate/dependabot to be able to upgrade. (Though I could be wrong on that last point, maybe they'd bump the static version 🤷♂️)
Address #1893