Hun*_*uan 6 spring-mvc heroku procfile
这是我的项目的文件夹结构:
- 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
的文件夹相同,文件位于文件夹中。.git
Root-folder
pom.xml
Root-folder/projectname
所以我的问题是如何设置build path
让 heroku 知道包含该pom.xml
文件的位置?
先感谢您。
解决了
我读过这篇文章:https://medium.com/@timanovsky/heroku-buildpack-to-support-deployment-from-subdirectory-e743c2c838dd
然后通过命令设置 PROJECT_PATH:
heroku config:set PROJECT_PATH=projectname
归档时间: |
|
查看次数: |
4741 次 |
最近记录: |