dropwizard-version-bundle

Dropwizard bundle that easily exposes the version of your application.

License

License

Categories

Categories

DropWizard Container Microservices
GroupId

GroupId

io.dropwizard-bundles
ArtifactId

ArtifactId

dropwizard-version-bundle
Last Version

Last Version

1.3.5
Release Date

Release Date

Type

Type

jar
Description

Description

dropwizard-version-bundle
Dropwizard bundle that easily exposes the version of your application.
Source Code Management

Source Code Management

http://github.com/dropwizard-bundles/dropwizard-version-bundle

Download dropwizard-version-bundle

How to add to project

<!-- https://jarcasting.com/artifacts/io.dropwizard-bundles/dropwizard-version-bundle/ -->
<dependency>
    <groupId>io.dropwizard-bundles</groupId>
    <artifactId>dropwizard-version-bundle</artifactId>
    <version>1.3.5</version>
</dependency>
// https://jarcasting.com/artifacts/io.dropwizard-bundles/dropwizard-version-bundle/
implementation 'io.dropwizard-bundles:dropwizard-version-bundle:1.3.5'
// https://jarcasting.com/artifacts/io.dropwizard-bundles/dropwizard-version-bundle/
implementation ("io.dropwizard-bundles:dropwizard-version-bundle:1.3.5")
'io.dropwizard-bundles:dropwizard-version-bundle:jar:1.3.5'
<dependency org="io.dropwizard-bundles" name="dropwizard-version-bundle" rev="1.3.5">
  <artifact name="dropwizard-version-bundle" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.dropwizard-bundles', module='dropwizard-version-bundle', version='1.3.5')
)
libraryDependencies += "io.dropwizard-bundles" % "dropwizard-version-bundle" % "1.3.5"
[io.dropwizard-bundles/dropwizard-version-bundle "1.3.5"]

Dependencies

compile (2)

Group / Artifact Type Version
io.dropwizard : dropwizard-core jar
org.reflections : reflections jar 0.9.11

test (6)

Group / Artifact Type Version
io.dropwizard : dropwizard-testing jar
junit : junit jar
org.eclipse.jetty : jetty-http jar
org.eclipse.jetty : jetty-servlet jar
org.eclipse.jetty : jetty-servlet jar
org.mockito : mockito-core jar

Project Modules

There are no modules declared in this project.

dropwizard-version-bundle

A Dropwizard bundle that exposes the version of your application as well as its dependencies via the admin port.

[Build Status] (http://travis-ci.org/dropwizard-bundles/dropwizard-version-bundle)

Getting Started

Just add this maven dependency to get started:

<dependency>
  <groupId>io.dropwizard-bundles</groupId>
  <artifactId>dropwizard-version-bundle</artifactId>
  <version>1.0.5</version>
</dependency>

Add the bundle to your environment using your choice of version supplier:

public class MyApplication extends Application<Configuration> {
  @Override
  public void initialize(Bootstrap<Configuration> bootstrap) {
    VersionSupplier supplier = new MavenVersionSupplier("<YOUR GROUP>", "<YOUR ARTIFACT ID>");
    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.

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.

io.dropwizard-bundles

Dropwizard Bundles

Reusable Dropwizard Bundles

Versions

Version
1.3.5
1.2.2
1.1.4
1.0.5
1.0.0
0.9.2
0.9.1
0.9.0
0.8.5
0.8.4-1
0.8.4
0.8.2
0.8.1-2
0.8.1-1
0.8.1