【问题标题】:"Cannot add a configuration with name 'endpoints' as a configuration..."“无法添加名称为 'endpoints' 的配置作为配置...”
【发布时间】:2017-10-04 16:04:33
【问题描述】:

我正在尝试迁移到 GAE 框架 2.0。当我阅读文档时,我意识到当我将这一行添加到 build.gradle 时。

apply plugin: 'com.google.cloud.tools.endpoints-framework-server'

我可以这个错误信息:

错误:无法添加名称为“端点”的配置作为 具有该名称的配置已存在。

有人遇到同样的错误吗?

我的 build.gradle 如下:

buildscript {
   repositories {
      mavenCentral()
      jcenter()
   }
   dependencies {
      classpath 'com.google.appengine:gradle-appengine-plugin:+'

      classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:+'
   }
}

repositories {
   mavenCentral()
   jcenter()
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
apply plugin: 'com.google.cloud.tools.endpoints-framework-server'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
   appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.56'

   testCompile 'junit:junit:4.12'
   testCompile 'com.google.appengine:appengine-testing:1.9.56'
   testCompile 'com.google.appengine:appengine-api-stubs:1.9.56'

   // 2.0
   compile group: 'com.google.endpoints', name: 'endpoints-framework', version: '+'

   compile group: 'com.googlecode.junit-toolbox', name: 'junit-toolbox', version: '1.5'
   compile 'com.google.appengine:appengine-endpoints:1.9.50'
   compile 'com.google.appengine:appengine-endpoints-deps:1.9.50'
   compile 'com.googlecode.objectify:objectify:5.1.5'
   compile 'org.json:json:20151123'
   compile 'javax.servlet:servlet-api:2.5'
   compile 'org.apache.httpcomponents:httpclient:4.5.2'
   compile 'com.ganyo:gcm-server:1.0.2'
   compile 'com.google.appengine.tools:appengine-gcs-client:0.4.4'
   //compile 'commons-fileupload:commons-fileupload:1.3.1'
   compile 'com.google.apis:google-api-services-storage:v1-rev66-1.21.0'
}

appengine {
   downloadSdk = true
   appcfg {
      oauth2 = true
   }
   endpoints {
      getClientLibsOnBuild = true
      getDiscoveryDocsOnBuild = true
   }

   httpAddress = "0.0.0.0"
}

【问题讨论】:

    标签: google-app-engine gradle plugins


    【解决方案1】:

    您已经应用的appengine 插件已经创建了一个名为endpoints 的配置 - 请参阅here。你确定这两个插件,我的意思是appenginecom.google.cloud.tools.endpoints-framework-server 可以在一个项目中一起使用吗?因为可能只有一种具有特定名称的配置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-10
      • 2017-09-09
      • 1970-01-01
      • 2021-09-17
      • 2018-02-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多