How to override spring frame version in spring batch?

I am starting a new project with Spring Batch 2.1.6.RELEASE and I am using Maven to control depemdency.

By default, it imports Spring framework 2.5.6, but instead I would like to use 3.0.5.RELEASE.

This post says it is compatible, but I don't know how to declare it in my maven maven file.

I tried to just put dependencies for spring -core, spring-beans and spring-contextual versions 3.0.5.RELEASE, but this adds libraries to the project without removing the 2.5.6 version.

I looked at the spring -batch-parent pom file, and there is a profile called spring3 that uses the version of Spring that I want. How to activate profile in pom project file?

Thanks in advance,

Philip

+3
source share
1 answer

You can exclude the transition dependency on Spring Framework v2.5.6 from Spring Batch using the exclusions dependency element . spring-batch dependencies in maven. Sort of...

<dependency>
  <groupId>org.springframework.batch</groupId>
  <artifactId>spring-batch-core</artifactId>
  <version>2.1.6.RELEASE</version>
  <exclusions>
    <exclusion>
      <groupId>org.springframework</groupId> 
      <artifactId>spring-beans</artifactId> 
    </exclusion>
    <!-- Other exclusions here -->
  </exclusions> 
</dependency>
+5
source

Source: https://habr.com/ru/post/1790949/


All Articles