https://github.com/philippus/sbt-banner
🚩 Generate a Spring Boot-like banner.txt in your resources directory
https://github.com/philippus/sbt-banner
banner-generator spring-boot
Last synced: 2 months ago
JSON representation
🚩 Generate a Spring Boot-like banner.txt in your resources directory
- Host: GitHub
- URL: https://github.com/philippus/sbt-banner
- Owner: Philippus
- License: mpl-2.0
- Created: 2024-12-10T17:01:14.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-18T16:09:46.000Z (4 months ago)
- Last Synced: 2025-03-09T22:42:13.502Z (2 months ago)
- Topics: banner-generator, spring-boot
- Language: Java
- Homepage:
- Size: 1.18 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sbt-banner
[](https://github.com/Philippus/sbt-banner/actions/workflows/scala.yml?query=workflow%3Abuild+branch%3Amain)

[](https://scala-steward.org)
[](LICENSE)Inspired by the banner in Spring Boot, sbt-banner can generate a banner in the resources directory on compile, or with
the `bannerGenerate` command. You can, for example add this banner to the log at the start of your application with
something like this:```scala
Using.resource(Source.fromResource("banner.txt")) { source =>
logger.info(source.getLines().mkString("\n"))
}
```## Installation
sbt-banner is published for sbt 1.10.7 and above. To start using it add the following to your plugins.sbt:
```sbt
addSbtPlugin("nl.gn0s1s" % "sbt-banner" % "0.0.1")
```## Usage
### Tasks
| Task | Description | Command |
|:---------------|:--------------------|:---------------------------|
| bannerGenerate | Generates a banner. | ```$ sbt bannerGenerate``` |### Configuration
You can configure the configuration in your `build.sbt` file.
| Setting | Description | Default Value |
|:----------------|:-----------------------------------|:--------------|
| bannerText | The banner text | placeholder |
| bannerCaption | The banner caption | None |
| bannerOverwrite | Enable overwriting the banner file | false |### Example
```sbt
bannerText := "sbt-banner"
bannerCaption := Some("Powered by 🍌Banana")
``````
scala> scala.util.Using.resource(scala.io.Source.fromResource("banner.txt")) { source => println(source.getLines().mkString("\n"))}
_ _ _
___| |__ | |_ | |__ __ _ _ __ _ __ ___ _ __
/ __| '_ \| __|____| '_ \ / _` | '_ \| '_ \ / _ \ '__|
\__ \ |_) | ||_____| |_) | (_| | | | | | | | __/ |
|___/_.__/ \__| |_.__/ \__,_|_| |_|_| |_|\___|_|
Powered by 🍌Banana```
## Resources
- [Banana](https://github.com/yihleego/banana)
## License
The code is available under the [Mozilla Public License, version 2.0](LICENSE).