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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:25:27+00:00 2026-05-31T04:25:27+00:00

I have an EAR file built by maven and currently I have a commons

  • 0

I have an EAR file built by maven and currently I have a commons project which I’d like to put in an EAR\lib, so I used the maven-ear-plugin with the ‘bundleDir’ tag which works fine, only that now my commons.jar appears in both the lib folder and the EAR root. How do I tell it to put it only in the lib folder?

My pom:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <outputDirectory>../../outputs/java</outputDirectory>
                <version>5</version>
                <modules>
                    <jarModule>
                        <groupId>com.sample.common</groupId>
                        <artifactId>common</artifactId>
                        <includeInApplicationXml>
                            true
                        </includeInApplicationXml>
                        <bundleDir>/lib</bundleDir>
                    </jarModule>
                    ...
                </modules>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>ear</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

And here is the dependency definition:

<dependency>
        <groupId>com.sample.common</groupId>
        <artifactId>common</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
    </dependency>
  • 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-31T04:25:28+00:00Added an answer on May 31, 2026 at 4:25 am

    If your jar file is not ejb you can simply put it to ear dependency without definition into maven-ear-plugin. Otherwise try to setup scope provided to your jar inside the dependency list. This may help.

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

Sidebar

Related Questions

I currently have a project built with maven-archetype-webapp artifact. The default packaging for this
I have an ear file that is generated through Maven EAR plugin. The ear
I have an EAR file which I create with maven, it's made up of
I have a J2EE app deployed as an EAR file, which in turn contains
I developed an EAR using Quartz API. I have put my quartz.properties file in
I have an .ear file which contains multiple war files. I am moving the
I have a web application which deploys fine as an ear file. But when
I have an .ear file (an archive file like tar / zip) that has
It works with ear file we build with Maven. Using Gradle, I have an
I have an EAR file with a nested EJB project, a .war dynamic web

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.