Embracing the Messiness in Search of Epic Solutions

Category: Programming Language

  • SonarQube: Building Specific Module in Multi-Module Project

    Let’s assume we have a multi-module project that looks something like this:- To build certain module(s) within the project, we can use the sonar.skippedModules option to skip the modules we don’t need. For example, the following configuration in Jenkins will only build app-jar module in SonarQube:- Read More…

  • Maven: Building Specific Module in Multi-Module Project

    Let’s assume we have a multi-module project that looks something like this:- To build certain module(s) within the project, we can use the -pl option. For example, the following mvn command will only build app-jar module:- Read More…

  • IntelliJ: Auto-generating POJO Builder

    I have been searching for an elegant way to auto-generate a POJO fluent builder with minimal typing and configuration. A builder is a great way to promote object immutability, however it is also a pain to create and mantain yet another class that looks almost like the POJO class we create. There are a few Read More…

  • FindBug: Solving DM_DEFAULT_ENCODING Warning When Using FileWriter

    PROBLEM Let’s assume we have the following code to write some data into a file:- When running this code against a static code analysis tool, such as Findbugs, we get this high priority warning:- The Javadoc for FileWriter says:- Obviously, this class is too convenient and FindBugs is not happy about it. Further, there is Read More…

  • Maven: Excluding All Transitive Dependencies

    I have been using Maven 3.0.3 on my work machine since 2011 because that particular version was released in March that year. How time flies by… Maven 3.2.1 was released exactly a month ago. One feature that immediately jumps out is the ability to exclude a dependency’s transitive dependencies in a very simple manner, which Read More…

  • Comparing Disassembled Java Class From JVM Languages

    All JVM languages come with some degrees of syntactic sugar to make the code easier to read and write. To satisfy my curiosity, I decided to run javap command to disassemble the bytecode inside the class file generated from several JVM languages. The chosen languages are Java, Groovy, Scala, JRuby and Rhino. I left out Read More…