federkasten / appbundle-maven-plugin

Maven plugin that creates an Application Bundle for OS X containing all your project dependencies and the necessary metadata
Apache License 2.0
179 stars 56 forks source link

NPE with version 1.2.0 #41

Closed thierrylach closed 6 years ago

thierrylach commented 6 years ago

I am getting a NPE. Configuration: plugin> groupId>sh.tak.appbundler artifactId>appbundle-maven-plugin version>1.2.0 configuration> mainClass>redacted jvmVersion>1.8+ jvmOptions> /jvmOptions> /configuration> executions> execution> phase>package goals> goal>bundle /goals> /execution> /executions> /plugin>

and the stack trace is:

[ERROR] Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (default) on project nag-osx-tbwa: Execution default of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed. NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (default) on project nag-osx-tbwa: Execution default of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed. 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:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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:497) 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 default of goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more Caused by: java.lang.NullPointerException at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1071) at sh.tak.appbundler.CreateApplicationBundleMojo.copyDependencies(CreateApplicationBundleMojo.java:514) at sh.tak.appbundler.CreateApplicationBundleMojo.execute(CreateApplicationBundleMojo.java:338) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ... 21 more

I see it is trying to copy something. What am I missing?

thierrylach commented 6 years ago

My own mistake.

ghost commented 6 years ago

Hi, i get the same error. Caused by: java.lang.NullPointerException at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1071) What was your mistake? Thanks Michael

stevekew commented 5 years ago

For interest, and anyone else getting this error in the future, I had the same problem and it was because I was trying to run the appbundle:bundle goal on it's own and not as a part of the package phase. I was trying to run it in IntelliJ IDEA by double clicking the goal.

The fix was to run it as instructed on the command line: mvn package appbundle:bundle

archanakhambe commented 5 years ago

I am trying to execute this on windows machine.I am still getting this exception any suggestions?