https://github.com/harisekhon/lib-java
Java Utility library for my other repos
https://github.com/harisekhon/lib-java
cli gradle hacktoberfest java library maven nagios-plugins sbt tools unit-test unit-testing unit-tests
Last synced: 4 months ago
JSON representation
Java Utility library for my other repos
- Host: GitHub
- URL: https://github.com/harisekhon/lib-java
- Owner: HariSekhon
- License: mit
- Created: 2015-05-31T18:08:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-03-14T19:37:34.000Z (7 months ago)
- Last Synced: 2025-03-14T20:31:58.245Z (7 months ago)
- Topics: cli, gradle, hacktoberfest, java, library, maven, nagios-plugins, sbt, tools, unit-test, unit-testing, unit-tests
- Language: Java
- Homepage: https://www.linkedin.com/in/HariSekhon
- Size: 867 KB
- Stars: 1
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Hari Sekhon Java Library
[](https://github.com/HariSekhon/lib-java/stargazers)
[](https://github.com/HariSekhon/lib-java/network)
[](https://github.com/boyter/scc/)
[](https://github.com/boyter/scc/)
[](https://github.com/HariSekhon/lib-java/blob/master/LICENSE)
[](https://www.linkedin.com/in/HariSekhon/)
[](https://github.com/HariSekhon/lib-java/commits/master)[](https://www.codacy.com/gh/HariSekhon/lib-java/dashboard)
[](https://www.codefactor.io/repository/github/harisekhon/lib-java)
[](https://lgtm.com/projects/g/HariSekhon/lib-java/context:java)
[](https://sonarcloud.io/dashboard?id=HariSekhon_lib-java)
[](https://sonarcloud.io/dashboard?id=HariSekhon_lib-java)
[](https://sonarcloud.io/dashboard?id=HariSekhon_lib-java)
[](https://sonarcloud.io/dashboard?id=HariSekhon_lib-java)
[](https://sonarcloud.io/summary/new_code?id=HariSekhon_lib-java)
[](https://coveralls.io/github/HariSekhon/lib-java?branch=master)
[](https://lgtm.com/projects/g/HariSekhon/lib-java/alerts/)[](https://github.com/HariSekhon/lib-java)
[](https://github.com/HariSekhon/lib-java)
[](https://hub.docker.com/r/harisekhon/centos-github)
[](https://github.com/HariSekhon/Dockerfiles)
[](https://hub.docker.com/r/harisekhon/centos-github)
[](https://hub.docker.com/r/harisekhon/centos-github)[](https://harisekhon.github.io/CI-CD/)
[](https://github.com/HariSekhon/lib-java/blob/master/Jenkinsfile)
[](https://github.com/HariSekhon/lib-java/blob/master/cicd/.concourse.yml)
[](https://github.com/HariSekhon/lib-java/blob/master/cicd/.gocd.yml)
[](https://github.com/HariSekhon/TeamCity-CI)[](https://circleci.com/gh/HariSekhon/lib-java)
[](https://buildkite.com/hari-sekhon/lib-java)
[](https://ci.appveyor.com/project/HariSekhon/lib-java/branch/master)
[](https://cloud.drone.io/HariSekhon/lib-java)
[](https://g.codefresh.io/pipelines/edit/new/builds?id=5e58e3089604d75cec95ee25&pipeline=lib-java&filter=page:1;pageSize:10;timeFrameStart:week)
[](https://cirrus-ci.com/github/HariSekhon/lib-java)
[](https://harisekhon.semaphoreci.com/projects/lib-java)
[](https://github.com/HariSekhon/lib-java/blob/master/buddy.yml)
[](https://github.com/HariSekhon/lib-java/blob/master/shippable.yml)
[](https://github.com/HariSekhon/lib-java/blob/master/.travis.yml)[](https://dev.azure.com/harisekhon/GitHub/_build/latest?definitionId=2&branchName=master)
[](https://gitlab.com/HariSekhon/lib-java/pipelines)
[](https://bitbucket.org/harisekhon/lib-java/addon/pipelines/home#!/)
[](https://github.com/HariSekhon/lib-java/blob/master/cicd/buildspec.yml)
[](https://github.com/HariSekhon/lib-java/blob/master/cicd/cloudbuild.yaml)[](https://github.com/HariSekhon/lib-java)
[](https://gitlab.com/HariSekhon/lib-java)
[](https://bitbucket.org/HariSekhon/lib-java)
[](https://dev.azure.com/harisekhon/GitHub/_git/lib-java)[](https://github.com/HariSekhon/lib-java/actions/workflows/json.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/yaml.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/xml.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/markdown.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/validate.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/kics.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/grype.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/semgrep.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/semgrep-cloud.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/trivy.yaml)[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22GitHub+Actions+Ubuntu%22)
[](https://github.com/HariSekhon/lib-java/actions/workflows/mac.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/mac_11.yaml)
[](https://github.com/HariSekhon/lib-java/actions/workflows/mac_12.yaml)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Ubuntu%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Ubuntu+20.04%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Ubuntu+22.04%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Debian%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Debian+10%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Debian+11%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Debian+12%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22CentOS%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22CentOS+7%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22CentOS+8%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Fedora%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Alpine%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Alpine+3%22)[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Maven%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22SBT%22)
[](https://github.com/HariSekhon/lib-java/actions?query=workflow%3A%22Gradle%22)Java library, full of lots of validation code and utility functions.
Hari Sekhon
Cloud & Big Data Contractor, United Kingdom
(ex-Cloudera, former Hortonworks Consultant)
[](https://www.linkedin.com/in/HariSekhon/)
*(you're welcome to connect with me on LinkedIn)*## Build
Builds with any one of Maven, Gradle or SBT. The Maven and Gradle builds are best as they will auto-download their own build systems of the correct compatible version for you without you having to pre-install them.
The default build will trigger a Gradle build which requires no pre-installed dependencies other than Java. This is preferred because of the self-bootstrap but the Gradle mechanism additionally has an embedded checksum for security:
```shell
make
```You can call any one of the 3 major build systems explicitly instead:
Maven:
```shell
make mvn
```Gradle:
```shell
make gradle
```SBT:
```shell
make sbt
```### Testing
Continuous Integration is run on this repo to build and unit test it (around 400 JUnit tests).
You can launch tests manually by running this command at the top level of the repo:
```shell
make test
```### Configuration
Strict validations include host/domain/FQDNs using TLDs which are populated from the official IANA list, a snapshot of which is shipped as part of this project.
To update the bundled official IANA TLD list with the latest valid TLDs do
```shell
make tld
```### Custom TLDs
If using bespoke internal domains such as `.local`, `.intranet`, `.vm`, `.cloud` etc. that aren't part of the official IANA TLD list then this is additionally supported via a custom configuration file in [src/main/resources](https://github.com/HariSekhon/lib-java/tree/master/src/main/resources) called [custom_tlds.txt](https://github.com/HariSekhon/lib-java/blob/master/src/main/resources/custom_tlds.txt) containing one TLD per line, with support for # comment prefixes. Just add your bespoke internal TLD to the file and it will then pass the host/domain/fqdn validations.
[git.io/libj](https://git.io/libj)
## More Core Repos
### Knowledge
[](https://github.com/HariSekhon/Knowledge-Base)
[](https://github.com/HariSekhon/Diagrams-as-Code)### DevOps Code
[](https://github.com/HariSekhon/DevOps-Bash-tools)
[](https://github.com/HariSekhon/DevOps-Python-tools)
[](https://github.com/HariSekhon/DevOps-Perl-tools)
[](https://github.com/HariSekhon/DevOps-Golang-tools)### Containerization
[](https://github.com/HariSekhon/Kubernetes-configs)
[](https://github.com/HariSekhon/Dockerfiles)### CI/CD
[](https://github.com/HariSekhon/GitHub-Actions)
[](https://github.com/HariSekhon/Jenkins)### DBA - SQL
[](https://github.com/HariSekhon/SQL-scripts)
### DevOps Reloaded
[](https://github.com/HariSekhon/Nagios-Plugins)
[](https://github.com/HariSekhon/HAProxy-configs)
[](https://github.com/HariSekhon/Terraform)
[](https://github.com/HariSekhon/Packer-templates)
[](https://github.com/HariSekhon/Nagios-Plugin-Kafka)### Templates
[](https://github.com/HariSekhon/Templates)
[](https://github.com/HariSekhon/Template-repo)### Misc
[](https://github.com/HariSekhon/Spotify-tools)
[](https://github.com/HariSekhon/Spotify-playlists)The rest of my original source repos are
[here](https://github.com/HariSekhon?tab=repositories&q=&type=source&language=&sort=stargazers).Pre-built Docker images are available on my [DockerHub](https://hub.docker.com/u/harisekhon/).
