Search code examples
mavenmulti-modulemaven-reactor

Can I get the Maven reactor to use different names?


I have pulled several repos together and am trying to perform a maven multi-module build. Everything works fine, but the artifactIds in those repos cause the maven reactor output to be confusing. Each repo generates artifacts with a different groupId but an identical artifactId. For example:

repo1 => my.company.repo1 / stupidName / 1.0.2
repo2 => my.company.repo2 / stupidName / 1.8.0
repo3 => my.company.repo3 / stupidName / 4.8.1

Those repos and their artifacts are fine. Any other project depending on those artifacts has no trouble declaring the correct dependencies. The only problem is that the reactor summary is kind of useless since each row has the same name.

Reactor Summary:

[exec] [INFO] stupidName ......... SUCCESS [ 31.276 s]
[exec] [INFO] stupidName ......... FAILURE [  7.840 s]
[exec] [INFO] stupidName ......... SUCCESS [  0.183 s]

Sure, with only three repos, it would not be hard to figure out which one failed. But there are lots. It would be nice if each of those rows had a unique name. I've played with renaming directories and using <finalName>, but none of that works. Apparently the reactor is using the <artifactId> listed in the pom.xml.

I do not believe I can justify changing the names of those artifacts and then updating all of the other projects which depend on them. That would be a ton of work for the sole purpose of making the build logs easier to read.

Is there a way to get different names to appear in the reactor summary without changing the artifactIds?

Edit: I see a comment for another question which looks like the author is explicitly avoiding my case. This makes me worry that I'm SOL.


Solution

  • The comment made by @khmarbaise was the answer I needed. Somehow I missed the <name> tag. Once I added that tag, the reactor output was much easier to read. For example:

    <project>
       <groupId>my.company.repo1</groupId>
       <artifactId>stupidName</artifactId>
       <name>muchBetterUniqueName</name>
       <version>1.0.2</version>
    
    Reactor Summary:
    
    [exec] [INFO] stupidName ............. SUCCESS [ 31.276 s]
    [exec] [INFO] muchBetterUniqueName ... FAILURE [  7.840 s]
    [exec] [INFO] stupidName ............. SUCCESS [  0.183 s]