JettyRun and webAppSourceDirectory

Im trying to run a the java web application that my company is building offsite, I run gradle JettyRun in the functional-tests directory and got the error ,

  • What went wrong: A problem was found with the configuration of task ‘:functional-tests:jettyRun’. > Directory ‘C:\git\open-lmis\functional-tests\src\main\webapp’ specified for property ‘webAppSourceDirectory’ does not exist.

This thing is I can’t see the task ‘functional-tests:jettyRun’ in the build.gradle file below located in the functional-tests directory.

< apply plugin: ‘jetty’

dependencies {

compile ‘org.testng:testng:6.1.1’,

‘org.seleniumhq.selenium:selenium-java:2.25.0’,

‘org.seleniumhq.selenium:selenium-firefox-driver:2.25.0’,

‘net.sf.json-lib:json-lib:0.9’,

‘postgresql:postgresql:9.0-801.jdbc4’,

project(‘:modules:db’)

testCompile ‘org.springframework:spring-test:3.1.1.RELEASE’,

‘org.testng:testng:6.1.1’,

‘org.seleniumhq.selenium:selenium-java:2.25.0’,

'org.seleniumhq.selenium:selenium-firefox-driver:2.25.0 ',

‘net.sf.json-lib:json-lib:0.9’,

‘postgresql:postgresql:9.0-801.jdbc4’,

project(‘:modules:db’) }

test {

exclude ‘**/org/openlmis/functional/.’ }

task buildOpenLmis(type: GradleBuild) {

buildFile = ‘…/modules/openlmis-web/build.gradle’

tasks = [‘build’, ‘jettyRunWarDaemon’] }

task functionalTest(type: Test, dependsOn: test) {

include ‘**/org/openlmis/functional/.

useTestNG() }

functionalTest.doFirst() {

buildOpenLmis.execute() }

please help.

The “jettyRun” task has a property “webAppSourceDirectory” which appears to default to your projects root directory plus “src\main\webapp”.

You can specify a different directory using :

jettyRun.webAppSourceDirectory = file("webapp")

Also the ‘:functional-tests:jettyRun’ means the subproject ‘functional-tests’ is having the problem with it’s ‘jettyRun’ task. You might need to look in the build.gradle file under your functional-tests directory to find the task in question.

Thanks Tye , I will make the necessary changes …