2017-05-08 43 views
0

build.gradle無法訪問:的App Engine SDK在搖籃應用程序引擎項目

buildscript { // Configuration for building 
    repositories { 
    jcenter() // Bintray's repository - a fast Maven Central mirror & more 
    mavenCentral() 
    } 
    dependencies { 
    classpath 'com.google.cloud.tools:appengine-gradle-plugin:+' // latest App Engine Gradle tasks 
    } 
} 

repositories { // repositories for Jar's you access in your code 
    maven { 
    url 'https://maven-central.storage.googleapis.com'    // Google's mirror of Maven Central 
// url 'https://oss.sonatype.org/content/repositories/snapshots' // SNAPSHOT Repository (if needed) 
    } 
    jcenter() 
    mavenCentral() 
    maven { 
     url "s3://my.private.repo.com/maven/releases" 
     credentials(AwsCredentials) { 
      accessKey AWS_ACCESS_KEY 
      secretKey AWS_SECRET_KEY 
     } 
    } 
} 

apply plugin: 'java'        // standard Java tasks 
apply plugin: 'war'        // standard Web Archive plugin 
apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks 

dependencies { 
    providedCompile group: 'javax.servlet', name: 'servlet-api', version:'2.5' 
    compile 'com.google.appengine:appengine:+' 

    compile 'com.stripe:stripe-java:3.6.0' 
    compile 'javax.mail:mailapi:1.4.3' 
} 

appengine { // App Engine tasks configuration 
    run {  // local (dev_appserver) configuration (standard environments only) 
    port = 8080     // default 
    } 

    deploy { // deploy configuration 
    stopPreviousVersion = true // default - stop the current version 
    promote = true    // default - & make this the current version 
    } 
} 

group = 'com.example.appengine' // Generated output GroupId 
version = '1.0-SNAPSHOT'   // Version in generated output 

sourceCompatibility = 1.7 // App Engine Standard uses Java 7 
targetCompatibility = 1.7 // App Engine Standard uses Java 7 

StripeJavaMail JAR文件似乎可以下載就好了。但是,當我運行compileJava我收到其他錯誤:

/path/to/eclipse-workspaces/google-eclipse-projects/myproject/src/main/java/com/package/ChargeStripeServlet.java:3: error: package com.google.appengine.api.taskqueue.TaskOptions does not exist 
import static com.google.appengine.api.taskqueue.TaskOptions.Builder.withUrl; 
... 

看來,在App Engine SDK不被下載,但我沒有看到任何錯誤消息。我已經在本地安裝了SDK,如果有幫助的話(儘管我懷疑JARS只會被下載)。

+1

請分享整個的build.gradle;) – Opal

回答

2

你需要做的是添加以下的依賴:

compile 'com.google.appengine:appengine-api-1.0-sdk:+' 

正如你可以看到here'com.google.appengine:appengine:+'類型爲POM的,因此不會攜帶任何Java類,它只是一個父。

相關問題