无法从HTTP URL应用gradle脚本插件

无法从HTTP URL应用gradle脚本插件,gradle,plugins,build.gradle,gradle-plugin,Gradle,Plugins,Build.gradle,Gradle Plugin,我使用gradle v4.2,这是我的build.gradle。我需要应用脚本插件,它在我的github url中有一个非常简单的自定义任务 apply plugin: 'java' apply plugin: 'maven' apply from: 'https://github.com/contactsai123/TestAssured/blob/master/custom.gradle' 但是,我得到以下输出: Download https://githu

我使用gradle v4.2,这是我的build.gradle。我需要应用脚本插件,它在我的github url中有一个非常简单的自定义任务

    apply plugin: 'java'
    apply plugin: 'maven'
    apply from: 'https://github.com/contactsai123/TestAssured/blob/master/custom.gradle'
但是,我得到以下输出:

    Download https://github.com/contactsai123/TestAssured/blob/master/custom.gradle

    FAILURE: Build failed with an exception.

    Where:
    Script 
    'https://github.com/contactsai123/TestAssured/blob/master/custom.gradle' 
     line: 7

    What went wrong:
   Could not compile script 


  'https://github.com/contactsai123/TestAssured/blob/master/custom.gradle'.
  > startup failed:
  script 
 'https://github.com/contactsai123/TestAssured/blob/master/custom.gradle': 
  7: unexpected token: < @ line 7, column 1.
  <!DOCTYPE html>
 ^

 1 error

这是因为您将其作为网页引用,而不是原始的,但是请尝试将其作为原始的

https://raw.githubusercontent.com/contactsai123/TestAssured/master/custom.gradle
它应该像预期的那样工作

https://raw.githubusercontent.com/contactsai123/TestAssured/master/custom.gradle