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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:42:44+00:00 2026-05-27T13:42:44+00:00

I have a custom plugin that I run on all our projects as part

  • 0

I have a custom plugin that I run on all our projects as part of the release:perform goal.

We are just starting to use multi-module builds, and I notice that my plugin only runs at the top module. What do I have to do to my plugin to make it run on all the modules individually at the end of the release? Do I have to iterate through them in the plugin code itself? If so, is there an example of doing that, because from what I see, MavenProject.getModules() just returns a list of String names of those modules, and I can’t see how to get info for those modules (my plugin needs the groupId:artifactId:version of each, and in this case, the modules do not always have the same version).

I’ve tried with and without @aggregator, but that doesn’t change anything with respect to my problem.

I’m assuming this is the same case as running the plugin directly (not tied to a phase) from CLI, which also only runs on the top-level of the project, and reports SKIPPED for all the sub-modules.

I am using Maven 3.0.3.

  • 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-27T13:42:44+00:00Added an answer on May 27, 2026 at 1:42 pm

    I had the same problem with my Maven plugin. It was only being invoked once (generally for the first module in the reactor), and I eventually traced it to the fact that my plugin had the Maven annotation “@requiresProject false”. It seems that the Maven Reactor only invokes such plugins once. Once I switched to “@requiresProject true”, my mojo was invoked once for each module. I wasn’t hooking into release:perform, so YMMV.

    As for accessing all the modules, instead of using MavenProject.getModules() which gives their names, you could inject their MavenProject objects like this:

       /**
        * The projects in the reactor.
        *
        * @parameter expression="${reactorProjects}"
        * @readonly
        */
       private List<MavenProject> reactorProjects;
    

    Watch out for @aggregator when binding to lifecycle phases. “When bound to a lifecycle, an aggregator mojo can have some nasty side-effects. It can force the execution of the … lifecycle phase to execute ahead of time, and can result in builds which end up executing the … phase twice.” ref

    How do you force a maven MOJO to be executed only once at the end of a build? has some alternatives to @aggregator.

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

Sidebar

Related Questions

I have a custom plugin for 3ds Max that interfaces with some managed code
I have a custom developed WordPress plugin that is using jQuery 1.4 and for
I have a custom browser plugin (built with FireBreath) that will invoke a local
I have a plugin that relies on a custom url mapping. When i install
I have a custom jQuery plugin which binds a change event to a form
I have a custom category (disciplines) in my method plugin which I want to
I am using jquery validation plugin for form validation. I have added a custom
I have custom coded several enterprise applications for mid to large organizations to use
I have custom classes that I currently instantiate within App.xaml as resources. I want
i have custom cell with 2 buttons(the function of these buttons is just to

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.