I am trying to deploy a gradle java app to heroku from my local machine. My project contains the following files
I have defined the following tasks in my build.gradle
task stage {
dependsOn build
}
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}
The content of ProcFile is as follows:
web: java -Dserver.port=$PORT $JAVA_OPTS -jar target/demo-0.0.1-SNAPSHOT.jar
While executing git commit heroku master
I get the following error
while executing git ls-files gradle
the following files are listed
Could you please suggest why I am getting the error while deploying the app to heroku server?
If you are using gradlew, then you must also add your
gradle/wrapper/gradle-wrapper.jar
andgradle/wrapper/gradle-wrapper.properties
to your Git repository. If you do not add these files, you will receive an error such as:-----> executing ./gradlew stage Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
And to solve it:
You can add the wrapper files by running these commands:
git add gradle/wrapper git commit -m "Gradle Wrapper"
You don't need this
task stage{
dependsOn build}
task wrapper(type:Wrapper){
gradleVersion = '5.6.1'
}
Instead try using this:
task stage(dependsOn: ['clean', 'installDist'])
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.