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 6692163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:50:09+00:00 2026-05-26T05:50:09+00:00

I have a maven multi-module project (boy, I’ve written that opening way too many

  • 0

I have a maven multi-module project (boy, I’ve written that opening way too many times on this site). Almost all the modules (that is, the ones that have code in them) should run the maven-site-plugin to generate reports about code coverage, etc. These have a detailed shared configuration — which reports to run, which files to cover/exclude for certain plugins, etc.

However, there are a few modules that deal with packaging — running the assembly plugin to generate a tarball, etc. These gain nothing from running a site report — there’s no code to analyze, no tests to report on.

So I have a lot of modules that need to share plugin configuration, and a few modules that need to not run the plugin, preferably at all. I can do the former (share configuration) if I put the plugin in the <build> section of the parent POM, but I can’t seem to turn off the plugin when I need to in this case. I can do the latter (avoid running the plugin) if I push configuration down to each module’s own POM, but I can’t figure out a good way to share the configuration information in this case.

Is what I want — shared configuration, for a plugin that’s sometimes disabled by a child module — even possible? If so, how?

  • 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-05-26T05:50:10+00:00Added an answer on May 26, 2026 at 5:50 am

    By “run the plugin”, I’m assuming you mean that the plugin is bound to a lifecycle phase, and you’d like to unbind it in some modules. First, you could consider changing your POM inheritance so that the modules that don’t need the plugins have one parent and the ones that do have a different parent. If you don’t want to do that, then you can explicitly set the execution phase to “nothing” in a child module. E.g. if you had a parent pom configuration like this:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
            <execution>
                <id>i-do-something</id>
                <phase>initialize</phase>
                <goals>
                    <goal>exec</goal>
                </goals>
                <configuration>
                    ... lots of configuration
                </configuration>
            </execution>
        </executions>
    </plugin>
    

    Then in a child module, you could do this:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
            <execution>
                <id>i-do-something</id>
                <phase/>
            </execution>
        </executions>
    </plugin>
    

    Because it’s the same plugin and the same execution id, it overrides the configuration specified in the parent, and now the plugin isn’t bound to a phase in the child project.

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

Sidebar

Related Questions

We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin
I have a Java multi-module Maven project that I want to build an MVN
I have a multi-module Maven project that is a Java web application. I am
I'm new to Maven. I have a multi-module maven 2 project that has the
I have a multi-module maven project with an installer sub-project. The installer will be
I have created a multi module maven project. Now I have shared the project
I have a multi module maven project and I would like to use versions
I use eclipse and the maven plugin. I have a big multi-module project (~6
I have a multi-module Maven project, and I would like to assemble together artifacts
I have a multi-module maven project (several levels of nesting). Normally, when I execute

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.