Jake Whittaker

Jake Whittaker

1595991859

How to Create a Multi-Module Spring Boot Application using Java Module

Java is one of the most mature and persistent development languages that exists. Recently, it shifted to a 6-month release schedule, enabling it to deliver more frequent updates to the language. One of the changes introduced in Java 9 was the modular system.

The Java Platform Module System (JPMS) adds two fundamental capabilities when building Java apps:

  • Reliable configuration - replacing the brittle, error-prone class-path mechanism with a means for program components to declare explicit dependencies upon one another.
  • Strong encapsulation - allowing a component to declare which of its public types are accessible to other components and which are not.

Packages may be grouped into modules that serve as building blocks in the construction of very large programs. The declaration of a module specifies which other modules (packages, classes, and interfaces) are required to compile and run code.

While we have the visibility modifiers—public, private, protected, and default—they are not enough to provide external visibility. A common example used to illustrate the problem is a “Util” class, this class may be used throughout a library from various packages within a JAR file but is NOT meant to be used outside of the library. JPMS can help with this type of situation.

Table Content

  • Introduction
  • Install a Java 9+ JDK
  • Project Structure
    • How to Structure a Modular Project with Maven
  • Build an Application Without Java Modules
    • Create the Persistence Module
    • Create the Web Application Module
  • Secure Your Web Application
    • Register an Application on Okta
    • Configure the App with Okta Information
  • Using Java Modules
    • Modularize the persistence Library
    • Modularize the application Project
  • Running the Application
  • Learning More About Java Modular System

Introduction

When Java 9 was created, the JDK went under a major refactoring to modularize its content. It created various modules to organize the contents. Some examples include: java.base, java.sql, and java.xml(along with many others). To date, there are a total of 60 modules in Java 14 JDK.

java.base has fundamental classes like Object, String, Integer, Double, etc. While java.sql has classes related to accessing the JDBC API like ResultSet, Connection and others. Additionally, java.xml has classes related to XML manipulation like XMLStreamReader, XMLStreamWriter and similar classes in that vein.

The modularization enabled the possibility of reducing the Java runtime to include just the java.base if your application only depends on this module. By using the jlink tool that is bundled with the JDK, you can create a micro runtime with only the JDK modules you need.

For the rest of this article, you should have at least some basic understanding of Spring Boot, Maven, and REST web services principles as well as Docker installed on your machine.

Install a Java 9+ JDK

First, you’ll need a Java 9+ JDK in order to use modules. If you have been using Java 8, you’ll likely have to download a separate JDK with a version of 9 or later to be used for this tutorial. This project is set up to use JDK 11 in this tutorial. You can download the JDKs from AdoptOpenJDK. Just make sure your JAVA_HOME environment variable is pointing to that JDK.

#java #spring-boot #developer

What is GEEK

Buddha Community

How to Create a Multi-Module Spring Boot Application using Java Module
Tyrique  Littel

Tyrique Littel

1600135200

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK?

OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE). It contains the virtual machine, the Java Class Library, and the Java compiler. The difference between the Oracle OpenJDK and Oracle JDK is that OpenJDK is a source code reference point for the open-source model. Simultaneously, the Oracle JDK is a continuation or advanced model of the OpenJDK, which is not open source and requires a license to use.

In this article, we will be installing OpenJDK on Centos 8.

#tutorials #alternatives #centos #centos 8 #configuration #dnf #frameworks #java #java development kit #java ee #java environment variables #java framework #java jdk #java jre #java platform #java sdk #java se #jdk #jre #open java development kit #open source #openjdk #openjdk 11 #openjdk 8 #openjdk runtime environment

Were  Joyce

Were Joyce

1642110180

Spring: A Static Web Site Generator Written By GitHub Issues

Spring

Spring is a blog engine written by GitHub Issues, or is a simple, static web site generator. No more server and database, you can setup it in free hosting with GitHub Pages as a repository, then post the blogs in the repository Issues.

You can add some labels in your repository Issues as the blog category, and create Issues for writing blog content through Markdown.

Spring has responsive templates, looking good on mobile, tablet, and desktop.Gracefully degrading in older browsers. Compatible with Internet Explorer 10+ and all modern browsers.

Get up and running in seconds.

中文介绍

Quick start guide

For the impatient, here's how to get a Spring blog site up and running.

First of all

  • Fork the Spring repository as yours.
  • Goto your repository settings page to rename Repository Name.
  • Hosted directly on GitHub Pages from your project repository, you can take it as User or organization site or Project site(create a gh-pages branch).
  • Also, you can set up a custom domain with Pages.

Secondly

  • Open the index.html file to edit the config variables with yours below.
$.extend(spring.config, {
  // my blog title
  title: 'Spring',
  // my blog description
  desc: "A blog engine written by github issues [Fork me on GitHub](https://github.com/zhaoda/spring)",
  // my github username
  owner: 'zhaoda',
  // creator's username
  creator: 'zhaoda',
  // the repository name on github for writting issues
  repo: 'spring',
  // custom page
  pages: [
  ]
})
  • Put your domain into the CNAME file if you have.
  • Commit your change and push it.

And then

  • Goto your repository settings page to turn on the Issues feature.
  • Browser this repository's issues page, like this https://github.com/your-username/your-repo-name/issues?state=open.
  • Click the New Issue button to just write some content as a new one blog.

Finally

  • Browser this repository's GitHub Pages url, like this http://your-username.github.io/your-repo-name, you will see your Spring blog, have a test.
  • And you're done!

Custom development

Installation

  • You will need a web server installed on your system, for example, Nginx, Apache etc.
  • Configure your spring project to your local web server directory.
  • Run and browser it, like http://localhost/spring/dev.html .
  • dev.html is used to develop, index.html is used to runtime.

Folder Structure

spring/
├── css/
|    ├── boot.less  #import other less files
|    ├── github.less  #github highlight style
|    ├── home.less  #home page style
|    ├── issuelist.less #issue list widget style
|    ├── issues.less #issues page style
|    ├── labels.less #labels page style
|    ├── main.less #commo style
|    ├── markdown.less #markdown format style
|    ├── menu.less #menu panel style
|    ├── normalize.less #normalize style
|    ├── pull2refresh.less #pull2refresh widget style
|    └── side.html  #side panel style
├── dist/
|    ├── main.min.css  #css for runtime
|    └── main.min.js  #js for runtime
├── img/  #some icon, startup images
├── js/
|    ├── lib/  #some js librarys need to use
|    ├── boot.js  #boot
|    ├── home.js  #home page
|    ├── issuelist.js #issue list widget
|    ├── issues.js #issues page
|    ├── labels.js #labels page
|    ├── menu.js #menu panel
|    ├── pull2refresh.less #pull2refresh widget
|    └── side.html  #side panel
├── css/
|    ├── boot.less  #import other less files
|    ├── github.less  #github highlight style
|    ├── home.less  #home page style
|    ├── issuelist.less #issue list widget style
|    ├── issues.less #issues page style
|    ├── labels.less #labels page style
|    ├── main.less #commo style
|    ├── markdown.less #markdown format style
|    ├── menu.less #menu panel style
|    ├── normalize.less #normalize style
|    ├── pull2refresh.less #pull2refresh widget style
|    └── side.html  #side panel style
├── dev.html #used to develop
├── favicon.ico #website icon
├── Gruntfile.js #Grunt task config
├── index.html #used to runtime
└── package.json  #nodejs install config

Customization

  • Browser http://localhost/spring/dev.html, enter the development mode.
  • Changes you want to modify the source code, like css, js etc.
  • Refresh dev.html view change.

Building

  • You will need Node.js installed on your system.
  • Installation package.
bash

$ npm install

*   Run grunt task.

    ```bash
$ grunt
  • Browser http://localhost/spring/index.html, enter the runtime mode.
  • If there is no problem, commit and push the code.
  • Don't forget to merge master branch into gh-pages branch if you have.
  • And you're done! Good luck!

Report a bug

Who used

If you are using, please tell me.

Download Details:
Author: zhaoda
Source Code: https://github.com/zhaoda/spring
License: MIT License

#spring #spring-framework #spring-boot #java 

Sigrid  Farrell

Sigrid Farrell

1622601303

How to Configure log4j2 In a Spring Boot Application? | Spring Boot Logging [Video]

Configuring log4j2 is really quick and simple; this tutorial video explains the entire process in only 5 minutes, while you wait for your coffee to brew.

In the video below, we take a closer look at the How to configure log4j2 in the Spring boot application using log4j2.xml? | Spring Boot logging. Let’s get started!

#java #spring boot #video #log4j #spring boot tutorial #spring boot tutorial for beginners

Were  Joyce

Were Joyce

1620852060

How to Bootstrap a Spring Boot Application? Maven Project

In this article, take a closer look at how to bootstrap a Spring Boot application.

In the video below, we take a closer look at how to bootstrap a Spring Boot application. Let’s get started!

#java #tutorial #spring boot #maven #spring boot tutorial #bootstrap a spring boot application

Jake Whittaker

Jake Whittaker

1595991859

How to Create a Multi-Module Spring Boot Application using Java Module

Java is one of the most mature and persistent development languages that exists. Recently, it shifted to a 6-month release schedule, enabling it to deliver more frequent updates to the language. One of the changes introduced in Java 9 was the modular system.

The Java Platform Module System (JPMS) adds two fundamental capabilities when building Java apps:

  • Reliable configuration - replacing the brittle, error-prone class-path mechanism with a means for program components to declare explicit dependencies upon one another.
  • Strong encapsulation - allowing a component to declare which of its public types are accessible to other components and which are not.

Packages may be grouped into modules that serve as building blocks in the construction of very large programs. The declaration of a module specifies which other modules (packages, classes, and interfaces) are required to compile and run code.

While we have the visibility modifiers—public, private, protected, and default—they are not enough to provide external visibility. A common example used to illustrate the problem is a “Util” class, this class may be used throughout a library from various packages within a JAR file but is NOT meant to be used outside of the library. JPMS can help with this type of situation.

Table Content

  • Introduction
  • Install a Java 9+ JDK
  • Project Structure
    • How to Structure a Modular Project with Maven
  • Build an Application Without Java Modules
    • Create the Persistence Module
    • Create the Web Application Module
  • Secure Your Web Application
    • Register an Application on Okta
    • Configure the App with Okta Information
  • Using Java Modules
    • Modularize the persistence Library
    • Modularize the application Project
  • Running the Application
  • Learning More About Java Modular System

Introduction

When Java 9 was created, the JDK went under a major refactoring to modularize its content. It created various modules to organize the contents. Some examples include: java.base, java.sql, and java.xml(along with many others). To date, there are a total of 60 modules in Java 14 JDK.

java.base has fundamental classes like Object, String, Integer, Double, etc. While java.sql has classes related to accessing the JDBC API like ResultSet, Connection and others. Additionally, java.xml has classes related to XML manipulation like XMLStreamReader, XMLStreamWriter and similar classes in that vein.

The modularization enabled the possibility of reducing the Java runtime to include just the java.base if your application only depends on this module. By using the jlink tool that is bundled with the JDK, you can create a micro runtime with only the JDK modules you need.

For the rest of this article, you should have at least some basic understanding of Spring Boot, Maven, and REST web services principles as well as Docker installed on your machine.

Install a Java 9+ JDK

First, you’ll need a Java 9+ JDK in order to use modules. If you have been using Java 8, you’ll likely have to download a separate JDK with a version of 9 or later to be used for this tutorial. This project is set up to use JDK 11 in this tutorial. You can download the JDKs from AdoptOpenJDK. Just make sure your JAVA_HOME environment variable is pointing to that JDK.

#java #spring-boot #developer