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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:59:33+00:00 2026-05-12T08:59:33+00:00

Is it possible to build multiple artifacts in a single POM file? It is

  • 0

Is it possible to build multiple artifacts in a single POM file? It is not about building multiple assemblies but the artifacts have different builds and dependencies but refer the same source.

For e.g. one artifact I need to build is a WAR file which excludes certain AspectJ files from the build and the other is a JAR file which needs those Aspects to be weaved during the build.

Right now, I have 2 pom.xml’s which run on 2 copies of the same source to produce the desired artifacts. Can this be done in a single POM?

  • 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-12T08:59:34+00:00Added an answer on May 12, 2026 at 8:59 am

    It is generally bad practice to try to do what you’re after, though it could be done with profiles and assemblies I would recommend against it.

    This is how I would approach it.

    Separate the code into a jar project and configure the jar project to use the aspectj compiler plugin. Make the war project have a dependency on the jar project and the jar project have a dependency on aspectjrt. The jar dependencies you want to exclude can be specified as scope “provided” so they will not be included in the build or excluded by configuring the jar dependency to exclude those transitive dependencies (see the Transitive Dependency Exclusion section of the Dependency Mechanism documentation for details.

    When the war is built, any compile-scoped dependencies (and their transitive dependencies) will be bundled into the war’s WEB-INF/lib directory (i.e. aspectjrt will be included as well).

    If you need to build both projects at once define an aggregator pom and specify both the jar and war projects as modules.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here's a way to check for overflow (which is actually… May 12, 2026 at 12:27 pm
  • Editorial Team
    Editorial Team added an answer Try something like this: public class MenuItemViewModel { public MenuItemViewModel()… May 12, 2026 at 12:27 pm
  • Editorial Team
    Editorial Team added an answer I've update the answer you linked to with more comprehensive… May 12, 2026 at 12:27 pm

Related Questions

After googling and landing on SO and having read this other question Is it
My development machine is a quad core system, but I just ran into (
Kind of like this question I have many text snippets that I use many,
Is it possible to use a MultiTrigger to evaluate properties on multiple elements? That
Is it possible to ignore external dependencies for a tag referenced in an svn:externals

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.