Bootique Core Documentation

1. Part I. Overview

1.1. What is Bootique

Bootique is a minimally opinionated platform for building container-less runnable Java applications. No JavaEE container required to run your app! It is an ideal platform for microservices, as it allows you to create a fully functional app with minimal-to-no setup. Though it is not limited to a specific kind of app (or the "micro" size) and can be used for REST services, webapps, runnable jobs, DB migrations, JavaFX GUI apps to mention a few examples.

Unlike traditional container-based apps, Bootique allows you to control your main() method and create Java apps that behave like simple executable commands that can be run with Java:

java -jar my.jar [arguments]

Each Bootique app can be started with a YAML configuration loaded from a file or from a remote URL. Among other benefits, such configuration approach ideally suits cloud deployment environments.

Other popular products in this space are Dropwizard and SpringBoot, however Bootique’s focus is different. Bootique favors modularity and clean pluggable architecture. Bootique is built on top of Google Guice dependency injection (DI) container, which provides the core of its modularity mechanism. This means that pretty much anything in Bootique can be customized/overridden to your liking.

1.2. Java Version

Java 8 or newer is required.

1.3. Build System

Bootique apps can be built using any Java build system (Ant, Maven, Gradle, etc). Examples in the documentation are based on Maven.

1.4. Programming Skills

Everything you know about Java programming will be applicable when working with Bootique. You may need to "unlearn" some of the practices related to JavaEE configuration and container deployment though.

Integration between various parts of a Bootique app is done via Google Guice. In most cases Bootique API would steer you towards idiomatic approach to integration, so deep knowledge of Guice is not required. Though it wouldn’t hurt to understand a few main concepts: modules, bindings, multibindings, overrides.

Java ServiceLoader facility is another important part of Bootique, and probably yet another thing that you shouldn’t worry too much about initially.

2. Part II. Programming

2.1. Modules

Bootique apps are made of "modules". The framework simply locates all available modules, loads them in the DI environment, parses the command line, and then transfers control to a Command (that can originate from any of the modules) that matched the user choice. There’s a growing list of modules created by Bootique development team. And you can easily write your own. In fact, programming in Bootique is primarily about writing Modules.

A module is a Java library that contains some code. What makes it a module is a special Java class that implements Guice Module interface. This class defines what "services" or other types of objects the module provides (in other words what will be injectable by the module users). This is done in a form of "bindings", i.e. associations between publicly visible injectable service interfaces and specific implementations:

public class MyModule implements Module {
    public void configure(Binder binder) {

There are other flavors of bindings in Guice. Please refer to Guice documentation for details. One important form extensively used in Bootique is Multibinding.

2.2. Modules Auto-Loading

Modules can be automatically loaded via Bootique.autoLoadModules() as long as they are included in your application dependencies. Auto-loading depends on the Java ServiceLoader mechanism. To ensure your modules can be auto-loaded do two things. First implement io.bootique.BQModuleProvider interface specific to your module:

public class MyModuleProvider implements BQModuleProvider {
    public Module module() {
        return new MyModule();

After that create a file META-INF/services/io.bootique.BQModuleProvider with the only line being the name of your BQModuleProvider implementor. E.g.:

BQModuleProvider has two more methods that you can optionally implement to help Bootique to make sense of the module being loaded:

public class MyModuleProvider implements BQModuleProvider {
    // ...

    // provides human-readable name of the module
    public String name() {
        return "CustomName";

    // a collection of modules whose services are overridden by this module
    public Collection<Class<? extends Module>> overrides() {
        return Collections.singleton(BQCoreModule.class);

If in your Module you are planning to redefine any services from the upstream modules, specify those upstream modules in the overrides() collection. In practice overrides are rarely needed, and often can be replaced with service decomposition.

2.3. Configuration and Configurable Factories

Bootique Modules obtain their configuration in a form of "factory objects". We’ll show some examples shortly. For now let’s focus on the big picture, namely the fact that Bootique app configuration is multi-layered and roughly follows the sequence of "code - config files (contributed) - config files (CLI) - overrides". "Code" is the default values that are provided in constructors of factory objects. Config files overlay those defaults with their own values. Config files can be either contributed in the code, or specified on the command line. Files is where the bulk of configuration usually stored. Finally config values may be further overridden via Java properties and/or environment variables.

2.3.1. Configuration via YAML Files

Format of configuration file can be either JSON or YAML. For simplicity we’ll focus on YAML format, but the two are interchangeable. Here is an example config file:

  level: warn
    - type: file
      logFormat: '%c{20}: %m%n'
      file: target/logback/debug.log

  context: /myapp
    - port: 12009

While not strictly required, as a rule the top-level keys in the file belong to configuration objects of individual modules. In the example above "log" subtree configures bootique-logback module, while "jetty" subtree configures bootique-jetty. For standard modules refer to module-specific documentation on the structure of the supported configuration (or run your app -H flag to print supported config to the console). Here we’ll discuss how to build your own configuration-aware module.

Bootique allows each Module to read its specific configuration subtree as an object of the type defined in the Module. Very often such an object is written as a factory that contains a bunch of setters for configuration properties, and a factory method to produce some "service" that a Module is interested in. Here is an example factory:

public class MyFactory {

    private int intProperty;
    private String stringProperty;

    public void setIntProperty(int i) {
        this.intProperty = i;

    public void setStringProperty(String s) {
        this.stringProperty = s;

    // factory method
    public MyService createMyService(SomeOtherService soService) {
        return new MyServiceImpl(soService, intProperty, stringProperty);

The factory contains configuration property declarations, as well as public setters for these properties (You can create getters as well. It is not strictly required, but may be useful for unit tests, etc.). Now let’s take a look at the Module class:

public class MyModule extends ConfigModule {
    public MyService createMyService(
             ConfigurationFactory configFactory,
             SomeOtherService soService) {

        return configFactory
                 .config(MyFactory.class, configPrefix)

And now a sample configuration that will work with our module:

  intProperty: 55
  stringProperty: 'Hello, world!'

A few points to note here:

  • Calling our module "MyModule" and extending from ConfigModule gives it access to the protected "configPrefix" instance variable that is initialized to the value of "my" (the naming convention here is to use the Module simple class name without the "Module" suffix and converted to lowercase).

  • @Provides annotation is a Guice way of marking a Module method as a "provider" for a certain type of injectable service. All its parameters are themselves injectable objects.

  • ConfigurationFactory is the class used to bind a subtree of the app YAML configuration to a given Java object (in our case - MyFactory). The structure of MyFactory is very simple here, but it can be as complex as needed, containing nested objects, arrays, maps, etc. Internally Bootique uses Jackson framework to bind YAML to a Java class, so all the features of Jackson can be used to craft configuration.

2.3.2. Configuration File Loading

There are a number of ways to pass a config file to a Bootique app, roughly falling in two categories - files contributed via DI and files passed on command line. Let’s discuss them one by one:

  • Contributing a config file via DI:


    A primary motivation for this style is to provide application default configuration, with YAML files often embedded in the app and read from the classpath (as suggested by the "classpath:.." URL in the example). More then one configuration can be contributed. E.g. individual modules might load their own defaults. Multiple configs are combined in a single config tree by the runtime. The order in which this combination happens is undefined, so make sure there are no conflicts between them. If there are, consider replacing multiple conflicting configs with a single config.

  • Conditionally contributing a config file via DI. It is possible to make DI configuration inclusion conditional on the presence of a certain command line option:

    OptionMetadata o = OptionMetadata.builder("qa")
          .description("when present, uses QA config")
          .mapConfigResource(o.getName(), "classpath:a/b/qa.yml");
  • Specifying a config file on command line. Each Bootique app supports --config option that takes a configuration file as its parameter. To specify more than one file, use --config option multiple times. Configurations will be loaded and merged together in the order of their appearance on the command line.

  • Specifying a single config value via a custom option:

    OptionMetadata o = OptionMetadata.builder("db")
          .description("specifies database URL")
          .mapConfigPath(o.getName(), "jdbc.mydb.url);

    This adds a new --db option to the app that can be used to set JDBC URL of a datasource called "mydb". If value is not specified, the default one will be used.

2.3.3. Configuration via Properties

YAML file can be thought of as a set of nested properties. E.g. the following config

  prop1: val1
  prop2: val2

can be represented as two properties ("my.prop1", "my.prop2") being assigned some values. Bootique takes advantage of this structural equivalence and allows to define configuration via properties as an alternative (or more frequently - an addition) to YAML. If the same "key" is defined in both YAML file and a property, ConfigurationFactory would use the value of the property (in other words properties override YAML values).

To turn a given property into a configuration property, you need to prefix it with “bq.”. This "namespace" makes configuration explicit and helps to avoid random naming conflicts with properties otherwise present in the system.

Properties can be provided to Bootique via BQCoreModule extender:

class MyModule implements Module {
    public void configure(Binder binder) {

               .setProperty("", "valX")
               .setProperty("", "valY");

Alternatively they can be loaded from system properties. E.g.:

java -jar myapp.jar

Though generally this approach is sneered upon, as the authors of Bootique are striving to make Java apps look minimally "weird" in deployment, and "-D" is one of those unintuitive "Java-only" things. Often a better alternative is to define the bulk of configuration in YAML, and pass values for a few environment-specific properties via shell variables (see the next section) or bind them to CLI flags.

2.3.4. Configuration via Environment Variables

Bootique allows to use environment variables to specify/override configuration values. While variables work similar to JVM properties, using them has advantages in certain situations:

  • They may be used to configure credentials, as unlike YAML they won’t end up in version control, and unlike Java properties, they won’t be visible in the process list.

  • They provide customized application environment without changing the launch script and are ideal for containerized and other virtual environments.

  • They are more user-friendly and appear in the app help.

To declare variables associated with configuration values, use the following API (notice that no "bq." prefix is necessary here to identify the configuration value):

class MyModule implements Module {
    public void configure(Binder binder) {

               .declareVar("my.prop1", "P1")
               .declareVar("my.prop2", "P2");

So now a person running the app may set the above configuration as

export P1=valX
export P2=valY

Moreover, explicitly declared vars will automatically appear in the application help, assisting the admins in configuring your app

(TODO: document BQConfig and BQConfigProperty config factory annotations required for the help generation to work)

$ java -jar myapp-1.0.jar --help
           Sets value of some property.

           Sets value of some other property.
Notice that previously used naming conventions to bind variables that start with BQ_* to config values are deprecated and support for them will be removed soon. Such approach was causing too much unexpected behavior in non-containerized environments. The alternative is explicitly declared variables described above.

2.3.5. Polymorphic Configuration Objects

A powerful feature of Jackson is the ability to dynamically create subclasses of the configuration objects. Bootique takes full advantage of this. E.g. imagine a logging module that needs "appenders" to output its log messages (file appender, console appender, syslog appender, etc.). The framework might not be aware of all possible appenders its users might come up with in the future. Yet it still wants to have the ability to instantiate any of them, based solely on the data coming from YAML. Moreover each appender will have its own set of incompatible configuration properties. In fact this is exactly the situation with bootique-logback module.

Here is how you ensure that such a polymorphic configuration is possible. Let’s start with a simple class hierarchy:

public abstract class BaseType {
    // ...

public class ConcreteType1 extends BaseType {
    // ...

public class ConcreteType2 extends BaseType {
    // ...

Now let’s create a matching set of factories to create one of the concrete subtypes of BaseType. Let’s use Jackson annotations to link specific types of symbolic names to be used in YAML below:

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
     property = "type",
     defaultImpl = ConcreteTypeFactory1.class)
public abstract class BaseTypeFactory implements PolymorphicConfiguration {

    public abstract BaseType create();

public class ConcreteTypeFactory1 extends BaseTypeFactory {

     public BaseType create() {
        return new ConcreteType1();

public class ConcreteTypeFactory2 extends BaseTypeFactory {

     public BaseType create() {
        return new ConcreteType2();

After that we need to create a service provider file called META-INF/service/io.bootique.config.PolymorphicConfiguration where all the types participating in the hierarchy are listed (including the supertype):

This should be enough to work with configuration like this:

  type: type2
  someVar: someVal

The service of BaseType is bound in Guice using the standard ConfigurationFactory approach described above. Depending on the YAML config, one of the subclasses of BaseType will be created:

public BaseType provideBaseType(ConfigurationFactory configFactory) {

    return configFactory
             .config(BaseTypeFactory.class, "my")

If another module decides to create yet another subclass of BaseType, it will need to create its own META-INF/service/io.bootique.config.PolymorphicConfiguration file and add a new factory name there.

2.4. Using Modules

Modules can use other "upstream" modules in a few ways:

  • "Import": a downstream module uses another module as a library, ignoring its injectable services.

  • "Use" : downstream module’s classes inject classes from an upstream module.

  • "Contribute": downstream module injects objects to collections and maps defined in upstream modules.

Import case is trivial, so we’ll concentrate on the two remaining scenarios. We will use BQCoreModule as an example of an upstream module, as it is available in all apps.

2.4.1. Injecting Other Module’s Services

You can inject any services declared in other modules. E.g. BQCoreModule provides a number of objects and services that can be accessed via injection:

class MyService {

    private String[] args;

    public String getArgsString() {
        return Arrays.asList(getArgs()).stream().collect(joining(" "));

In this example we injected command line arguments that were used to start the app. Note that since there can potentially be more than one String[] in a DI container, Bootique @Args annotation is used to uniquely identify the array that we want here.

2.4.2. Contributing to Other Modules

Guice supports multibindings, intended to contribute objects defined in a downstream module to collections/maps used by services in upstream modules. Bootique hides Guice API complexities, usually providing "extenders" in each module. E.g. the following code adds MyCommand the the app set of commands:

public class MyModule implements Module {

    public void configure(Binder binder) {

Here we obtained an extender instance via a static method on BQCoreModule. Most standard modules define their own extenders accessible via "extend(Binder)". This is a pattern you might want to follow in your own modules.

2.5. Application Class

A class that contains the "main()" method is informally called "application". Bootique does not impose any additional requirements on this class. You decide what to put in it. It can be limited to just "main()", or turned into a REST API resource, etc.

2.5.1. Application as a Module

Most often then not it makes sense to turn the application class into a Module though. After all a Bootique app is just a collection of Modules, and this way the application class would represent that one final Module to rule them all:

public class Application implements Module {

   public static void main(String[] args) {;

   public void configure(Binder binder) {
      // load app-specific services; redefine standard ones

You may also implement a separate BQModuleProvider for the Application module. Then autoLoadModules() will discover it just like any other Module, and there won’t be a need to add Application module explicitly.

2.5.2. Common Main Class

If all your code is packaged in auto-loadable modules (which is always a good idea), you may not even need a custom main class. io.bootique.Bootique class itself declares a main() method and can be used as an app launcher. This creates some interesting possibilities. E.g. you can create Java projects that have no code of their own and are simply collections of modules declared as compile dependencies. More details on packaging are given in the "Runnable Jar" chapter.

2.6. Commands

Bootique runtime contains a set of commands coming from Bootique core and from all the modules currently in effect in the app. On startup Bootique attempts to map command-line arguments to a single command type. If no match is found, a default command is executed (which is normally a "help" command). To list all available commands, the app can be run with --help option (in most cases running without any options will have the same effect). E.g.:

$ java -jar myapp-1.0.jar --help


      -c yaml_location, --config=yaml_location
           Specifies YAML config location, which can be a file path or a URL.

      -h, --help
           Prints this message.

      -H, --help-config
           Prints information about application modules and their configuration

      -s, --server
           Starts Jetty server.

2.6.1. Writing Commands

Most common commands are already available in various standard modules, still often you’d need to write your own. To do that, first create a command class. It should implement io.bootique.command.Command interface, though usually it more practical to extend io.bootique.command.CommandWithMetadata and provide some metadata used in help and elsewhere:

public class MyCommand extends CommandWithMetadata {

    private static CommandMetadata createMetadata() {
        return CommandMetadata.builder(MyCommand.class)
                .description("My command does something important.")

    public MyCommand() {

    public CommandOutcome run(Cli cli) {

        // ... run the command here....

        return CommandOutcome.succeeded();

The command initializes metadata in constructor and implements the "run" method to run its code. The return CommandOutcome object instructs Bootique what to do when the command finishes. The object contains desired system exit code, and exceptions that occurred during execution. To make the new command available to Bootique, add it to `BQCoreModule’s extender, as was already shown above:

public class MyModule implements Module {

    public void configure(Binder binder) {

To implement a "daemon" command running forever until it receives an OS signal (e.g. a web server waiting for user requests) , do something like this:

public CommandOutcome run(Cli cli) {

    // ... start some process in a different thread ....

    // now wait till the app is stopped from another thread
    // or the JVM is terminated
    try {
    } catch (InterruptedException e) {
        // ignore exception or log if needed

    return CommandOutcome.succeeded();

2.6.2. Injection in Commands

Commands can inject services, just like most other classes in Bootique. There are some specifics though. Since commands are sometimes instantiated, but not executed (e.g. when --help is run that lists all commands), it is often desirable to avoid immediate instantiation of all dependencies of a given command. So a common pattern with commands is to inject Guice Provider instead of direct dependency:

private Provider<SomeService> provider;

public CommandOutcome run(Cli cli) {

2.6.3. Decorating Commands

Each command typically does a single well-defined thing, such as starting a web server, executing a job, etc. But very often in addition to that main thing you need to do other things. E.g. when a web server is started, you might also want to run a few more commands:

  • Before starting the server, run a health check to verify that any external services the app might depend upon are alive.

  • Start a job scheduler in the background.

  • Start a monitoring "heartbeat" thread.

To run all these "secondary" commands when the main command is invoked, Bootique provides command decorator API. First you create a decorator policy object that specifies one or more secondary commands and their invocation strategy (either before the main command, or in parallel with it). Second you "decorate" the main command with that policy:

CommandDecorator extraCommands = CommandDecorator

BQCoreModule.extend(binder).decorateCommand(ServerCommand.class, extraCommands);

Based on the specified policy Bootique figures out the sequence of execution and runs the main and the secondary commands.

2.7. Options

2.7.1. Simple Options

In addition to commands, the app can define "options". Options are not associated with any runnable java code, and simply pass command-line values to commands and services. E.g. the standard “--config” option is used by CliConfigurationSource service to locate configuration file. Unrecognized options cause application startup errors. To be recognized, options need to be "contributed" to Bootique similar to commands:

OptionMetadata option = OptionMetadata
    .builder("email", "An admin email address")


To read a value of the option, a service should inject io.bootique.cli.Cli object (commands also get this object as a parameter to "run") :

private Cli cli;

public void doSomething() {
    Collection<String> emails = cli.optionStrings("email");
    // do something with option values....

2.7.2. Configuration Options

While you can process your own options as described above, options often are just aliases to enable certain pieces of configuration. Bootique supports three flavors of associating options with configuration. Let’s demonstrate them here.

  1. Option value sets a config property:

    // Starting the app with "--my-opt=x" will set "jobs.myjob.param" value to "x"
            .mapConfigPath("my-opt", "jobs.myjob.param");
  2. Option presence sets a property to a predefined value:

    // Starting the app with "--my-opt" will set "jobs.myjob.param" value to "y"
            .mapConfigPath("my-opt", "jobs.myjob.param");
  3. Option presence loads a config resource, such as a YAML file:

    // Starting the app with "--my-opt" is equivalent to starting with "--config=classpath:xyz.yml"
            .mapConfigResource("my-opt", "classpath:xyz.yml");

The order of config-bound options on the command line is significant, just as the order of “--config” parameters. Bootique merges configuration associated with options from left to right, overriding any preceding configuration if there is an overlap.

2.8. Logging

2.8.1. Loggers in the Code

Standard Bootique modules use SLF4J internally, as it is the most convenient least common denominator framework, and can be easily bridged to other logging implementations. Your apps or modules are not required to use SLF4J, though if they do, it will likely reduce the amount of bridging needed to route all logs to a single destination.

2.8.2. Configurable Logging with Logback

For better control over logging a standard module called bootique-logback is available, that integrates Logback framework in the app. It seamlessly bridges SLF4J (so you keep using SLF4J in the code), and allows to configure logging via YAML config file, including appenders (file, console, etc.) and per class/package log levels. Just like any other module, bootique-logback can be enabled by simply adding it to the pom.xml dependencies, assuming autoLoadModules() is in effect:


See bootique-logback module documentation for further details.

2.8.3. BootLogger

To perform logging during startup, before DI environment is available and YAML configuration is processed, Bootique uses a special service called BootLogger, that is not dependent on SLF4J and is not automatically bridged to Logback. It provides an abstraction for writing to stdout / stderr, as well as conditional "trace" logs sent to stderr. To enable Bootique trace logs, start the app with -Dbq.trace as described in the deployment section.

BootLogger is injectable, in case your own code needs to use it. If the default BootLogger behavior is not satisfactory, it can be overridden right in the main(..) method, as unlike other services, you may need to change it before DI is available:

public class Application {
  public static void main(String[] args) { MyBootLogger()).run();

3. Part III. Testing

3.1. Bootique and Testing

Bootique is uniquely suitable to be used as a test framework. Within a single test it allows you to start and stop multiple embedded Bootique runtimes, each with distinct set of modules and distinct YAML configurations, making it a powerful tool for integration testing.

3.2. Creating Test Runtimes

Here we’ll demonstrate the use of the core test framework. For module-specific test APIs (e.g. bootique-jdbc-test), check documentation of those modules or GitHub. To use the core framework, import the following module in the "test" scope:


Then create a BQTestFactory in each integration test, annotated with @Rule (or @ClassRule if you are planning to create a single runtime for all tests in a given class) :

public class MyTest {

    public BQTestFactory testFactory = new BQTestFactory();

Now use the factory to create test runtimes. Each runtime object is essentially an entire Bootique application. It can be used to inspect DI contents, execute a command (including commands that start background processes, such as --server and --schedule), etc. You don’t need to stop the runtime explicitly. BQTestFactory will take care of shutdown through JUnit lifecycle. returns a builder that mimics the API of Bootique class, with a few test-related extensions. E.g. it allows to load extra modules, etc.

public void testAbc() {

    BQRuntime runtime =
        // ensure all classpath modules are included
        // add an adhoc module specific to the test
        .module(binder -> binder.bind(MyService.class).to(MyServiceImpl.class))
    // ...

If you don’t need the runtime instance, but rather want to run a command, you’d call run() instead of createRuntime() (run() is an alias for createRuntime().run()):

public void testAbc() {

    CommandOutcome result ="--server")
    // ...

3.3. Common Test Scenarios

Among the things that can be tested are runtime services with real dependencies, standard output of full Bootique applications (i.e. the stuff that would be printed to the console if this were a real app), network services using real network connections (e.g. your REST API’s), and so on. Some examples are given below, outlining common techniques.

3.3.1. Testing Injectable Services

Services can be obtained from test runtime, their methods called, and assertions made about the results of the call:

public void testService() {

    BQRuntime runtime ="--config=src/test/resources/my.yml").createRuntime();

    MyService service = runtime.getInstance(MyService.class);
    assertEquals("xyz", service.someMethod());

3.3.2. Testing Network Services

If a test command starts a web server or some other network service, it can be accessed via a URL right after running the server. E.g.:

public void testServer() {"--server").run();

    // using JAX-RS client API
    WebTarget base = ClientBuilder.newClient().target("http://localhost:8080/");
    Response r1 = base.path("/somepath").request().get();
    assertEquals(Status.OK.getStatusCode(), r1.getStatus());
    assertEquals("{}", r1.readEntity(String.class));

3.3.3. Testing Commands

You can emulate a real app execution in a unit test, by running a command and then checking the values of the exist code and stdin and stderr contents:

public void testCommand() {

    TestIO io = TestIO.noTrace();
    CommandOutcome outcome = testFactory

    assertEquals(0, outcome.getExitCode());

3.3.4. Testing Module Validity

When you are writing your own modules, you may want to check that they are configured properly for autoloading (i.e. META-INF/services/io.bootique.BQModuleProvider is present in the expected place and contains the right provider. There’s a helper class to check for it:

public void testAutoLoadable() {

4. Part IV. Assembly and Deployment

4.1. Runnable Jar

To build a runnable jar, Bootique relies on maven-shade-plugin. To simplify its configuration, your app pom.xml may inherit from bootique-parent pom. In this case configuration would look like this:



This configuration will build an app with the framework-provided main class, namely io.bootique.Bootique. If you want to use a custom main class (and in most cases you do), you will need to redefine Maven main.class property:


If you want to avoid inheriting from the framework parent pom, you will need to explicitly provide the following unwieldy configuration similar to the one found in bootique-parent:


                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">

Either way, once your pom is configured, you can assemble and run your jar. E.g.:

mvn clean package
java -jar target/myapp-1.0.jar

4.2. Tracing Bootique Startup

To see what modules are loaded, to view full app configuration tree and to trace other events that happen on startup, run your app with -Dbq.trace option. E.g.:

java -Dbq.trace -jar target/myapp-1.0.jar --server

You may see an output like this:

Skipping module 'JerseyModule' provided by 'JerseyModuleProvider' (already provided by 'Bootique')...
Adding module 'BQCoreModule' provided by 'Bootique'...
Adding module 'JerseyModule' provided by 'Bootique'...
Adding module 'JettyModule' provided by 'JettyModuleProvider'...
Adding module 'LogbackModule' provided by 'LogbackModuleProvider'...
Merged configuration: {"log":{"logFormat":"[%d{\"dd/MMM/yyyy:HH:mm:ss,SSS\"}]
%t %p %X{txid:-?} %X{principal:-?} %c{1}: %m%n%ex"},"trace":""}
Printing configuration may expose sensitive information, like database passwords, etc. Make sure you use -Dbq.trace for debugging only and don’t leave it on permanently in a deployment environment.