Maven error in moving code from java 8 to 11 in AEM 6.5

Avatar

Avatar
Give Back 5
Level 2
shajiahmed
Level 2

Likes

5 likes

Total Posts

54 posts

Correct reply

3 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile

Avatar
Give Back 5
Level 2
shajiahmed
Level 2

Likes

5 likes

Total Posts

54 posts

Correct reply

3 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 5
Ignite 3
View profile
shajiahmed
Level 2

16-04-2021

I see this error moving from java 8 to 11 in AEM 6.5. Execution generate-scr-scrdescriptor of goal org.apache.felix:maven-scr-plugin:1.20.0:scr failed: org.apache.felix.scrplugin.annotations.AnnotationProcessor is not an ImageIO SPI class?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

18-04-2021

The Felix SCR plugin only supports the proprietary Felix SCR annotations, but not the recommended OSGI annotations. That's the reason why this plugin is abandoned and does not receive further updates. Potentially its latest version supports Java 11, but you should switch to OSGI annotations.

(The old annotations are still supported on AEM 6.5 and IIRC still on AEM CS, but it's definitely a dead end.)

 

Jörg

Answers (1)

Answers (1)

Avatar

Avatar
Applaud 25
Level 10
asutosh_jena
Level 10

Likes

593 likes

Total Posts

705 posts

Correct reply

207 solutions
Top badges earned
Applaud 25
Give Back 100
Boost 500
Affirm 100
Ignite 1
View profile

Avatar
Applaud 25
Level 10
asutosh_jena
Level 10

Likes

593 likes

Total Posts

705 posts

Correct reply

207 solutions
Top badges earned
Applaud 25
Give Back 100
Boost 500
Affirm 100
Ignite 1
View profile
asutosh_jena
Level 10

16-04-2021

Hi @shajiahmed 

 

By moving to Java 11, the class files that you create will be compiled to Java 11 byte code. The maven-scr-plugin then has to scan this byte code to find the annotations that are applied to it.

 

Your current version of maven-scr-plugin (1.20.0) does not support on Java 11 and you will need to find the maven-scr-plugin that supports Java 11.

The latest maven-scr-plugin as of today is 1.26.4 and it could be possible that this latest version of the plugin has support for Java 11.

https://mvnrepository.com/artifact/org.apache.felix/maven-scr-plugin/1.26.4

 

The other option will be to start using the maven-bundle-plugin and the standard Declarative Services annotations instead of the Custom Felix annotations. Note that this would still involve updating those plugins to versions which can support Java 11. I personally using maven-bundle-plugin version 4.2.0 with Java 11 and it works perfectly fine.

 

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.2.0</version>
</plugin>

Note: This would still involve updating some of the plugins to versions which can support Java 11.

 

Hope this helps!

Thanks