This is the folder structure of my project:
- Root-folder
.git
projecname
Procfile
pom.xml
This is the Procfile
configure:
web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT --proxy-base-url https://projectname.herokuapp.com target/*.war
I used Profile to deploy project on heroku from Local:
cd projectname
git push heroku master
but I got the erorr when deploying:
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
as I understand, the reason is: the root folder that Heroku
use to run maven
build is the same folder containing .git
is: Root-folder
and the pom.xml
file is in Root-folder/projectname
folder.
So my question is how can I set the build path
to heroku know where is containing the pom.xml
file?
Thank you in advance.
SOLVED
I have read this article: https://medium.com/@timanovsky/heroku-buildpack-to-support-deployment-from-subdirectory-e743c2c838dd
then setting PROJECT_PATH by command:
heroku config:set PROJECT_PATH=projectname
heroku config:set PROJECT_PATH=projectname
– Puzzlement