saladinkzn / gretty

Advanced gradle plugin for running web-apps on jetty and tomcat.
MIT License
2 stars 2 forks source link

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':farmBeforeIntegrationTest' #21

Closed wcrowell closed 8 years ago

wcrowell commented 8 years ago

The build on May 29th might have broke the farmIntegrationTask:

…
:farmBeforeIntegrationTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':farmBeforeIntegrationTest'.
> Cannot get property 'file' on null object

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':farmBeforeIntegrationTest'.
…
Caused by: java.lang.NullPointerException: Cannot get property 'file' on null object
      at org.akhikhl.gretty.ProjectUtils.getFileFromConfiguration(ProjectUtils.groovy:166)
      at org.akhikhl.gretty.ProjectUtils$getFileFromConfiguration$7.callStatic(Unknown Source)
      at org.akhikhl.gretty.ProjectUtils.getDefaultWebAppConfigForMavenDependency(ProjectUtils.groovy:173)
      at org.akhikhl.gretty.ProjectUtils$getDefaultWebAppConfigForMavenDependency$6.call(Unknown Source)
      at org.akhikhl.gretty.FarmConfigurer.getWebAppConfigForMavenDependency(FarmConfigurer.groovy:69)
      at org.akhikhl.gretty.FarmConfigurer$_resolveWebAppRefs_closure7.doCall(FarmConfigurer.groovy:153)
      at org.akhikhl.gretty.FarmConfigurer.resolveWebAppRefs(FarmConfigurer.groovy:118)
      at org.akhikhl.gretty.FarmConfigurer$resolveWebAppRefs$4.call(Unknown Source)
      at org.akhikhl.gretty.FarmStartTask.getStartConfig(FarmStartTask.groovy:41)
      at org.akhikhl.gretty.FarmBeforeIntegrationTestTask_Decorated.getStartConfig(Unknown Source)
      at org.akhikhl.gretty.StartBaseTask.getLauncherConfig(StartBaseTask.groovy:141)
      at org.akhikhl.gretty.StartBaseTask.action(StartBaseTask.groovy:39)
…

I noticed org.akhikhl.gretty.ProjectUtils.groovy was modified on May 29th for this change:

4 added overlay support to farms #18

[(https://github.com/saladinkzn/gretty/pull/18/files)]

I reverted back to the 1.2.5 version of Gretty using the classPath attribute for webapp in my farm task and it works:

webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, classPath: ["${project.projectDir}/etc/jars/cas-server-support-rest-4.2.1.jar"]

This line fails with 1.2.6-SNAPSHOT of Gretty using dependencies with the exception above:

webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, dependencies: [ "org.jasig.cas:cas-server-support-rest:4.2.1" ]
saladinkzn commented 8 years ago

Yep, I confirm it.

I tryed too hard to prevent possible break with war in farm and made dependency case broken.

I'll publish a fix today

saladinkzn commented 8 years ago

I've published build that should resolve this issue. Feel free to comment if you found an issue in it.

wcrowell commented 8 years ago

That worked. You can close this issue. Thanks!!!!

saladinkzn commented 8 years ago

I'll add simple test in #24 to prevent this in future.