Details
Description
A NullPointerException is raising by generating the AAR files using the maven2 plugin axis2-aar-maven-plugin. The exception will raise if no FileSet is configured. If there is a FileSet specified in the configuration the plugin works as expected.
Example of a maven2 plugin configuration that will raise the exception:
<build>
<plugins>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-aar-maven-plugin</artifactId>
<version>1.5.4</version>
<extensions>true</extensions>
<configuration>
<outputDirectory>${basedir}/dist</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
Exception:
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.apache.axis2:axis2-aar-maven-plugin:1.5.4:aar': Mojo execution failed.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:505)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:904)
at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
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:408)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
Caused by: org.apache.maven.plugin.PluginExecutionException: Mojo execution failed.
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:601)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
... 20 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Error assembling aar
at org.apache.axis2.maven2.aar.AarMojo.execute(AarMojo.java:106)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:579)
... 21 more
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.util.DirectoryScanner.setIncludes(DirectoryScanner.java:474)
at org.apache.axis2.maven2.aar.AbstractAarMojo.copyFileSet(AbstractAarMojo.java:279)
at org.apache.axis2.maven2.aar.AbstractAarMojo.buildExplodedAar(AbstractAarMojo.java:151)
at org.apache.axis2.maven2.aar.AarMojo.performPackaging(AarMojo.java:125)
at org.apache.axis2.maven2.aar.AarMojo.execute(AarMojo.java:103)
... 22 more
Example of a maven2 plugin configuration that will work:
<build>
<plugins>
<!-- Create the aar file (the web service archive) -->
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-aar-maven-plugin</artifactId>
<version>1.5.4</version>
<extensions>true</extensions>
<configuration>
<outputDirectory>${basedir}/dist</outputDirectory>
<fileSets>
<fileSet>
<includes>
<include>SOMEFILE</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</plugin>
</plugins>
</build>