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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:50:11+00:00 2026-05-15T01:50:11+00:00

In my project , there is a spring XML config that utilizes ehcache to

  • 0

In my project , there is a spring XML config that utilizes ehcache to cache method returns.

xml snippet :

    http://www.springmodules.org/schema/ehcache http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd

  <ehcache:config configLocation="classpath:ehcache.xml"/>

  <ehcache:proxy id="explainRetriever" refId="explainRetrieverImpl">
    <ehcache:caching methodName="get*" cacheName="explainCache"/>
  </ehcache:proxy>

but in runtime , server complains it cannot find definitions of http://www.springmodules.org/schema/ehcache , I know I have to add “spring-modules-cache.jar” to WEB-INF/lib directory.

But my project is maintained by maven , if I add “spring-modules-cache” to the runtime dependency , it will bring a lot of dependencies to my WAR file , filling my WAR with a lot of unnecessary jars. I just need one declaration in it , not all of its dependencies …

Is there any way to tell maven not to include its dependencies to the project ?

Or … another way , when packaging WAR , just copy another prepared spring-modules-cache.jar to WEB-INF/lib , how to do this ? Thanks !

  • 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-15T01:50:12+00:00Added an answer on May 15, 2026 at 1:50 am

    As mentioned, you can use the exclusions mechanism, but that basically means excluding every runtime dependency declared in the dependency’s pom, which is not only a pain, but fragile, since you have to keep tracking the dependency’s pom to keep your list of exclusions up to date.

    An alternative is to mark the dependency as <scope>provided</scope> and then copy the dependency yourself to the war construction directory under ‘target’ using the dependency:copy plugin goal. By default a war is built in
    ${project.build.directory}/${project.build.finalName}. See the war plugin for details.

    E.g.

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy</id>
                <phase>package</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.springmodules</groupId>
                      <artifactId>spring-modules-cache</artifactId>
                      <version>0.8</version>
                      <type>jar</type>
                      <overWrite>true</overWrite>
                      <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project that makes extensive use of XML config files,
I have this Spring XML: <!-- Configure the authentication --> <security:http auto-config=true use-expressions=true> <security:form-login
I am using Spring with Hibernate in my project.There are many methods written in
In my project there are some 'Prototype' factories that create instances by cloning a
Is there a jQuery project out there, that create on of these Password-strength-meters right
So I'm working on a project where there are tasks that make up a
I am working on a personal project that uses a custom config file. The
I'm using Eclipse to work on a Spring project that is controlled via Maven
I'm trying to get spring-security to work with a project where there is both
I have an existing application that exists as multiple Spring projects. Project A's Spring

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.