2021SC@SDUSC
The version of openmeetings analyzed in this article is 4.x
Overall structure
Open the src folder of the project, open cmd in this directory, and enter the tree openmeetings install command to view the tree directory structure of openmeetings install
The src directory contains three folders: main, site, and test
- The main folder is used to store the java files and resources static resources of the project
- The test folder is used to store java files for testing
- The site folder is used to store the configured site description files. Official reference documents: Configuring the Site Descriptor
In addition, there are openmeetings-install.iml file and pom.xml file
- openmeetings-install.iml file is a module file automatically created by idea. It is used for java application development, storage module development related information and module path information, etc
- pom.xml file is the basic work unit of Maven project. It contains the basic information of the project, which is used to describe how to build the project, declare dependencies, and so on
Because pom.xml describes the basic information of maven project, we can have a general understanding of the project as a whole by analyzing it, so let's analyze pom.xml file
pom.xml file analysis
I am used to writing notes near the code in the form of notes during learning, so as to understand what each code means
<?xml version="1.0" encoding="UTF-8"?> <!-- This is openmeetings-install of pom file POM(Project Object Model,Project object model)yes Maven The basic work unit of the project, It's a XML File, which contains the basic information of the project. It is used to describe how the project is built, declare dependencies, and so on When performing a task or goal, Maven Will be found in the current directory POM. It reads POM,Obtain the required configuration information, and then execute the target --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!--Model version--> <modelVersion>4.0.0</modelVersion> <!--Coordinates of the parent project. If the value of an element is not specified in the project, the corresponding value in the parent project is the default value of the project.--> <parent> <!--Creating POM Before, we first need to describe the project team( groupid),Unique name of the project ID--> <!--The unique flag of the company or organization, and the path generated during configuration is also generated As follows, maven The project will be packaged into jar Package local path: /org/apache/openmeetings--> <!--Creating POM Before, we first need to describe the project team( groupid),Unique name of the project ID--> <groupId>org.apache.openmeetings</groupId> <!--Unique name of the project ID,One groupId There may be several projects below. It depends on artifactId Differentiated--> <artifactId>openmeetings-parent</artifactId> <!--Version number--> <version>4.0.7</version> <!--Parent item purpose pom.xml The relative path of the file. Relative path allows you to choose a different path. The default value is../pom.xml. Maven First, look for the parent project where the current project is built pom,Second, in this location of the file system( relativePath Location), and then find the location of the parent project in the local warehouse and finally in the remote warehouse pom. --> <relativePath>..</relativePath> </parent> <artifactId>openmeetings-install</artifactId> <!--The type of component produced by the project, such as jar,war,ear,pom. Plug ins can create their own component types, so not all component types listed above --> <packaging>jar</packaging> <!--Name of the project, Maven Generated documents --> <name>Openmeetings Install</name> <!-- Detailed description of the project, Maven The generated document is used when this element can be used HTML Format description (for example, CDATA The text in is ignored by the parser and can be included HTML mark It is not encouraged to use plain text description. If you need to modify the generated web For the index page of the site, you should modify your own index page file instead of adjusting the documents here. --> <!--The project description here illustrates this install Package is OpenMeetings Modules of classes required by the command line management and installation program --> <description>Module for OpenMeetings command line admin and classes necessary for installer.</description> <!--Describes the prerequisites in the project build environment. --> <properties> <!--site.basedir This means declaring a variable named site.basedir,That is, configure a custom attribute that can be used in other places in the form of ${}. and site.basedir The value of is ${project.parent.basedir},That is, the location of the parent project.--> <site.basedir>${project.parent.basedir}</site.basedir> </properties> <!--dependencies This element describes all dependencies related to the project. These dependencies constitute each link in the project construction process. They are automatically downloaded from the repository defined by the project. --> <dependencies> <!--spring Related dependencies --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </dependency> <!--quote openmeetings-core package --> <dependency> <groupId>org.apache.openmeetings</groupId> <artifactId>openmeetings-core</artifactId> </dependency> <!--commons-cli:Provides methods for parsing command line parameters API --> <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> <version>${commons-cli.version}</version> </dependency> <!--quote openmeetings-util package --> <dependency> <groupId>org.apache.openmeetings</groupId> <artifactId>openmeetings-util</artifactId> <version>${project.version}</version> <type>test-jar</type> <!--Scope--> <scope>test</scope> </dependency> </dependencies> </project>
We can learn from the above source code and comments:
-
OpenMeetings install is a module of classes required by the OpenMeetings command line management and installation program
-
It needs to inject some dependencies of openmeetings core and openmeetings util. In addition, I also need to learn Spring, commons CLI and other related knowledge to facilitate the understanding of subsequent codes
summary
This article briefly arranges the directory structure of openmeetings install, and has a certain understanding of the basic information of the project through the pom.xml file. The next article will analyze the source code from the main\java\org\apache\openmeetings\installation folder