这是我的项目的文件夹结构:
- Root-folder
.git
projecname
Procfile
pom.xml
Run Code Online (Sandbox Code Playgroud)
这是Procfile配置:
web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT --proxy-base-url https://projectname.herokuapp.com target/*.war
Run Code Online (Sandbox Code Playgroud)
我使用 Profile 从本地在 heroku 上部署项目:
cd projectname
git push heroku master
Run Code Online (Sandbox Code Playgroud)
但我在部署时遇到错误:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/java.tgz
remote: Could not find a pom.xml file! Please check that it exists and is committed to Git.
remote:
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
Run Code Online (Sandbox Code Playgroud)
据我了解,原因是:Heroku用于运行构建的根文件夹与包含is:maven的文件夹相同,文件位于文件夹中。.gitRoot-folderpom.xmlRoot-folder/projectname …