Alfresco SDK 4.0 build AMP fails on Java 11

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Vic
Active Member

Alfresco SDK 4.0 build AMP fails on Java 11

Hi folks, I'm facing a problem when trying to build an AMP in SDK 4.0. I've created AIO project from archetype, followed instructions to enable AMP assembly.

My environment is Maven 3.5.4, Open JDK 11.

With the default assembly plugin configuration (provided by SDK) I receive the following error:

INFO] --- maven-assembly-plugin:2.6:single (build-amp-file) @ alfresco-platform ---
[INFO] Reading assembly descriptor: src/main/assembly/amp.xml
[WARNING] Error injecting: org.alfresco.maven.plugin.archiver.AmpArchiver
java.lang.ExceptionInInitializerError
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance (Constructor.java:490)
....
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    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)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
    at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.<clinit> (AbstractZipArchiver.java:123)
 ...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO]  1.0-SNAPSHOT ...................................... SUCCESS [  0.455 s]
[INFO] Alfresco Platform/Repository JAR Module ............ FAILURE [  6.196 s]
[INFO] Alfresco Share JAR Module .......................... SKIPPED
[INFO] Integration Tests Module ........................... SKIPPED
[INFO] Alfresco Platform/Repository Docker Module ......... SKIPPED
[INFO] Alfresco Share Docker Module 1.0-SNAPSHOT .......... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.805 s
[INFO] Finished at: 2019-10-28T12:38:55+06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single (build-amp-file) on project alfresco-platform: Execution build-amp-file of goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-assembly-plugin:2.6:single: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------

This only happens with Java 11, when switching to Java 8 - build completes successfully, but using Java 8 is not an option for me. The only way I got it working under Java 11 is when I've removed alfresco-maven-plugin from dependencies and changed format to zip in amp.xml assembly descriptor.

Does anyone else faced such an issue or knows how to solve it?