serenity-bdd / serenity-maven-plugin

19 stars 21 forks source link

Execution default-cli of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.64:aggregate failed.: NullPoint erException #71

Closed centu81 closed 5 years ago

centu81 commented 5 years ago

Reproduce: Run: mvn serenity:aggregate -Dsysinfo.build=1.0.1

Result: null pointer

Investigation results and question

  1. mvn serenity:aggregate -Dsysinfo.build=1.0.1 -Dbuild=1.0.1 - it works ok.
  2. Issue is in BuildInfoProvider that forces to have for all sysinfo.* to have other variable without sysinfo, if not there will be null pointer exception.
String expression = (String)EnvironmentSpecificConfiguration.from(this.environmentVariables).getOptionalProperty(simplifiedKey).orElse((Object)null);

String value = this.isGroovyExpression(expression) ? this.evaluateGroovyExpression(key, expression) : expression;

Is it expected to work like that, what is the reason behind. In the release notes I could not find anything about that.

Jacobvu84 commented 5 years ago

It should work with 2.0.65

wakaleo commented 5 years ago

Fixed in 2.0.65

centu81 commented 5 years ago

I checked and still the same. Execution default-cli of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.65:aggregate failed.: NullPoint erException

wakaleo commented 5 years ago

Do you have a stack trace?

centu81 commented 5 years ago
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.65:aggregate (default-cli) on project classification-helper-bdd: Execution default-cli of goal net.serenity-bdd.maven.plugins:serenity-
maven-plugin:2.0.65:aggregate failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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:498)
    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-cli of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.65:aggregate failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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:498)
    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: java.lang.NullPointerException
    at net.serenitybdd.core.buildinfo.BuildInfoProvider.isGroovyExpression (BuildInfoProvider.java:101)
    at net.serenitybdd.core.buildinfo.BuildInfoProvider.addCustomPropertiesTo (BuildInfoProvider.java:94)
    at net.serenitybdd.core.buildinfo.BuildInfoProvider.getBuildProperties (BuildInfoProvider.java:41)
    at net.thucydides.core.reports.html.FreemarkerContext.<init> (FreemarkerContext.java:58)
    at net.thucydides.core.reports.html.FreemarkerContext.<init> (FreemarkerContext.java:68)
    at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsIn (HtmlAggregateStoryReporter.java:151)
    at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsFrom (HtmlAggregateStoryReporter.java:135)
    at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.generateHtmlStoryReports (SerenityAggregatorMojo.java:243)
    at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.execute (SerenityAggregatorMojo.java:186)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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:498)
    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)
wakaleo commented 5 years ago

Could you try with 2.0.66?

centu81 commented 5 years ago

it works ok now.