# Why is Heroku rebuilding my project when i deploy from Travis?

**URL:** <https://travis-ci.community/t/why-is-heroku-rebuilding-my-project-when-i-deploy-from-travis/5859>\
**Category:** Deployment\
**Tags:** dpl-heroku\
**Created:** [November 9, 2019, 12:36am UTC](https://travis-ci.community/t/why-is-heroku-rebuilding-my-project-when-i-deploy-from-travis/5859 "2019-11-09T00:36:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tandolf](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/tandolf/32/3898_2.png) [@Tandolf](https://travis-ci.community/u/Tandolf)\
**Post date:** [November 9, 2019, 12:36am UTC](https://travis-ci.community/t/why-is-heroku-rebuilding-my-project-when-i-deploy-from-travis/5859/1 "2019-11-09T00:36:26Z")

</div>

So i have a Java/maven/react project in a fat JAR. So travis checks out the code from github when there is a push to master.

I compile my project, then i run the project and do a health check on my build artifact (jar). Then i want to push my built jar to heroku, but when travis releases to Heroku, heroku suddenly rebuilds my project once more.

**Im trying to use the build number env\_variables from travis, but when travis deploys to heroku, heroku apparently rebuilds my entire project once again i loose all the env variables since they don’t exists at heroku.**

I want to build by project ONCE, health check the build artifact, and then push only the artifact to heroku.

[https://travis-ci.org/Tandolf/nordic/jobs/609474480](https://travis-ci.org/Tandolf/nordic/jobs/609474480)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [November 9, 2019, 1:37am UTC](https://travis-ci.community/t/why-is-heroku-rebuilding-my-project-when-i-deploy-from-travis/5859/2 "2019-11-09T01:37:49Z")

</div>

As described in

> **[Travis CI Documentation](https://docs.travis-ci.com/user/deployment/heroku#deploy-strategy)**
>
> Heroku Deployment

  
We use Heroku API or the git push strategy to deploy your application to Heroku. I don’t think “push the artifact to Heroku” fits either strategy.

You’ll have to find something else, perhaps the [script](https://docs.travis-ci.com/user/deployment/script) provider (and write your custom script).

---

<div class="post-metadata">

**Author:** ![Tandolf](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/tandolf/32/3898_2.png) [@Tandolf](https://travis-ci.community/u/Tandolf)\
**Post date:** [November 9, 2019, 2:36am UTC](https://travis-ci.community/t/why-is-heroku-rebuilding-my-project-when-i-deploy-from-travis/5859/3 "2019-11-09T02:36:00Z")

</div>

okey, thanks for the information, ill have to look in to maybe using heroku maven plugin for deployment instead
