Building each module separately in Maven project

HI,

I am currently working on a Java project that requires using multiple modules that are defined in a POM, but it is using a custom build plugin that currently doesn’t support building multiple modules at the same time.

Is there any way to set up a CI that it only uses one module at once?

So effectively I have the module definition:

<modules>
    <module>module1</module>
    <module>module2</module>
</modules>

But I want it to act as two builds, the first where the modules are:

<modules>
    <module>module1</module>
    <!--<module>module2</module>-->
</modules>

and the second:

<modules>
    <!--<module>module1</module>-->
    <module>module2</module>
</modules>