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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:42:39+00:00 2026-06-06T03:42:39+00:00

Short version : I would like the maven-glassfish-plugin to only be executed in the

  • 0

Short version:

I would like the maven-glassfish-plugin to only be executed in the root project in a hierarchical (inheritance based) maven multiproject setup.

Long version:

Following setup:

project-root
|
+-pom.xml
|
+ ear-module
|  |
|  +-pom.xml
|
+ jar-module
   |
   +-pom.xml

All submodules are included in the root project via <modules>...</modules> and all submodules inherit the root project pom.xml.
In my root project pom I include the maven-glassfish-plugin:

...
<plugin>
    <groupId>org.glassfish.maven.plugin</groupId>
    <artifactId>maven-glassfish-plugin</artifactId>
    <version>2.1</version>
    <inherited>false</inherited>
    <configuration>
            <glassfishDirectory>${glassfish.home}</glassfishDirectory>
            <passwordFile>${glassfish.home}/masterpassword.txt</passwordFile>
            <domain>
                    <name>${project.name}</name>
                    <adminPort>4848</adminPort>
                    <httpPort>8080</httpPort>
                    <httpsPort>8443</httpsPort>
                    <iiopPort>3700</iiopPort>
                    <jmsPort>7676</jmsPort>
            </domain>
            <components>
                    <component>
                    <name>poc.vermittler</name>
                    <artifact>${project.basedir}/ear-module/target/ear-project-1.0-SNAPSHOT.ear</artifact>
                    </component>
    </configuration>
</plugin>
...

(Note: This is just an simplified version of my pom. It may not run 🙂

I want to only deploy the ear-module module to glassfish, this is why I added <inherited>false</inherited> section, and depict the modules to be deployed as <components>...</components> in the root pom.

Now the command:

mvn glassfish:deploy

Will deploy the ear to glassfish, all well so far… but then maven will decent recursively to all submodules, which will all fail with:

No plugin found for prefix 'glassfish' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories

I could tell maven to only run the root project with the -pl option but for my gusto, deploying shouldn’t rely on such additional information.

Thanks a lot for your 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-06-06T03:42:41+00:00Added an answer on June 6, 2026 at 3:42 am

    It seems that there is no good solution to this problem:

    • either the plugin supports a “NOP”/silent discard functionality
    • or it will fail in all subprojects

    Another method could be to create a new subproject (which is not included in the root project by <modules>...</modules> but inherits from the root project) and add dependencies to only the projects that have a deployment artifact.

    The plugin can now be included in this subproject without it wanting to run any subproject.

    Or for anybody who is lazy: mvn clean package glassfish:redeploy -pl . to selectively only run the root project without descending into child projects.

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

Sidebar

Related Questions

Short version I would like to scroll the ListBox item into view when the
Short version Need to distribute nightly builds to 70+ people each morning, would like
Short version: In pure Java EE 6, is there something like Spring's Authentication Processing
Short Version Calls to CommandManager.InvalidateRequerySuggested() take far longer to take effect than I would
For a project we have to write a Matlab simulation and would like to
I am finalizing the first version of my javascript app, and I would like
Short version: How would i go about creating an object pool that can store
I would like the version property of my application to be incremented for each
I would like to get latest tags from main TYPO3 repository. TYPO3 proposes short
Short version: I have a third-party MVC Extension that returns the FileResult. I would

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.