Gradle Could not create service of type InitScriptHandler using BuildScopeServices.createInitScriptHandler()

后端 未结 22 1881
囚心锁ツ
囚心锁ツ 2020-12-05 03:39

I used gradle build command in Centos 7 terminal and I got output:

FAILURE: Build failed with an exception.

* What we         


        
相关标签:
22条回答
  • 2020-12-05 04:40

    You Just Have to Run it under the super user (sudo ....) it works for me

    0 讨论(0)
  • 2020-12-05 04:41

    If you run Docker-in-Docker and mount the project directory from docker host directly to docker container:

    -v ${PWD}:/path_to_project -w /path_to_project

    the owners are different and docker container user (either gradle or root) can't override/delete ./buildSrc/build or ./build/

    One of the fixes - copy the sources inside the container to temporary directory and build there.

    Smth like this (first mounted to project, but then copied to project-copy to "decouple" with the host system real files and run the build in the copy):

    docker run -v "${PWD}":/home/gradle/project -w /home/gradle/project-copy \
        --rm \
        --entrypoint sh \
        gradle:5.5.1-jdk11 \
        -- -c "cp -r -T /home/gradle/project ./  &&  ./gradlew build"
    
    0 讨论(0)
  • 2020-12-05 04:42

    For me this was to do with Java versions. I have Java 10 installed and as the default Java on my system. Setting a JAVA_HOME pointing at Java 8 was sufficient for the project (graphql-spring-boot) to build.

    0 讨论(0)
  • 2020-12-05 04:42

    just run (taskkill /im java.exe /f) in command

    0 讨论(0)
提交回复
热议问题