Jars in lib folder not picked up when deploying pl

2019-09-02 00:45发布

I have built an application based on play framework 2.0.3. I have placed some jars in lib folder (unmanaged dependencies) which are used in my application like suggested in How to put a JAR file in a Play 2 project and use it?

All is fine when I run it from my local machine with play run

But when this application is deployed to Heroku, these jars are not picked up. I get compilation errors where these jars are used.

I even tried adding dependencies.yml with below content

require:
    - play 2.0.3
    - provided -> myjar 1.0

repositories:
  - provided:
      type:       local
      artifact:   "${application.path}/lib/[module]-[revision].jar"
      contains:
        - provided -> *

But still it didn't work.

My Start script (Procfile) is :

web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -DapplyEvolutions.default=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL}

Can somebody throw some light on this problem ?

1条回答
迷人小祖宗
2楼-- · 2019-09-02 01:05

Since heroku uses git, make sure that you lib folder and all contained jars are properly managed by git, ie that they are not in your .gitignore file.

查看更多
登录 后发表回答