问题
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:
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.
来源:https://stackoverflow.com/questions/12054118/jars-in-lib-folder-not-picked-up-when-deploying-play-application-on-heroku