https://github.com/dropwizard-bundles/dropwizard-version-bundle
A Dropwizard bundle that exposes the version of your application via the admin port.
https://github.com/dropwizard-bundles/dropwizard-version-bundle
dropwizard-bundle
Last synced: 5 months ago
JSON representation
A Dropwizard bundle that exposes the version of your application via the admin port.
- Host: GitHub
- URL: https://github.com/dropwizard-bundles/dropwizard-version-bundle
- Owner: dropwizard-bundles
- License: apache-2.0
- Created: 2015-01-28T23:25:45.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T09:04:33.000Z (about 3 years ago)
- Last Synced: 2023-07-28T10:07:05.422Z (almost 3 years ago)
- Topics: dropwizard-bundle
- Language: Java
- Size: 48.8 KB
- Stars: 6
- Watchers: 4
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# dropwizard-version-bundle
A [Dropwizard][dropwizard] bundle that exposes the version of your application as well as its
dependencies via the admin port.
[]
(http://travis-ci.org/dropwizard-bundles/dropwizard-version-bundle)
## Getting Started
Just add this maven dependency to get started:
```xml
io.dropwizard-bundles
dropwizard-version-bundle
1.0.5
```
Add the bundle to your environment using your choice of version supplier:
```java
public class MyApplication extends Application {
@Override
public void initialize(Bootstrap bootstrap) {
VersionSupplier supplier = new MavenVersionSupplier("", "");
bootstrap.addBundle(new VersionBundle(supplier));
}
@Override
public void run(Configuration cfg, Environment env) throws Exception {
// ...
}
}
```
Now you can access the the `/version` URL on the admin port of your application to see the version
of your application as well as its dependencies.
For example if your application were running on `localhost` with the admin server on port 8081 then
something like the following would show you your application's version.
```bash
curl localhost:8081/version
```
## Customizing the version supplier
By default the bundle only comes with a single version supplier `MavenVersionSupplier` that will
discover the version information for a particular maven artifact by reading the `pom.properties`
file in a maven produced jar.
The `VersionSupplier` that plugs into the bundle is customizable however so you can define your own
implementation if your needs are different. If you implement a new `VersionSupplier` that is
generally useful for others then please feel free to submit a pull request.
[dropwizard]: http://dropwizard.io