Monday, June 12, 2017

Play unit tests execution

Anyone coming from the Java/maven ecosystem is used to run unit tests in all combinations: all tests upon building the project, from IDE (i.e. eclipse) as an individual test class or as a particular test case inside the class.
Let's see how this may be done for a Play project.

Thursday, May 18, 2017

Customizing external maven settings

Maven configuration happens on several levels. Mostly the configuration is just the project pom.xml. There are several things related to the environment, which cannot be defined in the pom.xml. Such additional settings may be provided with the external file.

Monday, May 15, 2017

Play framework getting started with sbt

The earlier post introduces to Play, sbt and activator versions and the differences in the installation procedures.
This post describes the Play installation procedures with the sbt. The procedure is relevant for the sbt version 0.13.13 or higher.

Play framework getting started with activator

The earlier post introduces to Play, sbt and activator versions and the differences in the installation procedures.
This post describes the Play installation procedures with the activator. The procedure is relevant for the sbt version before 0.13.13.

Tuesday, February 21, 2017

Using Apache HttpClient Fluent API

The Apache HttpClient provides reach functionality and flexibility for implementing of HTTP client java applications.
The Fluent API is an easy facade to the basic HttpClient functionality. It may be quite sufficient for simple applications, which should not deal with connection management, resources allocation or other advance stuff. The fluent API concept is designed to call methods in chain, which makes code rather compact and intuitive.

Tuesday, February 14, 2017

Proxy setting for Play activator and sbt

When running behind the proxy the activator should be provided with the appropriate proxy settings. Since the activator is using the sbt as a build tool, actually it is the sbt, which should be configured.

The sbt respects any HTTP, HTTPS, or FTP proxy settings from the standard environment variables.

Friday, February 3, 2017

How to fix Log4j2 problem with maven shade plugin

The maven shade plugin is used for packaging of the project classes and dependencies in a single jar (so called uber-jar).
Having one fat jar is very convenient for execution: it is enough to specify in the class path the uber-jar name instead of the long list of dependency jars.

Wednesday, January 4, 2017

How to reuse java tests in other projects

It often happens that tests or classes, defined under the test folder, are relevant for another projects.
It is possible to share the test classes by creating a test-jar for the "home" project. The other project can use the tests by adding the test-jar as a dependency.
The post explains, how to add test-dependency in maven and sbt projects.

Sunday, January 1, 2017

Custom injection binding with Guice in Play

This post sequels the earlier one and explains, how to implement custom injection binding in Play.
You can read also this Practical guide to Guice, which explains how to work with Guice.

Custom injection binding in Play may be done with @ImplementedBy annotation or in a programmatic way with Guice module.

About the author

My Photo
I trust only simple code and believe that code should be handsome. This is not a matter of technology, but professional approach, consolidated after years of software development. I enjoy to cause things working and feel very happy, when I manage to solve a problem.
Back to Top