Apache Felix SCR Plugin Compatibility Chart

Published on by Dan KlcoPicture of Me Dan Klco

One of the issues I've run into during the past when setting up AEM / CQ5 projects is incompatibility between the various versions of the Apache Felix SCR Annotations and the Apache Felix Maven SCR Plugin.

Usually, when this occurs, you will see an error like this when building the project:

[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.20.0:scr (generate-scr-descriptor) on project felix-annotation-test-bundle: Please use org.apache.felix:org.apache.felix.scr.annotations version 1.9.0 or newer. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-scr-plugin:1.20.0:scr (generate-scr-descriptor) on project felix-annotation-test-bundle: Please use org.apache.felix:org.apache.felix.scr.annotations version 1.9.0 or newer.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Please use org.apache.felix:org.apache.felix.scr.annotations version 1.9.0 or newer.
	at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.assertMinScrAnnotationArtifactVersion(SCRDescriptorMojo.java:388)
	at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.getClassPath(SCRDescriptorMojo.java:348)
	at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:206)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 19 more
[ERROR] 

or

[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.4.0:scr (generate-scr-descriptor) on project felix-annotation-test-bundle: Execution generate-scr-descriptor of goal org.apache.felix:maven-scr-plugin:1.4.0:scr failed: 0 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-scr-plugin:1.4.0:scr (generate-scr-descriptor) on project felix-annotation-test-bundle: Execution generate-scr-descriptor of goal org.apache.felix:maven-scr-plugin:1.4.0:scr failed: 0
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-scr-descriptor of goal org.apache.felix:maven-scr-plugin:1.4.0:scr failed: 0
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 19 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
	at org.apache.felix.scrplugin.tags.JavaClassDescriptorManager.getSourceDescriptions(JavaClassDescriptorManager.java:393)
	at org.apache.felix.scrplugin.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:167)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	... 20 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

After several frustrating instances of manually changing the Apache Felix SCR Annotations and Apache Felix Maven SCR Plugin versions until I got them to work, I decided to systematically test which versions of the two libraries are compatible.

To do this, I created a project with a simple OSGi Service and Sling Servlet created with placeholders for the versions of Apache Felix SCR Annotations and Apache Felix Maven SCR Plugin. I then iterated through the versions and tested to ensure that the project built, was deployed to Apache Felix and that the servlet responded correctly.

If you'd like to check out the method or project, please feel free to check it out from GitHub.

Compatibility

Below you can find a table of the compatible versions of the Apache Felix SCR Annotations and Apache Felix Maven SCR Plugin:

maven-scr-plugin Versions
org.apache.felix.scr.annotations Versions 1.21.01.20.01.19.01.17.01.16.01.15.01.14.01.13.01.12.01.11.01.10.01.9.01.8.01.7.41.7.21.7.01.6.01.4.41.4.21.4.0
1.9.12TTTTTTTTTTFTTFFFFTTF
1.9.10TTTTTTTTTTFTTFFFFTTF
1.9.8TTTTTTFTTTFTTFFFFTTF
1.9.6TTTTTTTTTTFTTFFFFTTF
1.9.4TTTTTTTTTTFTTFFFFTTF
1.9.2TTTTTTTTTTFTTFFFFTTF
1.9.0TFTTTTTTTTFTTFFFFTTF
1.8.0FFFFFFFFFFFTTFFFFTTF
1.7.0FFFFFFFFFFFTTFFFFTTF
1.6.0FFFFFFFFFFFFFTTFFTTF
1.5.0FFFFFFFFFFFFFFFFFTTF
1.4.0FFFFFFFFFFFFFFFTTTTF
1.3.0FFFFFFFFFFFFFFFFFTTF
1.2.0FFFFFFFFFFFFFFFFFTTF
1.0.0FFFFFFFFFFFFFFFFFTTF
0.9.0FFFFFFFFFFFFFFFFFTTF


Tags


comments powered by Disqus