Java Code Geeks » Lubos Krnac http://www.javacodegeeks.com/ Java 2 Java Developers Resource Center Fri, 27 Mar 2015 17:00:16 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 How to mock Spring bean without Springockitohttp://www.javacodegeeks.com/2014/12/how-to-mock-spring-bean-without-springockito.html http://www.javacodegeeks.com/2014/12/how-to-mock-spring-bean-without-springockito.html#comments Mon, 29 Dec 2014 14:00:21 +0000 http://www.javacodegeeks.com/?p=35003 I work with Spring several years. But I was always frustrated with how messy can XML configuration become. As various annotations and possibilities of Java configuration were popping up, I started to enjoy programming with Spring. That is why I strongly entourage using Java configuration. In my opinion, XML configuration is suitable only when you ...

 

]]>
http://www.javacodegeeks.com/2014/12/how-to-mock-spring-bean-without-springockito.html/feed/ 0
How to encapsulate Spring beanhttp://www.javacodegeeks.com/2014/12/how-to-encapsulate-spring-bean.html http://www.javacodegeeks.com/2014/12/how-to-encapsulate-spring-bean.html#comments Sun, 28 Dec 2014 23:00:17 +0000 http://www.javacodegeeks.com/?p=35002 As far as I know Spring Framework doesn’t provide any mechanism to encapsulate Spring beans other than having separate contexts. So when you have public class registered in Spring’s Inversion of Control container, it can be autowired in any Spring bean from same context configuration. This is very powerful but it is also very dangerous. ...

 

]]>
http://www.javacodegeeks.com/2014/12/how-to-encapsulate-spring-bean.html/feed/ 0
Avoid unwanted component scanning of Spring Configurationhttp://www.javacodegeeks.com/2014/12/avoid-unwanted-component-scanning-of-spring-configuration.html http://www.javacodegeeks.com/2014/12/avoid-unwanted-component-scanning-of-spring-configuration.html#comments Mon, 01 Dec 2014 17:00:51 +0000 http://www.javacodegeeks.com/?p=33777 I came through interesting problem on Stack Overflow. Brett Ryan had problem that Spring Security configuration was initialized twice. When I was looking into his code I spot the problem. Let me show show the code. He has pretty standard Spring application (not using Spring Boot). Uses more modern Java servlet Configuration based on Spring’s ...

 

]]>
http://www.javacodegeeks.com/2014/12/avoid-unwanted-component-scanning-of-spring-configuration.html/feed/ 0
Black Box Testing of Spring Boot Microservice is so easyhttp://www.javacodegeeks.com/2014/12/black-box-testing-of-spring-boot-microservice-is-so-easy.html http://www.javacodegeeks.com/2014/12/black-box-testing-of-spring-boot-microservice-is-so-easy.html#comments Mon, 01 Dec 2014 14:00:39 +0000 http://www.javacodegeeks.com/?p=33776 When I needed to do prototyping, proof of concept or play with some new technology in free time, starting new project was always a little annoying barrier with Maven. Have to say that setting up Maven project is not hard and you can use Maven Archetypes. But Archetypes are often out of date. Who wants ...

 

]]>
http://www.javacodegeeks.com/2014/12/black-box-testing-of-spring-boot-microservice-is-so-easy.html/feed/ 0
eclipse-pmd – New PMD plugin for Eclipsehttp://www.javacodegeeks.com/2014/08/eclipse-pmd-new-pmd-plugin-for-eclipse.html http://www.javacodegeeks.com/2014/08/eclipse-pmd-new-pmd-plugin-for-eclipse.html#comments Tue, 19 Aug 2014 22:00:41 +0000 http://www.javacodegeeks.com/?p=29084 I am Eclipse user. So when I wanted to analyze my code by PMD, I needed to use “PMD for Eclipse” plugin. This plugin used to be very buggy, which was enhanced in later versions (currently 4.0.3). But the performance is really bad sometimes. Especially when you are dealing with relatively big codebase and have ...

 

]]>
http://www.javacodegeeks.com/2014/08/eclipse-pmd-new-pmd-plugin-for-eclipse.html/feed/ 0
Spring Security Misconfigurationhttp://www.javacodegeeks.com/2014/06/spring-security-misconfiguration.html http://www.javacodegeeks.com/2014/06/spring-security-misconfiguration.html#comments Mon, 16 Jun 2014 10:00:56 +0000 http://www.javacodegeeks.com/?p=26587 I recently saw Mike Wienser’s SpringOne2GX talk about Application Security Pitfalls. It is very informative and worth watching if you are using Spring’s stack on servlet container. It reminded me one serious Spring Security Misconfiguration I was facing once. Going to explain it on Spring’s Guide Project called Securing a Web Application. This project uses ...

 

]]>
http://www.javacodegeeks.com/2014/06/spring-security-misconfiguration.html/feed/ 0
JavaScript multi module project – Continuous Integrationhttp://www.javacodegeeks.com/2014/06/javascript-multi-module-project-continuous-integration.html http://www.javacodegeeks.com/2014/06/javascript-multi-module-project-continuous-integration.html#comments Wed, 04 Jun 2014 04:00:59 +0000 http://www.javacodegeeks.com/?p=26052 JavaScript multi module project Few days ago, I wrote blog post about JavaScript multi module project with Grunt. This approach allows you to split application into various modules. But at the same time it allows you to create one deployment out of these modules. It was inspired by Maven multi module concept (Maven is build ...

 

]]>
http://www.javacodegeeks.com/2014/06/javascript-multi-module-project-continuous-integration.html/feed/ 0
Load inheritance tree into List by Springhttp://www.javacodegeeks.com/2014/05/load-inheritance-tree-into-list-by-spring.html http://www.javacodegeeks.com/2014/05/load-inheritance-tree-into-list-by-spring.html#comments Mon, 05 May 2014 13:00:03 +0000 http://www.javacodegeeks.com/?p=24958 I noticed interesting Spring feature. One of my colleagues used it for loading whole inheritance tree of Spring beans into list. Missed that when I was studying Spring docs. Let’s have this inheritance tree of Spring beans:             In following snippet is this tree of beans loaded into list with ...

 

]]>
http://www.javacodegeeks.com/2014/05/load-inheritance-tree-into-list-by-spring.html/feed/ 1
Trigger Continuous Delivery every GitHub commithttp://www.javacodegeeks.com/2014/03/trigger-continuous-delivery-every-github-commit.html http://www.javacodegeeks.com/2014/03/trigger-continuous-delivery-every-github-commit.html#comments Mon, 24 Mar 2014 05:00:36 +0000 http://www.javacodegeeks.com/?p=23042 Crucial piece of puzzle when developing web application is Continuous Delivery. Testers or users can by early access to alpha version contribute to development process. Design,  requirements, architecture or performance problems can be catched much sooner. I am going to show how to set up this process with usage of Maven and Jenkins. Target environment ...

 

]]>
http://www.javacodegeeks.com/2014/03/trigger-continuous-delivery-every-github-commit.html/feed/ 0
Deploy to Maven Central Repositoryhttp://www.javacodegeeks.com/2014/03/deploy-to-maven-central-repository.html http://www.javacodegeeks.com/2014/03/deploy-to-maven-central-repository.html#comments Mon, 10 Mar 2014 08:00:13 +0000 http://www.javacodegeeks.com/?p=22578 Do you need to make your Java library publicly accessible? Is your project hosted on GitHub? Do you like idea of “all-in-one deploy to Maven Central Repository” button? I am going to show how to set it up with usage of maven-release-plugin. Source code is hosted on GitHub, so SSH access to source control will ...

 

]]>
http://www.javacodegeeks.com/2014/03/deploy-to-maven-central-repository.html/feed/ 0