akhikhl / gretty

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

No signature of method: static org.akhikhl.gretty.ProjectUtils.getClassPath() #429

Open tahakonuk opened 6 years ago

tahakonuk commented 6 years ago

Hello, I'm using default gradle wrapper in Intellij IDEA CE 2018.1

When I start the appStart task of gretty I get the error :

Caused by: groovy.lang.MissingMethodException: No signature of method: static org.akhikhl.gretty.ProjectUtils.getClassPath() is applicable for argument types: (org.gradle.api.internal.project.DefaultProject_Decorated, null, java.lang.String) values: [project ':myProject', null, runtime]

My projects directory structure is different from the default one expected by gradle. I checked the gretty source code and the exception comes from;

gretty/libs/gretty/src/main/groovy/org/akhikhl/gretty/StartBaseTask.groovy:212

resolvedClassPath.addAll(ProjectUtils.getClassPath(proj, wconfig.inplace, runtimeConfig))

The wconfig.inplace part returns null. Do I need to set something in my build.gradle or is this a bug? Contents of my file:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.akhikhl.gretty:gretty:+'
    }
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'ear'
apply plugin: 'org.akhikhl.gretty'

repositories {
    jcenter()

    flatDir {
        dirs '../Libs'
    }
}

sourceSets {
    main {
        java {
            srcDirs = ["src"]
        }

        resources {
            srcDir 'WebContent/resources'
        }
    }

    test{
        java {
            srcDirs=["test"]
        }
    }
}

dependencies {
    compile 'javax.servlet:javax.servlet-api:3.1.0'

    testCompile 'junit:junit:4.12'

    compile 'junit:junit:4.12'
    // more dependencies...
}

gretty {
    httpPort = 8080
    contextPath = '/myProject'
    servletContainer = 'jetty9'
    webAppDirName = '/WebContent'
}

Thanks in advance

yalcincosar commented 2 years ago

Hi, it's been a long time since this problem, but I still want to suggest a solution. Changing the system language to english was the solution for me.

tahakonuk commented 2 years ago

Thank you @fyalcincosar. I can't remember but my system language may not be English at that time.

oguzhanfiliz commented 8 months ago

thank you @yalcincosar . this solved my problem.