-1

When using the spring plugin for struts 2, is it possible to use the latest version of spring or are you stuck with the version referenced in the plugin? For example in my project I am using struts 2.3.16.3 and its spring plugin automatically uses spring 3.0.5 . So if I add spring 4.1 to my pom as a dependency then there are multiple versions of spring added to the classpath.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Spunog
  • 309
  • 3
  • 11

1 Answers1

0

You shouldn't have more than one Spring library in your classpath - disaster will be bound to happen. I guess you can either exclude the spring dependency in that plugin or set its version to the one you want. The main problem with this approach is moving between major versions (3.x to 4.x) - if Spring is respecting Semantic Versioning incompatibilities will exist between the two versions and it is possible (or likely) that struts2-spring-plugin is using something that changed.

Edit: Comment below reports successful usage of struts2-spring-plugin and Spring4.

mmalmeida
  • 1,037
  • 9
  • 27
  • *don't think you'll have much luck using the current struts2-spring-plugin and Spring 4.* - they are working fine. – Aleksandr M Jul 10 '14 at 09:16
  • Excellent then. My comment still stands - if spring-plugin is using something that was removed in Spring version bump, and if you removed spring3's dependencies from your classpath, things will break. – mmalmeida Jul 10 '14 at 09:21
  • It isn't using *something that was removed*. – Aleksandr M Jul 10 '14 at 19:27
  • The plugin is just a plugin, if you change the framework you should change a plugin, check for plugin dependencies to define which framework is supported by your plugin. – Roman C Jul 11 '14 at 08:22
  • @AleksandrM - If you are sure the strut2-spring-plugin is not using any code that had been deprecated in Spring 3.X and removed in 4.X, then everything will work (and you can contribute to https://issues.apache.org/jira/browse/WW-4373). I meant that, as a general rule, if a something depends on version X of a dependency, you should proceed carefully when upgrading the dependency to Y to make sure things don't break. – mmalmeida Jul 11 '14 at 14:29
  • Yes, I saw that issue, but as Lukasz said the problem is in java versions. So there is not much to do, just a version bump. ;) – Aleksandr M Jul 11 '14 at 15:49