Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

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

Avatar

Level 4

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

Avatar

Correct answer by
Employee Advisor

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

8 Replies

Avatar

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

Avatar

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

Avatar

Correct answer by
Employee Advisor

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

Avatar

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]

Avatar

Level 4
I couldn't find any solutions, I converted all felix to osgi

Avatar

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 ?

Avatar

Level 1

<artifactId>maven-scr-plugin</artifactId>
<version>1.26.4</version>

 

In the Pom.xml file, I changed 1.20.0 to 1.26.4, which solved the problem.