1

I have a big project running on Eclipse that uses Struts, I want to upgrade Struts from 2.0.11.1 to 2.5.3.

However, I checked the Migration Guide but there was no info detailing what should really be removed, updated, added, etc..

I downloaded struts 2.5.3 and there are a lot of libraries, plugins, source files, etc..

My question is that can I upgrade Struts from 2.0.11.1 to 2.5.3 directly? If yes, then what should be changed and how will this be done? If no, kindly propose a solution.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Ahmad Hijazi
  • 635
  • 2
  • 9
  • 27
  • Welcome to Stack Overflow! I'm not sure if this question is appropriate for this site. Questions here should be reserved for questions related strictly to programming. – ImaginaryHuman072889 Oct 13 '17 at 11:10
  • Hi @ImaginaryHuman072889, thanks for your comment. However, I usually find a lot of similar questions here and the feedback is normal on them. If I can not ask here, then where? Thank you. – Ahmad Hijazi Oct 13 '17 at 11:30
  • I may be out of line then. This isn't my area of expertise so we can wait to see if someone else can provide an answer. – ImaginaryHuman072889 Oct 13 '17 at 11:34
  • Then kindly can I ask you to remove the -1 vote if you please :) ? @ImaginaryHuman072889 – Ahmad Hijazi Oct 13 '17 at 12:08
  • 1
    The question is too broad. Migrating across versions is covered in each version's release notes; jumping from 2.0 to 2.5 is a lot of versions to cover, and there are many changes to keep in mind. You may be better served by going from 2.0-2.1-2.2-2.3-2.5 (might be able to skip 2.4 if there even was one, I don't remember). – Dave Newton Oct 13 '17 at 15:41

1 Answers1

0

When you upgrade the version of Struts2, you have to update the libraries requires by your application to the target version. Each Struts2 release is supplied with the corresponding set of libraries in the lib folder that are compatible with the version of Struts. If you use maven to resolve and fetch the dependencies you should consider the artifact struts2-core.

<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>2.5.3</version>
</dependency>

It will fetch all required dependencies for this artifact, other dependencies, such as plugins you need to add separately. Use the same version targeted to plugins. For example to add a convention plugin use

<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-convention-plugin</artifactId>
    <version>2.5.3</version>
</dependency>

The targeted version number is 2.5.3, but it's possibly incompatible with the other features i.e. Hibernate and Spring which versions need to upgrade separately by adding corresponding artifacts to the dependencies.

And finally and most time consuming are changes to the source code of the project, update the configuration files according to newer DTDs, API changes, fix deprecations. For this purpose consider reading the release notes.

You can't upgrade Struts2 just changing the major version number.


Also see the example of developing a maven project: Create Struts 2 Web Application Using Maven To Manage Artifacts and To Build The Application.

Roman C
  • 49,761
  • 33
  • 66
  • 176