Is it possible to compile custom Jira Data center plugins with java 11 or higher?

Hello,

We have several custom Jira Data Center plugins that compile and work fine with java 8.

When trying to build them with java 11 using AMPS 6.2.1 , we get :

Generating a manifest for this plugin using maven-bundle-plugin v2.5.3

java.lang.NullPointerException

java.lang.NullPointerException
	at aQute.bnd.osgi.Processor.quote(Processor.java:1322)
	at aQute.bnd.header.Attrs.append(Attrs.java:404)
	at aQute.bnd.header.Parameters.append(Parameters.java:172)
	at aQute.bnd.header.Parameters.toString(Parameters.java:161)
	at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:719)
	at org.apache.felix.bundleplugin.ManifestPlugin.getAnalyzer(ManifestPlugin.java:213)
	at org.apache.felix.bundleplugin.ManifestPlugin.getManifest(ManifestPlugin.java:114)
	at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:69)
	at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:294)
	at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:285)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
	at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojoImpl(MojoExecutor.java:172)
	at org.twdata.maven.mojoexecutor.MojoExecutor$ExecutionEnvironmentM3.executeMojo(MojoExecutor.java:476)
	at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo(MojoExecutor.java:75)
	at com.atlassian.maven.plugins.amps.MavenGoals.generateBundleManifest(MavenGoals.java:1527)
	at com.atlassian.maven.plugins.amps.osgi.GenerateManifestMojo.execute(GenerateManifestMojo.java:71)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
	at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
	at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
	at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)

Moreover, when installing plugins compiled with java 11+, we get the following error:

com.atlassian.plugin.osgi.container.OsgiContainerException: Unable to install bundle
at com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager.installBundle(FelixOsgiContainerManager.java:474)

Does anyone know if custom plugins can be safely built with java 11 or higher, and if there are any guidelines or requirements to make it work ?

Thank you in advance for your answers.

First of all, take a look at your pom.xml and align your dependency version:

  • jira.version (e.g. 10.3.0)
  • amps.version (e.g. 9.2.1)
  • maven.compiler.source (e.g. 17)

The versions should be aligned with the supported platforms of the application version ( Supported platforms | Administering Jira applications Data Center 10.3 | Atlassian Documentation ). For example if the target is Jira 10 then you should compile against Java 17.

Then depending on what your app is extending (e.g. REST Endpoints, etc) further alignments are needed. And potentially as well APIs that must be updated.

But overall, yes you can compile a custom plugin against Java 11 or higher.

Thanks for your reply . I had found this article https://support.atlassian.com/atlassian-knowledge-base/kb/using-jdk-11-to-develop-apps-with-the-atlassian-sdk-is-not-yet-supported/ , and that’s why I was wondering if it was possible to compile plugin in Java 11 and higher