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

  • Home
  • SEARCH
  • 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 497093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:44:55+00:00 2026-05-13T05:44:55+00:00

Situation is pretty straightforward. I have a Java webapp that I’m converting to be

  • 0

Situation is pretty straightforward. I have a Java webapp that I’m converting to be built with Maven. At present, the app is built with Ant into a single WAR file, which is then bundled into an EAR with a very simple application.xml.

maven-war-plugin and maven-ear-plugin both look pretty straightforward to me, and it appears they’re setting me up to be forced to consider the above as two distinct projects, with the WAR project as a dependency of the EAR project. This seems a tad inconvenient, especially because a profile setting of the WAR project will change for each environment, which seems like it would force me to duplicate that build tweaking each time I attempted to build the EAR as well.

All of that to say: is there a straightforward way to build the WAR and package that into this trivially-simple EAR? I’d like to avoid maintaining these as two separate projects, but would similarly prefer not to resort to an overly messy hack using assemblies to accomplish this.

  • 1 1 Answer
  • 1 View
  • 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-13T05:44:55+00:00Added an answer on May 13, 2026 at 5:44 am

    All of that to say: is there a straightforward way to build the WAR and package that into this trivially-simple EAR? I’d like to avoid maintaining these as two separate projects, but would similarly prefer not to resort to an overly messy hack using assemblies to accomplish this.

    Short answer: no, there is no simple maven-way to do that as this would go against a Maven rule which is “one artifact per project” (understand one output per project which is true in 99% of the cases).

    And actually, I would strongly recommend to not go the hacky way and forget using assemblies to create an EAR. Instead, create two modules, one with a packaging of type war, the other with a packaging of type ear depending on the war artifact and declare them as modules of a parent pom.xml. Like this:

    my-project
    |-- pom.xml       // packaging of type pom and my-war and my-ear as modules
    |-- my-war
    |   `-- pom.xml   // packaging of type war
    `-- my-ear
        `-- pom.xml   // packaging of type ear
    

    If you go for Maven, adopt Maven philosophy, don’t fight against it, it will save you lot of pain. Seriously, hacking assemblies to do what the maven-ear-plugin is already doing is just anti DRY. You’d better stick to Ant in that case.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need a return at the End of the function,… May 13, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer Another option would be Virtualbox. May 13, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer I'm no expert on web development, but it looks like… May 13, 2026 at 10:51 pm

Related Questions

Ok, so here's the situation. I'm working on a site that allows people to
I'm currently planning a new web project. Clients are going to connect using a
I have an interesting problem which I've been looking into and would appreciate some
I'm doing a full rewrite of an old library, and I'm not sure how
We have a button that saves asynchronously using AjaxToolKit/C#/.NET. I'm getting this in my

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.