avodonosov/hashver-maven-plugin

Build sequence of modules changes

fwscholz opened this issue · 3 comments

Hello @avodonosov,

for first, many thanks for creating this plugin/extension!

I'm playing around with it and made the following observation:
After performing the preparation steps (https://github.com/avodonosov/hashver-maven-plugin#preparation-steps) I build a multi-module project with and without hashver (-D hashverMode). Building without leads to the same build sequence of modules as before. The sequence of modules completely differs and the build fails cause of that, building with hashver.
Do you have an assumption why this happens?
Note: The "special" version definition ([artifactId].version) is always done in the dependencyManagement section, see following context explanation.

Little more context:
The multi-module project I have has nearly 300 modules, grown historically over years and result of a migration to a Monorepo last year. Some modules are so-called BOMs, defining dependencies with versions and imported by several other modules, defining some of these dependencies without versions.

Many thanks in advance,
Florian

@fwscholz , I didn't expect the module order to change (except skipping the modules whose artifacts already exists).

The extension that skips modules does not interfere very much with maven. Maven prepares the modules to build, calls the extension method afterProjectsRead and we only skip the ones we want to exclude, without affecting the order

This happens here: https://github.com/avodonosov/hashver-maven-plugin/blob/master/src/main/java/pro/avodonosov/mvnhashver/MavenLifecycleParticipant.java#L213

The "special" version definition ([artifactId].version) is always done in the dependencyManagement section

How about the module's own pom.xml? Check for example module pom.xml files in the sample modification I made for maven-wagon project: avodonosov/maven-wagon@13c3ae8#diff-07b0446ff9c2400f2c34778bde0c27759bc1411e874c54add2363ab074ab1692R31
Like wagon-providers/pom.xml

image

The <version> tag is added on line 31, otherwise I think it would inherit version from the parent pom - not what we want.
Do you have <version>[the module artifactId].version</version> tag in pom.xml for each module?

What else to suggest...
Can you try mvn depencency:tree -DhashverMode - is there anything useful to note?

@avodonosov, sorry for wasting your time!
I did a mistake in the script transforming the pom.xml files.
Now it works like a charm.

@fwscholz , I was actually glad to find out people use this tool.

I'd be curious to hear more - will you end up adopting it after the experiments, what average build speed-up results from that.