As I am trying to upgrade from AEM 6.1 to AEM 6.4, I need to change the extension of all the classes from WCMUse to WCMUsePojo. Have added the required dependency in the projects parent pom.xml as well :
But I am getting the following error during the maven build of the project:
[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr (generate-scr-descriptor) on project abcd: Execution generate-scr-descriptor of goal org.apache.felix:maven-scr-plugin:1.7.4:scr failed: An API incompatibility was encountered while executing org.apache.felix:maven-scr-plugin:1.7.4:scr: java.lang.VerifyError: Constructor must call super() or this() before return
Is maven-scr-plugin:1.7.4 generated by archetype 11 or is it carried over from your 6.1 pom.xml?
A best practice - It’s recommended to place Uber jar at the bottom of the dependency list so that Maven will honor any newer versions of dependencies that is explicitly declared inside the project POM.
If you plan to keep SCR annotations in 6.4 then update the jar versions. e.g. try using 1.20.0 or above for maven-scr-plugin and 1.9.0 for scr-annotations. Similar approach goes for compile time dependencies/plugins like 'servlet-api' etc.
A clean & time saving approach would be to use maven archetype and create a new project from scratch if that's feasible.
You could also choose a hit n trial approach - create a reference project using maven archetype and then utilize specific jar/versions into your existing project as required.
As Nirmal mentioned above, if you plan to utilize OSGI annotations, then update osgi related artifacts & versions.