Patching a Maven library with your custom class.

Sometimes you use a library that has a bug. Or maybe it doesn’t has a bug but you want to change something. Of course if it is an open source you can get the sources… build them … with your change and so on. However this first takes a lot of time and second you need the sources.What you usually want .. is to just replace one class.. or few classes with something custom… maybe add a line .. or remove a line and so on. Yesterday… I had an issue with jboss-logging. The version I was using was 3.2.0Beta1 and it turns out that using this version and log4j2 2.0 final basically meant that no log is send to log4j2. The reason was a null pointer exception that was catched in jboss logging class called Log4j2Logger. The bug I submitted is here https://issues.jboss.org/browse/JBLOGGING-107 and it was fixed at the same day. However I will use it as an example since I didn’t knew when this will be fixed.. and I didn’t want to wait till it is fixed.So I was thinking what I want.. to take the jboss-logging  jar  and replace the file called Log4j2Logger. Basically as you can see in the bug I wanted to replace line 54 to be :instead of : this.logger.log(null, loggerClassName, translatedLevel,parameters == null || parameters.length == 0 ? this.messageFactory.newMessage(message) :this.messageFactory.newMessage(String.valueOf(message), parameters),thrown); to become : this.logger.log(translatedLevel, parameters == null || parameters.length == 0 ? this.messageFactory.newMessage(message) : this.messageFactory.newMessage(String.valueOf(message), parameters), And that’s it. Of course I didn’t wanted to do this manually with zip but to use maven as well. So what I did: 1)...

Patching a Maven library with your custom class.

Sometimes you use a library that has a bug. Or maybe it doesn’t has a bug but you want to change something. Of course if it is an open source you can get the sources… build them … with your change and so on. However this first takes a lot of time and second you need the sources.What you usually want .. is to just replace one class.. or few classes with something custom… maybe add a line .. or remove a line and so on. Yesterday… I had an issue with jboss-logging. The version I was using was 3.2.0Beta1 and it turns out that using this version and log4j2 2.0 final basically meant that no log is send to log4j2. The reason was a null pointer exception that was catched in jboss logging class called Log4j2Logger. The bug I submitted is here https://issues.jboss.org/browse/JBLOGGING-107 and it was fixed at the same day. However I will use it as an example since I didn’t knew when this will be fixed.. and I didn’t want to wait till it is fixed.So I was thinking what I want.. to take the jboss-logging  jar  and replace the file called Log4j2Logger. Basically as you can see in the bug I wanted to replace line 54 to be :instead of : this.logger.log(null, loggerClassName, translatedLevel,parameters == null || parameters.length == 0 ? this.messageFactory.newMessage(message) :this.messageFactory.newMessage(String.valueOf(message), parameters),thrown); to become : this.logger.log(translatedLevel, parameters == null || parameters.length == 0 ? this.messageFactory.newMessage(message) : this.messageFactory.newMessage(String.valueOf(message), parameters), And that’s it. Of course I didn’t wanted to do this manually with zip but to use maven as well. So what I did: 1)...

Patching a Maven library with your custom class.

Sometimes you use a library that has a bug. Or maybe it doesn’t has a bug but you want to change something. Of course if it is an open source you can get the sources… build them … with your change and so on. However this first takes a lot of time and second you need the sources.What you usually want .. is to just replace one class.. or few classes with something custom… maybe add a line .. or remove a line and so on. Yesterday… I had an issue with jboss-logging. The version I was using was 3.2.0Beta1 and it turns out that using this version and log4j2 2.0 final basically meant that no log is send to log4j2. The reason was a null pointer exception that was catched in jboss logging class called Log4j2Logger. The bug I submitted is here https://issues.jboss.org/browse/JBLOGGING-107 and it was fixed at the same day. However I will use it as an example since I didn’t knew when this will be fixed.. and I didn’t want to wait till it is fixed.So I was thinking what I want.. to take the jboss-logging  jar  and replace the file called Log4j2Logger. Basically as you can see in the bug I wanted to replace line 54 to be :instead of : this.logger.log(null, loggerClassName, translatedLevel,parameters == null || parameters.length == 0 ? this.messageFactory.newMessage(message) :this.messageFactory.newMessage(String.valueOf(message), parameters),thrown); to become : this.logger.log(translatedLevel, parameters == null || parameters.length == 0 ? this.messageFactory.newMessage(message) : this.messageFactory.newMessage(String.valueOf(message), parameters), And that’s it. Of course I didn’t wanted to do this manually with zip but to use maven as well. So what I did: 1)...

Java2Days conference in Bulgaria, Europe 8-9/10/09

Java2Days conference is a brand new event in Eastern Europe to present the latest trends in Java development. Java2Days will be held at the Inter Expo Center on 8-9 October in Sofia, Bulgaria. The conference is hosted by Insight_technologies and the Bulgarian National Academy for Software Development. The conference is the first of its kind to be held in Eastern Europe, focused to highlight today’s cutting edge trends in building software applications with Java development tools. Over two days, more than 600 attendees will meet world famous lecturers, engaged all year round in such events as JavaOne, The ServerSide Java Symposium, Jazoon showcasing their latest knowledge in creating more reliable, scalable and secure solutions using Java technologies in more than 20 technical sessions. The major purpose of the event is to become a place for passionate Java developers to get in touch with the latest technologies, to become a significant part of the global Java community and to learn from the best. Registration Prices VIP Pass – 175 EUR VIP Java2Days Pass Includes: Access to all sessions Eco bag with advertising materials VIP promoting gifts Coffee breaks Front row seating DVD with all conference materials, video, photos and etc. Q & A session with the lecturers Standard Pass – 110 EUR Standard Java2Days Pass Includes: Access to all sessions Eco bag with advertising materials Coffee breaks Q & A session with the lecturers You can add to your pass: Lunch – 10 EUR per day The buffet lunch is in a separate hall with plenty of salads, different kinds of meats, vegetarian dishes and desserts. Special dinner on 8th...

Java2Days conference in Bulgaria, Europe 8-9/10/09

Java2Days conference is a brand new event in Eastern Europe to present the latest trends in Java development. Java2Days will be held at the Inter Expo Center on 8-9 October in Sofia, Bulgaria. The conference is hosted by Insight_technologies and the Bulgarian National Academy for Software Development. The conference is the first of its kind to be held in Eastern Europe, focused to highlight today’s cutting edge trends in building software applications with Java development tools. Over two days, more than 600 attendees will meet world famous lecturers, engaged all year round in such events as JavaOne, The ServerSide Java Symposium, Jazoon showcasing their latest knowledge in creating more reliable, scalable and secure solutions using Java technologies in more than 20 technical sessions. The major purpose of the event is to become a place for passionate Java developers to get in touch with the latest technologies, to become a significant part of the global Java community and to learn from the best. Registration Prices VIP Pass – 175 EUR VIP Java2Days Pass Includes: Access to all sessions Eco bag with advertising materials VIP promoting gifts Coffee breaks Front row seating DVD with all conference materials, video, photos and etc. Q & A session with the lecturers Standard Pass – 110 EUR Standard Java2Days Pass Includes: Access to all sessions Eco bag with advertising materials Coffee breaks Q & A session with the lecturers You can add to your pass: Lunch – 10 EUR per day The buffet lunch is in a separate hall with plenty of salads, different kinds of meats, vegetarian dishes and desserts. Special dinner on 8th...

Java2Days conference in Bulgaria, Europe 8-9/10/09

Java2Days conference is a brand new event in Eastern Europe to present the latest trends in Java development. Java2Days will be held at the Inter Expo Center on 8-9 October in Sofia, Bulgaria. The conference is hosted by Insight_technologies and the Bulgarian National Academy for Software Development. The conference is the first of its kind to be held in Eastern Europe, focused to highlight today’s cutting edge trends in building software applications with Java development tools. Over two days, more than 600 attendees will meet world famous lecturers, engaged all year round in such events as JavaOne, The ServerSide Java Symposium, Jazoon showcasing their latest knowledge in creating more reliable, scalable and secure solutions using Java technologies in more than 20 technical sessions. The major purpose of the event is to become a place for passionate Java developers to get in touch with the latest technologies, to become a significant part of the global Java community and to learn from the best. Registration Prices VIP Pass – 175 EUR VIP Java2Days Pass Includes: Access to all sessions Eco bag with advertising materials VIP promoting gifts Coffee breaks Front row seating DVD with all conference materials, video, photos and etc. Q & A session with the lecturers Standard Pass – 110 EUR Standard Java2Days Pass Includes: Access to all sessions Eco bag with advertising materials Coffee breaks Q & A session with the lecturers You can add to your pass: Lunch – 10 EUR per day The buffet lunch is in a separate hall with plenty of salads, different kinds of meats, vegetarian dishes and desserts. Special dinner on 8th...