What's the best way to build core and client in a single Maven reactor? I
set up a pom.xml that lists them both as modules, so the directory
structure is:

- hc <-- :aggregator
- hc/core <-- :httpcore5-parent
- hc/client <-- :httpclient5-parent

This mostly works, but it has two problems. The first is that when I just
build core or client, Maven emits a warning saying that my project is
malformed, because it's expecting `hc/` to contain `httpcomponents-parent`,
rather than my aggregator POM. The second issue is that I need to pass
`-Dhttpcore.version=5.5-alpha1-SNAPSHOT` in order to link the httpclient5
projects to the reactor build of httpcore5.

For now, I'm ignoring the warnings, and I have a `.mvn/maven.config` file
with the following contents:

--threads=2C
-Drat.skip
-Dcheckstyle.skip
-Dhttpcore.version=5.5-alpha1-SNAPSHOT

Like I said, this works pretty well (it builds and tests all of
httpcomponents in 45 seconds), but it feels hacky. It's also not directly
reusable by other contributors. Is there a better way of doing this?

On Sun, Dec 28, 2025 at 5:48 AM Ryan Schmitt <[email protected]> wrote:

> On Sun, Dec 28, 2025 at 8:23 AM Oleg Kalnichevski <[email protected]>
> wrote:
>
>> When creating a release tag in Git I need to make sure it matches the
>> version information in POM metadata. With Maven that basically means
>> updating project and modules pom.xml.
>>
>>
>> https://github.com/ok2c/httpcomponents-release-tools/blob/master/release-lib/src/main/kotlin/com/github/ok2c/hc/release/HCReleasePlugin.kt#L217
>>
>> I would need to do something similar for Gradle which should not be hard
>> given it involves updating a single file. Still, it is an extra chore,
>> an extra moving part that can break or fail.
>>
>> Oleg
>
>
> Yeah, I think we can write a Gradle build that obtains all that
> information from the pom.xml in order to avoid duplication. I used `gradle
> init` and Codex to throw together a quick prototype:
>
> https://github.com/rschmitt/httpcomponents-core/tree/gradle
>
> With a warm daemon and configuration cache, it runs the entire test suite
> on my machine in just 17 seconds! (`./gradlew test`) This is nearly 50%
> faster than `./mvnw verify`.
>

Reply via email to