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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:02:38+00:00 2026-05-16T05:02:38+00:00

This is my parent pom.xml (part of it) in a multi-module project: … <build>

  • 0

This is my parent pom.xml (part of it) in a multi-module project:

...
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
…

This configuration instructs mvn to execute checkstyle plugin in the root project and every sub-module. I don’t want it to work this way. Instead, I want this plugin to be executed only for the root project, and be skipped for every sub-module. At the same time, I have many sub-modules, and I don’t like the idea of explicitly skipping the plugin execution in every one of them.

Documentation for Checkstyle says "..ensure that you do not include the Maven Checkstyle Plugin in your sub modules..". But how can I ensure that if my sub-modules inherit my root pom.xml? I’m lost, please help.

  • 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-16T05:02:38+00:00Added an answer on May 16, 2026 at 5:02 am

    Perhaps you should separate your root pom into 2 separate entities: parent pom and aggregator pom. Your aggregator pom may even inherit from parent pom.

    If you download latest project layout for hibernate, you will see this design pattern in action.

    After this separation is done, you can define and execute checkstyle plugin just in aggregator/root pom. Because it is no longer a parent of your submodules it will not get inherited by them.

    EDIT
    Use <relativePath> when declaring <parent>

    Just for demonstration, below is an example taken from the hibernate project structure.
    The whole distribution can be found here-> http://sourceforge.net/projects/hibernate/files/hibernate3

    Just so, that you have some context, here is a subset of their directory layout

    project-root
       |
       +-pom.xml
       |
       + parent
       |  |
       |  +-pom.xml
       |
       + core
          |
          +-pom.xml
    
       .. rest is scipped for brevity
    

    project-root/pom.xml fragment

    <parent>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-parent</artifactId>
        <version>3.5.4-Final</version>
        <relativePath>parent/pom.xml</relativePath>
    </parent>
    
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate</artifactId>
    <packaging>pom</packaging>
    
    <name>Hibernate Core Aggregator</name>
    <description>Aggregator of the Hibernate Core modules.</description>
    
    <modules>
        <module>parent</module>
        <module>core</module>
    

    project-root/parent/pom.xml fragment

    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-parent</artifactId>
    <packaging>pom</packaging>
    <version>3.5.4-Final</version>
    

    project-root/core/pom.xml fragment

    <parent>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-parent</artifactId>
        <version>3.5.4-Final</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>
    
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <packaging>jar</packaging>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my parent pom.xml file (part of it) in a multi-module project: ...
In my parent pom I got this configuration to deploy sources jars: <plugin> <groupId>org.apache.maven.plugins</groupId>
I have the multi module project this is the parent pom. <?xml version=1.0 encoding=UTF-8?>
I have a relativey simple multi module maven buid with a parent pom. This
I have a multi-module project, and I am using profiles in the parent pom
Project structure is: /foo pom.xml /foo-war pom.xml /foo-ear pom.xml This is my parent pom.xml
I have the following dependency specified in my project's POM: <dependency> <groupId>org.jboss.client</groupId> <artifactId>jbossall-client</artifactId> <scope>compile</scope>
I have a Java multi-module Maven project that I want to build an MVN
I have a project with a parent pom.xml which define profiles, and a debug
I want to inherit the dependencies of a (parent) pom.xml in a child project

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.