Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exclude the configuration file (.xml and package) from dependency jar in gradle spring project

In my spring project we are using web dependency contains a configuration applicationContext.xml and security-config.xml. I have to change on both of them in my application how can I achieve this.

I'm expecting like this

compile (librariesdependencyname) {
        exclude ('applicationContext.xml')
        exclude ('common-security-config.xml')
    }
like image 390
Araf Avatar asked Sep 16 '25 03:09

Araf


1 Answers

If your team handling the jar. Just ask them to creating new version and without this configuration and resource files

OR

You can modify the context loader loaction and patter like below

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:applicationContext.xml,classpath*:/**/*-config.xml</param-value>
    </context-param>
like image 176
Araf Avatar answered Sep 18 '25 16:09

Araf