Dockerizing your apps

Preface As some of you may already know, from the last autumn-2015 I’m working as a software engineer in startup company called Upwork, in one of teams. From the time I started working there, I realized, that working on freelance basis is completely different from office work, even if you’re working on a good quality freelance job. Why ? At least, because you cant share some knowledge with your coworkers by cuf of coffee in your lunch time. So I decided to convert my blog to some R&D investigation. That’s why I’d like to warn you, that everything here is just an investigation, which I do on my free time, so don’t take it so critically, if you find something, which you don’t agree with, just comment, and let’s discuss. Technologies are changing every day, and we need to follow the trend, don’t we ? Why containers ? Before I can proceed with explanation in my head what is the definition of container, let’s return to the near part times, where we did everything manually: the dyno age, where it was ok to assemble your proeject war manually, and deploy it to the server in the same way. Then, the...

Lazybones - a cool instrument, which can save your time during a project setup

How long does it takes for you to create a new project ? And how often are you doing this routine job ? Do you remember, how interesting for you is to test some feature, which you want to test/try, but how hard is it to configure initial project ? There’s so many frameworks in java world, and for me it’s extremely hard to remember initial steps and configurations for each of them. And logically, if you do al this teps by your hands, then something can potencially go wrong Let’s start with a question “Why you need to create a new project”: You’d like to test something in your favorite project. You’re working in a microserviced worlds, and you start new microservice every day… You need to create a POC and test how it works. Anything else Personally I don’t want to store all this configuration steps in my head, and I prefer to use something, which can the work for me. That’s why I’d like to recommend a cool instrument for creating project skeletons in extremely convenient way - lazybones. Let’s demonstrate how to setup a Gatling project lazybones create\?file_path\ load-tests Quite easy, don’t you find ?...

How to work with maven javacc plugin

I had to do some work with google-visualization-java github project. I needed to change some logic for correct google visualization query. I found, that guys were using javacc compiler. Official site says: Java Compiler Compiler tm (JavaCC tm) is the most popular parser generator for use with Java tm applications. A parser generator is a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar. In addition to the parser generator itself, JavaCC provides other standard capabilities related to parser generation such as tree building (via a tool called JJTree included with JavaCC), actions, debugging, etc. To inject javacc inside your maven project, add following plugin <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>javacc-maven-plugin</artifactId> <version>2.5</version> <executions> <execution> <id>javacc</id> <goals> <goal>javacc</goal> </goals> <configuration> <sourceDirectory>${basedir}/src/main/java</sourceDirectory> </configuration> </execution> </executions> </plugin> Steps you need to do with your javacc project: Open terminal cd to project mvn clean generate-sources That’s it.

Multiple javax.inject.Provider implementations and their binding

Hi everyone! Recently I became a freelancer and started to work for one big company. It’s great, I hope to continue work there.And I also started to work on project where Dropwizard stack is used.Naturally, Guice DI framework is used ther.So, today I would like to write an article about how to bind javax.inject.Provider interfaces to their implementation. The thing is that Guice treat javax.inject.Provider specially, and you cannot just to Because Provider is a generic interface, and google care about initializing this Providers. So, to do that - just do the following There’s no special magic there, you just need to specify generic from your Provider and how to name it.And then u can do something like this See you!

Always add a clean phase in your build execution

Today I faced an issue on Jenkins. I needed to fix jenkins job, which is getting info about sonar metrics, and received an error in job console It was weird for me, because I was getting success jobs, everything went right, but as soon as I failed one job due to bad configuration - hell started, and I couldn’t understand why there my job is failing all the time.So I began experiments. After several tries I managed to add prefix clean phase and everything worked. Another problem was that I was building this job with different parameters and depending on specific parameter I was receiving specific console output.But then I understood that the problem was that I had constant artifacts, that were not cleaned. And I was receiving different output because this parameter was a version of plugin , so that’s why I received different output.