我正在開發使用MongoDB的Spring Web服務,我正在用Gradle構建它。我想在Heroku上部署它。我按照文檔做俯臥撐,我改變了buildpack的gradle上,根據本: https://devcenter.heroku.com/articles/buildpacks在Heroku上部署Spring應用程序
在開始的時候,我做git init
,那麼我將使用一切git add .
使用git commit -m "message"
commiting它。在標準程序之後,我正在使用git push heroku master
將所有內容推送到heroku。
之後,依賴被下載,之後我收到提示:
1 error
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'
> Compilation failed; see the compiler error output for details.
...
BUILD FAILED
這裏是我的build.gradle:
buildscript {
repositories {
maven { url "http://repo.spring.io/libs-release" }
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.7.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'appname'
version = '0.1.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "http://repo.spring.io/libs-release" }
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-actuator")
testCompile("junit:junit")
compile("org.springframework.data:spring-data-rest-webmvc")
compile("org.springframework.data:spring-data-mongodb")
compile("com.google.guava:guava:17.0")
compile("org.apache.commons:commons-lang3:3.3.2")
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
task stage(dependsOn: ['clean', 'installApp'])
任何人有解決方案嗎?提前致謝。
您的應用程序根本無法編譯。這可能是由於許多原因。嘗試使用'gradlew compileJava'在本地運行您的Gradle構建。你應該得到一個更有用的信息。 – 2014-10-09 03:28:49
應用程序在本地使用'gradle compileJava'正確運行。 'gradlew'在我的cmd上不起作用。 – Forin 2014-10-09 08:50:05
可能會嘗試從您的存儲列表中刪除本地的maven。這在遠程構建時可能會導致問題。 – 2014-10-09 23:25:47