Get rid of the list null-checks

During development of the legacy Java applications, we still have to deal with null. It’s possible to avoid it completly when we’re designing application from the scratch, applying proper code constructions, static code analysis and we’re consistent during code reviews. Nevertheless in majority of the cases we will encounter null in daily projects. We may even expect them in the method inputs and we have to be prepared for it. With the functional programming in Java we can deal with them in quite elegant way, but I often see people are not using features available nowadays. ...

July 28, 2019 · 2 min · 355 words · Piotr Wittchen

Arch Linux - installation notes no. 2 (GUI and utils)

Introduction In my previous article I roughly described Arch Linux installation process. After going through whole process, we will end up with clean terminal without any graphical environment etc. In most cases, we will need it on the desktop. Desktop Environment (DE) / Windows Manager (WM) There are two main types of the Linux graphical environments for desktop: Window Managers Desktop Environments Window Managers are much simpler, require a lot of configuration, learning how to use them and you see all windows at once. Moreover, usually you can use them without a mouse and mouse is useless most of the time because you cannot drag and drop windows. Once you master it, working with Window Manager can be very efficient. Example of popular Window Manager is i3. This environments are also lightweight. On the other hand, we have Desktop Environments. They’re full of features, windows can be stacked one on another and you can drag and drop them. Several Desktop Environments are extensible through plugins. These kind of graphical interfaces are known to majority of computer users. You can see them on Windows or macOS. Examples of the popular Linux Desktop Environments are Gnome, Xfce and KDE. Of course, mentioned Window Managers and Desktop Environments are not the only avaiable. There are more. I just mentioned these because I’ve heard about them or tried them. ...

July 27, 2019 · 5 min · 900 words · Piotr Wittchen

Arch Linux - installation notes

Introduction For a long time, I was considering switching from Ubuntu do Arch Linux distribution, but I didn’t have enough knowledge, time and energy to do this. I definitely knew it requires some specific knowledge and manual steps to perform. I also didn’t wat to spend too much time on reading the documentation. Moreover, I know that sometimes I could have specific issues related to my hardware, which are not listed in documentation and I have to deal with them on my own. Due to these facts I was discouraged to install Arch. Recently, I found awesome video about Full Arch Linux Install by Luke Smith where everything is explained very clearly in each step. I watched it one time without doing anything and then, watched it next time performing all the steps described there. I had a few issues related to my hardware and BIOS, but I managed to install Arch on my ThinkPad T470s thanks to this video. During the installation, I made a few notes for myself for the future possible installations. Maybe you’ll find them useful too. The whole process is actually simpler than I thought. It just requires some practical knowledge about Linux, patience and “can do” attitude. I divided this article into steps and sub-steps, which are required to perform the installation. Please, keep in mind the fact that in the end of the installation, we will have an empty command prompt with plain OS without any GUI and we will have to install the graphical environment from the terminal. It will not be covered in this article, but I think, I’ll cover it in another one. Of course, this article contains just my notes, which help me understand everything well because and I like documenting this kind of things for the future. If you searching for Arch installation guide, I recommend you to see linked video or an official Arch installation guide in Arch Wiki. This article can be additional resource to this stuff. ...

July 24, 2019 · 11 min · 2244 words · Piotr Wittchen

Zen of the Java library release process

In my previous article I published information about publishing JAR/AAR library to the Maven Central Repository. A few steps of that process were automated, but a few of them were still manual. I mean closing and release process which had to be done by manual clicking on the Sonatype website. Fortunately, it’s possible to automate it. In order to do that, I used gradle-nexus-staging-plugin developed by Codearte. Thanks to this plugin I could get rid of the remaining manual steps left in the release process. ...

June 8, 2019 · 2 min · 367 words · Piotr Wittchen

Publishing a JAR/AAR to the Maven Central

Introduction As a Java/JVM/Android developers we rely on the work of other people through frameworks and libraries. Many of them are open-source. Most of the developers are consumers of such projects. What if we would like to create our own library and distribute it to other developers? We can always create it and share a *.jar or *.aar file with others. Drawback of such solution is the fact that source of distribution may not be trusted. We also have problems with versioning. Consumers of the library have to constantly download and update their files. It’s much better to publish our library to Maven Central Repository and allow others to easily and seamlessly add it as an external dependency to pom.xml file (in case of Maven) or build.gradle file (in case of Gradle). In such case, dependency is managed by the appropriate build system and distributed via trusted source. This may be not easy for the first time that’s why I decided to collect information related to this topic in a single article. Let’s see how to do this. ...

May 24, 2019 · 5 min · 1045 words · Piotr Wittchen