Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:20:59+00:00 2026-06-04T06:20:59+00:00

In maven , once you define your modules in you pom.xml all profiles aggregate

  • 0

In maven, once you define your modules in you pom.xml all profiles aggregate the modules defined in them: (relevant part only)

<project>
    <modules>
        <module>module1</module>
    </modules>
    <profiles>
         <profile>
             <id>pr1</id>
             <modules>
                 <moudule>module2</module>
             </modules>

If you perform a mvn clean it will pass the command to module1.

If you issue mvn clean -Ppr1 it will pass along to module1 and module2.

I wonder if in maven 3 it is possible to have a pom.xml with submodules and override this. I mean to execute a profile that instead of add their own modules to the build force those like:

<project>
    <!-- omitted -->
    <modules>
        <!-- modules -->
    </modules>
    <build>
        <!-- build -->
    </build>
    <profiles>
        <profile>
             <!-- This profile with no modules -->
        </profile>
    </profiles>
</project>

The requirement might sound silly, but I just want to know if there is a mechanism like in plugin configuration.

<configuration self.combine="override"

Regards!

ssedano

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:21:00+00:00Added an answer on June 4, 2026 at 6:21 am

    It’s not possible. Profile configuration is always merged with main configuration, so you only can add modules in your case.

    What you can do instead, however, is to create a some kind of “default” profile (by <activeByDefault>true</activeByDefault> in <activation> section) that is enabled when no other profiles are invoked and put your default modules’ list there. Then, when no profile is specified on Maven build call, this “default” profile is used, but when you call explicitly at least one profile, it’s not, so you can this way define modules’ list from scratch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maven Jetty plugin is very nice (I'm using version 6.1.26). The only annoying thing
Maven's assembly plugin enables the creation of a big jar including all dependencies with
So maven downloads the pom then declares that it is missing. Then it proceeds
I'm developing on the standard Lift platform (maven and jetty). I'm repeatedly (once every
I would like to extend the Maven POM to include meta information about the
I build in maven multiple projects (let's name them A,B,C). Project A uses .jar
I know there is a list of all predefined Maven properties (you know like
I'm building my project using the following POM: <project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd> <modelVersion>4.0.0</modelVersion>
I need to execute the same maven plugin more than once in the same
In one of my Maven projects, dependency resolution will succeed once, then fail for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.