Task createWebappProject - How do I specify target folder

Hi All,

I am trying to create a webapp using createWebappProject task in eclipse, It is creating the app in eclipse installation folder rather than development workspace folder.

I have tried below program arguments , but it doesn’t work.
-PuseJettyPlugin=Y -PnewProjectName=“test111” -PprojectParentDir=“C:\task”

How do I supply the destination folder location ?

Thanks,
Vijay

Based on the name of the task and the arguments listed, I believe that you are trying to use the Gradle Templates Plugin by townsfolk. If this is not the case, it would be good to know what you are actually trying to use.

You mentioned that you are trying to run the task from Eclipse. Where are you specifying the arguments listed? Have you tried running the command line instead of from Eclipse?

Hi James,

Thanks for the response , Here are the details.

I am trying to create a WebApp in eclipse using townsfolk templates.

I’ve followed the below steps:

1)Configured townsfolk templates in init.gradle of user directory (…/.gradle)
2)Created sample gradle project in Eclipse…(TestApp)[I do not know If I can run any Gradle task directly without creating one Gradle project in Eclipse]
3)Right click on TestApp and RunAs->Gradle Build
4)In Arguments TAB I supplied below PROGRAM args.
-PuseJettyPlugin=Y -PnewProjectName=“test111” -PprojectParentDir=“C:\task”

Result: New WebApp “test111” got created in ROOT folder of eclipse instead of “C:\task”

Pls let me know if you need any further details…

Regards,
Vijay

It appears that the projectParentDir argument works fine in version 1.5 of the plugin, but it creates it in the Eclipse directory in earlier versions. The init.gradle method of installing the plugin hasn’t been updated and still applies version 1.3 of the plugin.

Since you are creating a sample project to be able to run Gradle tasks in Eclipse anyway, I wouldn’t worry about trying to create an init script that applies a newer version of the plugin. You don’t really get any benefit of being able to run the creation tasks from anywhere without a build.gradle file if you’re only running Gradle tasks from within Eclipse. It should work as expected if you add this to your sample project build.gradle file:

buildscript {
    repositories {
        maven {
            url 'http://dl.bintray.com/cjstehno/public'
        }
    }
    dependencies {
        classpath 'gradle-templates:gradle-templates:1.5'
    }
}

apply plugin:'templates'

Hi James,

Thank you so much for your help , This is working as expected…

Thanks again…

-Vijay