How to exclude a module from a Maven reactor build?

The easiest might be to use profiles like this:

<project>
  ...
  <modules>
    <module>common</module>
    <module>foo</module>
    <module>bar</module>
  <modules>
  ...
  <profiles>
    <profile>
      <id>expensive-modules-to-build</id>
      <modules>
        <module>data</module>
      </modules>
    </profile>
  </profiles>
</project>

You should then check out ways you can activate profiles


With Maven 3.2.1, you can now use -pl !<module_name>,!<module_name> to exclude certain modules from the reactor build.

See this feature request: https://issues.apache.org/jira/browse/MNG-5230

Tags:

Maven

Maven 2