SoLong Application

An Application Harness Library

License

License

GroupId

GroupId

uk.co.solong
ArtifactId

ArtifactId

application
Last Version

Last Version

0.0.17
Release Date

Release Date

Type

Type

jar
Description

Description

SoLong Application
An Application Harness Library
Source Code Management

Source Code Management

https://github.com/danielburrell/application

Download application

How to add to project

<!-- https://jarcasting.com/artifacts/uk.co.solong/application/ -->
<dependency>
    <groupId>uk.co.solong</groupId>
    <artifactId>application</artifactId>
    <version>0.0.17</version>
</dependency>
// https://jarcasting.com/artifacts/uk.co.solong/application/
implementation 'uk.co.solong:application:0.0.17'
// https://jarcasting.com/artifacts/uk.co.solong/application/
implementation ("uk.co.solong:application:0.0.17")
'uk.co.solong:application:jar:0.0.17'
<dependency org="uk.co.solong" name="application" rev="0.0.17">
  <artifact name="application" type="jar" />
</dependency>
@Grapes(
@Grab(group='uk.co.solong', module='application', version='0.0.17')
)
libraryDependencies += "uk.co.solong" % "application" % "0.0.17"
[uk.co.solong/application "0.0.17"]

Dependencies

compile (5)

Group / Artifact Type Version
io.github.classgraph : classgraph jar 4.2.0
org.apache.commons : commons-lang3 jar 3.9
org.springframework.boot : spring-boot-autoconfigure jar 2.1.6.RELEASE
org.springframework : spring-context jar 5.1.8.RELEASE
org.slf4j : slf4j-api jar 1.7.26

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Application is a library which provides a set of standard application and configuration classes based on common usage patterns and in particular for use with the spring framework.

Quickstart

Maven

<dependency>
    <groupId>uk.co.solong</groupId>
    <artifactId>application</artifactId>
    <version>0.0.18</version>
</dependency>

AutoAnnotationSpringBootApplication

We recommend you use the AutoAnnotationSpringBootApplication class to enable you to start a SpringBoot application by automatically searching for a @RootConfiguration annotated class.

Single RootConfiguration Example

Create your standard SpringConfig class and add @RootConfiguration in addition to the regular spring @Configuration annotation.

@Import({ PropertyPlaceholderConfig.class, ... })
@Configuration
@RootConfiguration
public class Config {

}

Then when you use the maven-assembly-plugin, simply provide AutoAnnotationApplication as the main class. No need to pass the name of the RootConfiguration class. This is useful since the pom file does not need refactoring should the package change or root configuration class be renamed.

<programs>
   <program>
      <mainClass>uk.co.solong.application.main.spring.java.AutoAnnotationSpringBootApplication</mainClass>
      <id>start</id>
      <jvmSettings>
         <initialMemorySize>20m</initialMemorySize>
         <maxMemorySize>256m</maxMemorySize>
         <maxStackSize>128m</maxStackSize>
         <systemProperties>
            <systemProperty>logback.configurationFile=logback-prod.xml</systemProperty>
            <systemProperty>APP_ENV=prod</systemProperty>
         </systemProperties>
      </jvmSettings>
   </program>
</programs>

That's it! Nothing more to do!

Advanced examples

More advanced examples (including handling multiple RootConfiguration classes in the same library/classpath can be found on [this advanced example page](Advanced Examples)


NamedAnnotationApplication

The NamedAnnotationApplication starts an application when given the fully qualified name of the Root configuration class as an explicit arg parameter. The class must exist, or the application will fail.

In the example below, the class com.company.config.Config is explicitly passed as a commandline argument in the maven assembler plugin.

package com.company.config;

@Import({ PropertyPlaceholderConfig.class, ... })
@Configuration
public class Config {

}
<programs>
    <program>
        <mainClass>uk.co.solong.application.main.spring.java.NamedAnnotationApplication</mainClass>
        <id>start</id>
        <commandLineArguments>
            <commandLineArgument>com.company.config.Config</commandLineArgument>
        </commandLineArguments>
        <jvmSettings>
            <initialMemorySize>20m</initialMemorySize>
            <maxMemorySize>256m</maxMemorySize>
            <maxStackSize>128m</maxStackSize>
            <systemProperties>
                <systemProperty>logback.configurationFile=logback-prod.xml</systemProperty>
                <systemProperty>APP_ENV=prod</systemProperty>
            </systemProperties>
        </jvmSettings>
    </program>
</programs>

Developer Guide

The developer guide explains how to setup the developer environment. The sdlc guide page describes how to cut a release, publish artifacts to the central repository or github.

Versions

Version
0.0.17
0.0.16
0.0.15
0.0.14
0.0.13
0.0.12
0.0.11
0.0.10
0.0.9
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1