Cannot deploy branch to Heroku

I’m trying to manually deploy branch main from my repository to Heroku using the simple git deployment method on the Heroku website. However, I get the following log:

-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/java
-----> App not compatible with buildpack: https://buildpack-> registry.s3.amazonaws.com/buildpacks/heroku/java.tgz
       Could not find a pom.xml file! Please check that it exists and is committed to Git.
       More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
 !     Push failed

Can not understand why it ignores pom.xml.

Answer

The pom.xml file should be in the root of your project. In this way is found by Heroku that activates (by default) the Java support for Maven.

Move the file or (better/easier) avoid using the demo-site folder (store POM, src, etc.. in the root).