using publishTo
in build.sbt
file, it can be automation the publishing progress.
But asset files( in public
folder) does not packaged. how to package and publish asset files?
相关问题
- PlayFramework: how to transform each element of a
- Could not import the newly generated play framewor
- Play Framework Unicode symbols in HTTP Header
- How to filter/disable a scalac option for all subp
- Unresolved dependencies path for SBT project in In
相关文章
- How do you run cucumber with Scala 2.11 and sbt 0.
- Setting up multiple test folders in a SBT project
- Testing request with CSRF Token in Play framework
- How to map an abstract collection with jpa?
- Run project with java options via sbt
- Build maven project as a part of SBT build
- play2 framework my template is not seen. : package
- What does `<<=` mean in SBT?
If you want to add some directory (e. g. "public") into a jar, just add this lines in build.sbt
From here and here.
The question title mentions "plugin" but I'm not sure from the rest of the question whether your intention is to deploy a Play web application to production, push a Play web application to a Maven repository (as in the link) or push a Play plugin to a Maven repo.
Assuming the first case, my own process to deploy a Play web app to production does this with bash scripts:
Run
play dist
(This includes the public assets)
Optional: repackage the archive
(You can skip this but I found I can reduce the size by about 30%)
Copy the archive to the production host, e.g. with
scp
.nginx
or other front-facing HTTP server serves those assets directly.This related question may also be useful.
For locally publishing assets files , add this snippet in
build.sbt
fileImportant notes in last function line:
first
jar
specify package type folder (As webJars added as java dependency they should put in jars folder).second
jar
specify extention of packaged file.assets
is classifier (more information about sbt classifier)now you can use packaged assets as webjar in another project using this command in
buil.sbt
file: