Module creation and git basic operation in idea of 02-ide tool

Time:2020-11-27

Create the project module and run it

Create and run a Java module

Create a Java module in the project opened by idea, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Select the module name in the next interface, as shown in the figure

Module creation and git basic operation in idea of 02-ide tool

After the Java module is created, the structure is shown as follows:

Module creation and git basic operation in idea of 02-ide tool

Create the package in the project module 01 javase, for example:

Module creation and git basic operation in idea of 02-ide tool

Create a class in the specified package, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Run the Java class, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Create and run Maven module

In the project, create Maven module, as shown in the following figure:

Module creation and git basic operation in idea of 02-ide tool

Next, enter the module basic information, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

open pom.xml File, add JUnit dependency, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Create packages, unit test classes and methods, and conduct unit test, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Create and run the spring initializer module

In the project, create the spring initializer module, as shown in the following figure:

Module creation and git basic operation in idea of 02-ide tool

Next, enter the spring initializer module information, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Select the springboot version, dependency, and then enter the following figure, as shown:

Module creation and git basic operation in idea of 02-ide tool

Input module information, and then complete the creation of module, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Module creation and git basic operation in idea of 02-ide tool

After the spring initializer module is created, its structure is shown in the following figure:
Module creation and git basic operation in idea of 02-ide tool

After the module is created, it can be opened pom.xml File, modify its springboot version, as shown in the figure below:
Module creation and git basic operation in idea of 02-ide tool

After the spring boot version is modified (optional), the pom.xml Right click and select Add as Maven project to build Maven project (springboot only depends on downloading and compiling at this time). For example:

Module creation and git basic operation in idea of 02-ide tool

After building the module, open the startup class and run the module, as shown in the figure below:

Module creation and git basic operation in idea of 02-ide tool

The module starts and runs successfully, as shown in the figure

Module creation and git basic operation in idea of 02-ide tool

Git based project operation

Check git configuration.

Find the GIT configuration option and perform git test, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Analysis and implementation of project push operation

Gitee remote code hosting platform to push the project and module, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Specify the warehouse name of gitee warehouse (the library does not exist and is automatically created when pushing), as shown in the figure below:

Module creation and git basic operation in idea of 02-ide tool

Log in gitee and check the contents of the remote warehouse, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

Project add, commit operation analysis and Implementation

Add the project and module update to the staging area and commit the local library, for example:

Module creation and git basic operation in idea of 02-ide tool

You can also perform related operations based on the buttons in the toolbar, as shown in the figure:

Module creation and git basic operation in idea of 02-ide tool

If other members of the team need the project and module, they can clone them directly.

Clone project from gitee address

Open the clone option in idea, as shown in the figure:
Module creation and git basic operation in idea of 02-ide tool

Specify the clone address and clone directory, as shown in the figure:
Module creation and git basic operation in idea of 02-ide tool

After cloning is complete, select the window to open the project, for example:

Module creation and git basic operation in idea of 02-ide tool

Summary

This chapter explains the creation and operation of Java module, Maven module and spring boot module under idea tool, as well as the basic process of submitting projects to gitee platform or cloning projects from gitee platform.