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

Time:03-26

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')
    }

CodePudding user response:

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>
  • Related