MAVEN / NOTES</>↗Maven21 Feb 2016
The following configuration will use Google’s mirror of the Maven Central repository. Alter your ${M2_HOME}/conf/settings.xml or ${user.home}/.m2/settings.xml to add the mirror as seen in the following configuration file. <?xml version="1.0" encoding="UTF-8"?> <settings> . . <mirrors> <mirror> <id>google-maven-central</id> <name>Google Maven Central</name> <url>https://maven-central.storage.googleapis.com</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> . . </settings>
MAVEN / NOTES</>↗Maven21 Feb 2016
When we work behind a proxy server, we need to configure Maven to be able to connect to the internet. To enable proxy we can configure Maven settings.xml file, either in ${M2_HOME}/conf/settings.xml or ${user.home}/.m2/settings.xml file. <?xml version="1.0" encoding="UTF-8"?> <settings> . . <proxies> <proxy> <id>my-proxy</id> <active>true</active> <protocol>http</protocol> <host>proxy.example.org</host> <port>8080</port> <username>username</username> <password>password</passw...
CORE API / NOTES</>↗Core API17 Feb 2016
In the following code snippet we will learn how to load files from resource directory. Resource files can be in a form of image, audio, text, etc. Text resource file for example can be used to store application configurations, such as database configuration. To load this resource file you can use a couple methods utilizing […]
CORE API / NOTES</>↗Core API15 Feb 2016
This code snippet will show you how to create array variable and initialized it with a non-default value. By default, when we create an array of something in Java all entries will have its default value. For primitive types like int, long, float the default value are zero (0 or 0.0). For reference types (anything […]
CORE API / NOTES</>↗Core API11 Feb 2016
You have a problem displaying the % sign when you want to print a number in percentage format using the printf() method. Because the % sign is use as a prefix of format specifiers, you need to escape it if you want to display the % sign as part of the output string. To escape […]
JAVA DATE TIME API / NOTES</>↗Java Date Time API11 Feb 2016
In the previous post, How do I find the difference between two times?, we get the difference between two LocalTime objects in seconds measurement. In this example we will get the difference between two LocalDateTime objects and get the difference between these objects in years, months, days, hours, minutes, seconds and milliseconds. package org.kodejava.datetime; import […]