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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:31:51+00:00 2026-06-04T20:31:51+00:00

I have a multi module web app building with maven. We build the war

  • 0

I have a multi module web app building with maven. We build the war as per normal and deploy and run on developer machines and local test servers using tomcat.

Then we want to deploy the application to the cloud. To do this we create a special version of tomcat which has all the libraries preloaded and a special version of the war which only has our code. Point here is tomcat is preloaded on the cloud server, the war is uploaded each time it is changed. Currently we are having to manually remove the dependencies from the built war.

What is the best way for maven to do this? Should I build a custom packaging type or maybe run some post build plugin to remove these wars? Or something else? I think the best way to activate this custom build is via a profile. I did try and remove these dependencies by setting them to scope = provided in the new profile but the transitive dependencies still made it into the war.

  • 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-04T20:31:54+00:00Added an answer on June 4, 2026 at 8:31 pm

    If you want to exclude all dependencies, you can use the war plugin’s packagingExcludes to do so:

        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
                ...
            </configuration>
        </plugin>
    

    Specify this plugin inside a profile to only perform it for production.

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

Sidebar

Related Questions

I have a multi-module Maven web app, and I want to run it in
We have a non-trivial multi-module maven project, then have a single module maven web-app
I'm trying to run a multi-module Maven web app in Eclipse (EE Helios SR
My usual practice is to have a single maven project (can be multi-module) per
I have a multi module maven web application, which uses hibernate. I use the
I have a multi-module maven project made up of three sub-modules: web , service
I have a multi-module Maven project that makes use of WAR overlays (stack of
I have a multi-module maven build that requires a profile to be activated only
I have a multi-module Maven project that is a Java web application. I am
I have a multi-module (maven) spring build. All the modules publish some beans, and

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.