Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

shajiahmed
Level 3
Level 3

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?

1 Accepted Solution
Jörg_Hoh
Correct answer by
Employee
Employee

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

View solution in original post

6 Replies
asutosh_jena
Community Advisor
Community Advisor

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

shail860510
Level 1
Level 1

Hi , I am trying to build AEM modernization tool code base and facing similar issue. I tried the steps you suggested but this error "  Failed to execute goal org.apache.felix:maven-scr-plugin:1.26.4:scr (generate-scr-scrdescriptor) on project aem-modernize-tools: SCR Descriptor parsing had failures (see log)" . 

 

Any leads or pointers will be very helpful

Jörg_Hoh
Correct answer by
Employee
Employee

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

View solution in original post

shail860510
Level 1
Level 1
get the following error: [ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.20.0:scr (generate-scr-scrdescriptor) on project osgi-annotation-demo.core: 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 -> [Help 1]
shajiahmed
Level 3
Level 3
I couldn't find any solutions, I converted all felix to osgi
shail860510
Level 1
Level 1
I am getting the same error while building the AEM modernization tools code base in AEM SDK for cloud service using java sdk 11, Any pointers to resolve this issue ?