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.

Getting started with Gradle

It’s been a long time since gradle become so popular framework.Year ago I tried to build one project using gradle with my coworkers, but as for me, I didn’t understand all the upsides and downsides of this framework. So, today I dedicated one day for investigating this framework and I would like to make some review of it. The author of this beatiful framework is Hans Dockter Gradle is a dynamic build tool. That’s mean, that you can use this build tool not only for java, but for any language, that can provide plugin for itselft. Gradle is a live project. I mean, Gradle is one of the biggest open source projects in the world, there is 1.5 million builds using gradle every day. ##Agenda Gradle setup Short introduction to Gradle Build Single Module Project setup ####Gradle setup If we are using Windows or Linux or OS X, we can install Gradle by following steps: Download the binaries from the downloads page. Unpack the zip file and add the GRADLE_HOME/bin directory to the PATH environment variable. On linux or OS X, just do following: Open your terminal Type nano .bashrc And modify this file as in example below Then restart...

Spring Security: Avoiding Basic Authentication window in your browser

While tunnning your Spring application with Basic Authentication security you can notice that you are receiving Basic Aithentication window in your browser. The problem is with BasicAuthenticationEntryPoint that sends header WWW-Authenticate: Basic realm="nmrs_m7VKmomQ2YM3:" So, if you don’t want to receive this window in your browser, just create Custom Entry Point: