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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:41:32+00:00 2026-05-13T11:41:32+00:00

What’s the best way to setup Maven for a project that has a SmartClient

  • 0

What’s the best way to setup Maven for a project that has a SmartClient architecture? Consider the following packages:

  • myproject.core
  • myproject.server
  • myproject.client

Of course there are several sub-packages in each. Client and Server both use core. I see two main options:

  1. Make an uber-POM in myproject to cover all three and have some sort of build parameter to identify what to build.
  2. Make a POM in each package above (one for core, another for server and another for client).

Here are the outputs we need to build (at a minimum):

  • Standalone.jar: A test application that will launch the server and a client.
  • Server.war: A WAR file that can be deployed to Tomcat.
  • Client.jar: The SmartClient without any server code.

Is option #1 even possible? If so, is it good practice? From my initial research, option #2 sounds like best practice. However, jumping from POM to POM when all the code is intimately related sounds like extra work and extra clutter we may not need. Should I just stick with option #2?

  • 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-13T11:41:32+00:00Added an answer on May 13, 2026 at 11:41 am

    Maven has a general rule that there should be only a single artifact per project. In other words, option #1 wouldn’t allow you to produce a server.war, a client.jar, etc without fighting against maven. This would be a big mess and you wouldn’t be able to take advantage of maven plugins. No, really, you don’t want this. So just go for option #2, with a structure like (omitting the src directory):

    .
    |-- core
    |   `-- pom.xml
    |-- server
    |   `-- pom.xml
    |-- client
    |   `-- pom.xml
    `-- pom.xml
    

    Regarding your concern about jumping from POM to POM, well, just import all modules into your IDE and you won’t really notice it. This just works pretty well for lots of people.

    UPDATE (to cover questions from the OP in comments):

    Fighting against Maven doesn’t sound fun.

    No, and you will loose 🙂

    What is in the pom.xml at the root level?

    This is a parent POM used for Project Aggregation. Quoting the Introduction to the POM document:

    Project Aggregation is similar to
    Project Inheritance. But instead of
    specifying the parent POM from the
    module, it specifies the modules from
    the parent POM. By doing so, the
    parent project now knows its modules,
    and if a Maven command is invoked
    against the parent project, that Maven
    command will then be executed to the
    parent’s modules as well. To do
    Project Aggregation, you must do the
    following:

    • Change the parent POMs packaging to the value “pom” .
    • Specify in the parent POM the directories of its modules (children
      POMs)

    Project aggregation and project inheritance are often used together. Refer to the mentioned document for more details.

    By “single artifact per project” do you mean that there should be a separate POM for Standalone.jar, Server.war, and Client.jar (three total POMs)?

    Yes, this is what I mean, one project generates one artifact (there are some exceptions but this is true 99% of the time). This is a maven best practice that you should (must?) follow.

    What if I also want a Server.jar, a simple server based with Grizzly included? Wouldn’t server need two POM’s?

    I think that the maven way to handle this would be to use assemblies and there is no unique answer to your question (this might be one of the exception to the rule mentioned above). But this won’t prevent you from starting.

    Also, how would one kick off a build that would result in all three artifacts getting produced?

    Launch your maven command from an aggregating project as we saw (aka “multi-modules build”).

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

Sidebar

Related Questions

No related questions found

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.