Search code examples
mavendebuggingloggingpom.xmlmaven-profiles

How to indicate active profiles in the Maven Reactor Summary?


At the end of my Maven build I see the following:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] ABC ............................................... SUCCESS [0.915s]
[INFO] ABC - Common ...................................... SUCCESS [1.435s]
[INFO] ABC - Database .................................... SUCCESS [0.202s]
[INFO] ABC - Entities .................................... SUCCESS [9.158s]
[INFO] ABC - Entity Services ............................. SUCCESS [0.200s]
[INFO] ABC - Web Application ............................. SUCCESS [1.738s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

I'm using profiles in some of the modules, e.g. to specify whether stubs and database generation are applied. Would like to quickly see whether these profiles have been activated. Thought it might be possible to do this by changing the project artifact name - e.g:

<profiles>
    <profile>
        <id>stubbed</id>
        <name>ABC - Entity Services [STUBBED]</name>
    </profile>
</profiles>

But Maven doesn't allow this. Is there an alternative way?


Solution

  • Not sure if I got your question correctly. If not, please rephrase or comment.

    You can see active profiles with the maven-help-plugin's active-profiles mojo. Use it like this:

    mvn help:active-profiles
    

    Does this answer your question?