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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:44:53+00:00 2026-06-05T18:44:53+00:00

I have a maven3 webapp (war) project that has 2 dependencies. One is a

  • 0

I have a maven3 webapp (war) project that has 2 dependencies. One is a jar (ehcache) and the other a war dependency (a 3rd party lib that I have no control over).

The 3rd party war dependency has a dependency on much earlier version of ehcache which is clashing with the later version I need to use.

The following steps occur during a package of my app.

  1. My ehcache jar is copied to /WEB-INF/lib/
  2. The .war dependency which also includes ehcache is built and overlaid on top of my target
  3. Final .war file is created from target

No matter what I do, the war always includes the earlier version of ehcache. I’ve even tried writing an ant script which I execute via maven-antrun-plugin that removes the .jar file from the target directory. However, this always gets done before the .war dependency is overlaid.

Does anyone know how I can exclude/remove the earlier version of ehcache?

  • 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-05T18:44:56+00:00Added an answer on June 5, 2026 at 6:44 pm

    You’ll probably need to exclude the ehcache jar by filename from your overlay. If you aren’t already declaring an explicit overlay for your dependent war, you’ll have to do that too in the war plugin configuration:

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.2</version>
          <configuration>
            <overlays>
              <overlay>
                <groupId>your.thirdparty.war.groupId</groupId>
                <artifactId>your.thirdparty.war.artifactId</artifactId>
                <excludes>
                  <exclude>WEB-INF/lib/ehcache*.jar</exclude>
                </excludes>
              </overlay>
            </overlays>
          </configuration>
        </plugin>
      </plugins>
    </build>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the third party jar's in my WEB project placed at /src/main/webapp/WEB-INF/lib/ I
I have a really simple webapp project with maven and jetty that has been
I have a maven project that has a set of library dependancies that are
I have a Maven project that is packaged as jar . And I also
So, I have a war project with several dependent jars that are not available
I have a maven war project which produces webapp.war, and a maven 'skin' project
I currently have a project built with maven-archetype-webapp artifact. The default packaging for this
So our new webapp project is based on maven. I'm really liking the dependency
I have a maven project where I am building a war file, but I
Situation is pretty straightforward. I have a Java webapp that I'm converting to be

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.