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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:14:25+00:00 2026-05-12T13:14:25+00:00

I have parent pom which configures certain plugins <pluginManagement> </plugins> <plugin> <artifactId>gmaven-plugin</artifactId> … </plugin>

  • 0

I have parent pom which configures certain plugins

<pluginManagement>
   </plugins>
      <plugin>
         <artifactId>gmaven-plugin</artifactId>
         ...
      </plugin>
      <plugin>
         <artifactId>maven-resources-plugin</artifactId>
         ...
      </plugin>
      <plugin>
         <artifactId>cargo-maven2-plugin</artifactId>
         ...
      </plugin>
   </plugins>
</pluginManagement>

And I have tree of poms which are represent integration tests

A-\
   a1
   a2
B-\
   b1
   b2
C-\
   D-\
      d1
      d2

In each a,b,d products I do

<build>
   <plugins>
      <plugin>
         <artifactId>gmaven-plugin</artifactId>
      </plugin>
      <plugin>
         <artifactId>maven-resources-plugin</artifactId>
      </plugin>
      <plugin>
         <artifactId>cargo-maven2-plugin</artifactId>
      </plugin>
   </plugins>
</build>

The problem is when I will need to add fourth plugin to integration test process for example my custom plugin I will need to move
through all of the integration modules and do manual adding.

You can advice me to remove <pluginManagement> to allow all child just to use them implicitly.
Yes, but in products which are just ‘pom’ I don’t want plugins to do anything: create some resources and put jboss configuration directories.

I wonder is there some kind of

<pluginsBundle>
   <groupId>my.group</groupId>
   <artifactId>my-integration-test-bundle</artifactId>
   <plugins>
      <plugin>
         <artifactId>gmaven-plugin</artifactId>
      </plugin>
      <plugin>
         <artifactId>maven-resources-plugin</artifactId>
      </plugin>
      <plugin>
         <artifactId>cargo-maven2-plugin</artifactId>
      </plugin>
   </plugins>
</pluginsBundle>

To allow me use it just like

   <plugin>
      <groupId>my.group</groupId>
      <artifactId>my-integration-test-bundle</artifactId>
      <runOnce>true</runOnce>
   </plugin>

I would like to add option like

<runOnce>true</runOnce>

to be able to start application server and deploy target only one time per maven launch.

  • 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-12T13:14:25+00:00Added an answer on May 12, 2026 at 1:14 pm

    I don’t know of a mechanism that does exactly what you need. Your best bet is to define a parent pom with those plugins defined in the build section, rather than the pluginManagement section. In this case the plugin configuration will always be defined. Adding the configuration to a profile in the parent means you can exercise some control over the activation of those plugins.

    One refinement to consider is that you can control activation of a profile by the presence or absence of a file. This way you can define the profile in the parent, but have it deactivated in that project because of the marker file being present in the parent. Child projects would not have the marker file in their source, so the profile would be activated for those projects. You can reverse the behaviour by using missing instead of exists if that makes sense for the majority of projects.

    <profile>
      <id>build</id>
      <activation>
        <file>
          <missing>src/main/resources/build.marker</missing>
          <!-- or if you want to enable the profile when the file does exist:
          <exists>src/main/resources/build.marker</exists-->
        </file>
      </activation>
      <build>
        </plugins>
          <plugin>
            <artifactId>gmaven-plugin</artifactId>
            ...
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            ...
          </plugin>
          <plugin>
            <artifactId>cargo-maven2-plugin</artifactId>
            ...
          </plugin>
        </plugins>
      </build>
    </profile>
    

    Alternatively, you could try writing custom plugin with a lifecycle that executes all the required mojos in a forked lifecycle. I recently answered another question with details of how to do this.

    Another alternative is to write another plugin that uses Maven shared-io to apply a descriptor
    to the pom, that descriptor can define arbitrary configuration that is merged into the pom. Another answer describes how this can be done.

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

Sidebar

Ask A Question

Stats

  • Questions 208k
  • Answers 208k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Let's suppose you have one page and one tag. #… May 12, 2026 at 9:32 pm
  • Editorial Team
    Editorial Team added an answer From your sample output, it seems what you are trying… May 12, 2026 at 9:32 pm
  • Editorial Team
    Editorial Team added an answer -overwrite the files on your local working copy with the… May 12, 2026 at 9:32 pm

Related Questions

I have parent pom which configures certain plugins <pluginManagement> </plugins> <plugin> <artifactId>gmaven-plugin</artifactId> ... </plugin>
Currently, I have a Maven project which inherits from a parent pom defining two
i have some questions about Maven 2 and i hope somebody can clear things
I saw this question and it motivated me to look again (without success) at
We have a fairly large group of Maven2 projects, with a root POM file

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.