Bedrock Core

DropWizard and other useful libraries packaged for common foundation of services

License

License

GroupId

GroupId

com.github.ptomli.bedrock
ArtifactId

ArtifactId

bedrock-core
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Bedrock Core
DropWizard and other useful libraries packaged for common foundation of services

Download bedrock-core

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.ptomli.bedrock/bedrock-core/ -->
<dependency>
    <groupId>com.github.ptomli.bedrock</groupId>
    <artifactId>bedrock-core</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.ptomli.bedrock/bedrock-core/
implementation 'com.github.ptomli.bedrock:bedrock-core:1.0.0'
// https://jarcasting.com/artifacts/com.github.ptomli.bedrock/bedrock-core/
implementation ("com.github.ptomli.bedrock:bedrock-core:1.0.0")
'com.github.ptomli.bedrock:bedrock-core:jar:1.0.0'
<dependency org="com.github.ptomli.bedrock" name="bedrock-core" rev="1.0.0">
  <artifact name="bedrock-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.ptomli.bedrock', module='bedrock-core', version='1.0.0')
)
libraryDependencies += "com.github.ptomli.bedrock" % "bedrock-core" % "1.0.0"
[com.github.ptomli.bedrock/bedrock-core "1.0.0"]

Dependencies

compile (27)

Group / Artifact Type Version
com.yammer.dropwizard : dropwizard-core jar 0.6.1
org.springframework : spring-aop jar 3.1.4.RELEASE
org.springframework : spring-context jar 3.1.4.RELEASE
org.springframework : spring-context-support jar 3.1.4.RELEASE
org.springframework : spring-core jar 3.1.4.RELEASE
org.springframework : spring-beans jar 3.1.4.RELEASE
org.springframework : spring-jdbc jar 3.1.4.RELEASE
org.springframework : spring-jms jar 3.1.4.RELEASE
org.springframework : spring-tx jar 3.1.4.RELEASE
org.springframework : spring-web jar 3.1.4.RELEASE
org.springframework : spring-webmvc jar 3.1.4.RELEASE
org.springframework.integration : spring-integration-core jar 2.2.1.RELEASE
org.springframework.integration : spring-integration-http jar 2.2.1.RELEASE
org.springframework.integration : spring-integration-jms jar 2.2.1.RELEASE
org.springframework.integration : spring-integration-jmx jar 2.2.1.RELEASE
org.springframework.integration : spring-integration-jdbc jar 2.2.1.RELEASE
org.springframework.integration : spring-integration-mail jar 2.2.1.RELEASE
org.springframework.integration : spring-integration-security jar 2.2.1.RELEASE
org.springframework.integration : spring-integration-ws jar 2.2.1.RELEASE
org.springframework.security : spring-security-acl jar 3.1.3.RELEASE
org.springframework.security : spring-security-config jar 3.1.3.RELEASE
org.springframework.security : spring-security-core jar 3.1.3.RELEASE
org.springframework.security : spring-security-crypto jar 3.1.3.RELEASE
org.springframework.security : spring-security-ldap jar 3.1.3.RELEASE
org.springframework.security : spring-security-web jar 3.1.3.RELEASE
org.hornetq : hornetq-core-client jar 2.2.21.Final
org.hornetq : hornetq-jms-client jar 2.2.21.Final

runtime (2)

Group / Artifact Type Version
org.jboss.javaee : jboss-jms-api jar 1.1.0.GA
org.slf4j : jcl-over-slf4j jar 1.7.2

test (6)

Group / Artifact Type Version
org.springframework : spring-test jar 3.1.4.RELEASE
org.springframework.integration : spring-integration-test jar 2.2.1.RELEASE
junit : junit jar 4.11
org.easytesting : fest-assert jar 1.4
org.mockito : mockito-core jar 1.9.5
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

A Solid Foundation

DropWizard provides a fantastic base on which you can build REST based services. Big up to @codahale and Yammer for making this available.

Bedrock takes this basis, adds some libraries and a bit more glue, and tries to make it easy to build services using the technologies I commonly use.

Bonus Features

Getting Started

	<dependency>
		<groupId>com.github.ptomli.bedrock</groupId>
		<artifactId>bedrock-core</artifactId>
		<version>2.0.0-SNAPSHOT</version>
	</dependency>

Simple Example

Below is a simple example of how you can easily integrate Spring configured beans into the DropWizard startup.

The code below:

  • Creates a ClassPathXmlApplicationContext, based on the Spring bean configuration files located in /META-INF/spring/*.xml.
  • Registers a Spring PropertySource with the Spring Environment, whose property values are resolved against the DropWizard configuration, prefixed with "config.".
  • Registers the DropWizard configuration as a Spring bean named "config".
  • Registers any HealthCheck beans, defined in Spring, with the DropWizard environment.
  • Registers any @Path annotated beans, defined in Spring, with the DropWizard environment.
    @Override
    public void run(Configuration configuration, Environment environment) {
        SpringServiceConfigurer.forEnvironment(environment)
            .withContext(ClassPathXmlApplicationContext.class, "classpath:/META-INF/spring/*.xml")
            .registerConfigurationPropertySource("config.", configuration)
            .registerConfigurationBean("config", configuration)
            .registerHealthChecks()
            .registerResources();
    }

Testing Dependencies

I'm a strong believer that consistency makes it a lot easier to deal with code. Testing is one of those areas where there tends to be, let's say, less rigorous attention to consistency. Having a good set of testing tools available, and no needing to go looking for a doodad or wotsit, tends to help keep things in line.

  • Spring Test
  • Spring Integration Test
  • AssertJ
  • Mockito

Status

Build Status Coverage Status Maven Central

License

Copyright 2013-2014 Paul Tomlin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
1.0.0