Maven project dependency static analysis method, device, equipment and storage medium
Through static analysis technology, analyzing the dependency configuration file of the Maven project and building a dependency tree, solving the problem of time-consuming and resource consumption in obtaining the dependency tree, and achieving a more efficient development process.
Patent Information
- Application Number
- CN202411311187.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Traditional Maven tools need to carry out actual construction process when obtaining project dependency trees, resulting in large time consumption and excessive system resources, affecting development efficiency.
The dependency configuration file is parsed through static analysis technology, extract the dependency relationship and build the dependency tree to avoid the actual construction process.
It improves the speed of obtaining dependency trees, reduces the consumption of computer resources, and realizes a more efficient development process.
Smart Images

Figure CN118820122B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software engineering, and in particular to a Maven project dependency static analysis method, device, equipment and storage medium. Background Art
[0002] In software development, it is very important for project managers and developers to understand the dependent components used in the project so that developers can perform tasks such as version management, security assessment, and conflict resolution.
[0003] However, the traditional Maven tool obtains the dependency tree of the project by actually building the project. This method will lead to the following problems: The traditional Maven tool needs to perform the actual construction process when obtaining the dependency tree, including downloading dependencies, compiling code, and other operations. These operations take a long time, especially in large projects or projects with many dependencies, which slows down the construction process and affects development efficiency. The traditional Maven tool needs to occupy a certain amount of system resources for project construction, including network bandwidth, disk space, and memory. In resource-constrained environments or multiple concurrent builds, resource competition and performance degradation will occur. Maven has strict requirements on the integrity and correctness of project configuration. The pom.xml file of the project must contain the correct configuration information, including dependencies, plug-ins, build process, and other related settings. If the project configuration is incomplete or there are errors, Maven will generate compilation errors or other problems during the build process. Although Maven is very powerful in building, publishing, and managing Java projects, it has certain limitations in direct calling in program code and lacks flexibility. Maven is mainly used through the command line or plug-ins of the integrated development environment (IDE), which is very convenient for building and managing projects. However, if you want to call Maven directly in the program code to perform specific operations, such as obtaining dependency information, parsing pom.xml files, etc., it will be more difficult. Summary of the invention
[0004] The present invention provides a Maven project dependency static analysis method, device, equipment and storage medium, aiming to solve at least one of the above problems and avoid the actual construction process of the project.
[0005] In a first aspect, an embodiment of the present invention provides a Maven project dependency analysis method, comprising:
[0006] Get the dependency configuration files of multiple modules in the project;
[0007] Parse the dependency configuration file and convert it into a project object model POM entity class object;
[0008] Analyze the POM entity class object to obtain the direct dependency information corresponding to the module;
[0009] Acquire the modules with dependency relationships, and integrate dependency information of the modules with dependency relationships into dependency information of the module currently being analyzed;
[0010] The directly dependent dependencies in the dependency information are traversed to determine the indirect dependencies between the modules.
[0011] In a second aspect, an embodiment of the present invention provides a Maven project dependency static analysis device, comprising:
[0012] The dependency configuration file acquisition module is used to obtain the dependency configuration files of multiple modules in the project;
[0013] A POM entity class object conversion module is used to parse the dependency configuration file and convert it into a project object model POM entity class object;
[0014] A dependency information acquisition module is used to analyze the POM entity class object and obtain the direct dependency information corresponding to the module;
[0015] A dependency integration module, used for acquiring the modules with dependency relationships, and integrating dependency information of the modules with dependency relationships into dependency information of the module currently being analyzed;
[0016] The indirect dependency determination module is used to traverse the directly dependent dependency items in the dependency information to determine the indirect dependencies between the modules.
[0017] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0018] one or more processors;
[0019] A memory for storing one or more programs;
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the Maven project dependency static analysis method provided by any embodiment of the present invention.
[0021] In a fourth aspect, an embodiment of the present invention provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a Maven project dependency static analysis method as provided in any embodiment of the present invention.
[0022] The embodiments of the present invention provide a Maven project dependency static analysis method, device, equipment and storage medium, which parses dependency configuration files, extracts dependencies and builds a dependency tree by utilizing static analysis technology, thereby solving the time-consuming and resource-consuming problems of traditional Maven tools that require actual construction, and improves the speed of obtaining the dependency tree, while greatly reducing the consumption of computer resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A flowchart of a Maven project dependency static analysis method provided in Example 1 of the present invention;
[0024] Figure 2 A schematic diagram of the structure of a Maven project dependency static analysis device provided in Embodiment 2 of the present invention;
[0025] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention;
[0026] Figure 4 A flowchart of a Maven project dependency static analysis method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings. Embodiment 1
[0028] Figure 1 This is a flowchart of a Maven project dependency static analysis method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of obtaining dependent components used in a project in software development. The method can be executed by a Maven project dependency analysis device, which can be implemented by hardware and / or software and can generally be integrated in an electronic device, such as a computer device. The method specifically includes:
[0029] Step 110: Obtain dependency configuration files of multiple modules in the project.
[0030] Among them, in Java Maven projects, dependencies are usually configured in the pom.xml file and stored in the root directory of the current project.
[0031] Step 120: parse the dependency configuration file and convert it into a project object model POM entity class object.
[0032] Among them, the pom.xml file needs to be parsed and its content converted into an internal data structure that is easy to process, the POM (Project Object Model) entity class object. The POM entity class object contains a complex data structure of project information, such as the coordinates of the project, the dependencies of the project, etc.
[0033] Step 130: Analyze the POM entity class object to obtain the direct dependency information corresponding to the module.
[0034] Among them, the module to be analyzed is determined, the data of the corresponding POM entity class object is analyzed and the corresponding direct dependency information is obtained.
[0035] Step 140: Obtain the modules with dependency relationships, and integrate dependency information of the modules with dependency relationships into dependency information of the module currently being analyzed.
[0036] Among them, if the module has a parent module or other dependencies, it is necessary to obtain the information of the parent module or related modules. The dependency information of these modules can be found in the cache, and the dependency information of these dependent modules can be integrated into the dependency information of the currently analyzed module. This process may need to be performed recursively until all the dependency information with dependencies is obtained. It should be noted that dependency conflicts need to be handled in this process. Dependency conflicts usually occur when two or more modules depend on different versions of the same library. Select the appropriate dependency according to the rules of the project management tool to resolve dependency conflicts.
[0037] Step 150: traverse the directly dependent dependencies in the dependency information to determine the indirect dependencies between the modules.
[0038] Among them, direct dependency refers to the library that the project directly depends on, and indirect dependency refers to the library that the project depends on through direct dependency. In order to obtain all indirect dependencies, use appropriate algorithms to traverse the dependencies of direct dependencies and obtain the information of the dependencies of direct dependencies. In this process, the problem of dependency conflict needs to be handled.
[0039] The technical solution of this embodiment solves the problem of avoiding the time-consuming and resource-consuming actual construction required by traditional Maven tools by utilizing static analysis technology to parse the dependency configuration file, extract the dependencies, and build a dependency tree. It improves the speed of obtaining the dependency tree and greatly reduces the consumption of computer resources.
[0040] Optionally, obtaining dependency configuration files of multiple modules in the project includes:
[0041] Get the root directory of the project, and call the file operation API (Application Programming Interface) to traverse the files under the root directory;
[0042] Filter out the dependency configuration file from the files in the root directory, wherein the dependency configuration file is an XML (Extensible Markup Language) format file. Filter out all pom.xml files in the root directory of the project. There may be multiple modules in a Maven project, and each module has a corresponding pom.xml file. Therefore, traversing the dependency configuration file of the project is an important basis for fully understanding the situation of the dependent components used in the Maven project.
[0043] Optionally, the parsing of the dependency configuration file and converting it into a project object model POM entity class object includes:
[0044] Based on XML parsing technology, the dependency configuration file in XML format is converted into a tree-shaped data structure to construct the POM entity class object. Among them, the process of converting the pom.xml file into a POM entity class object can convert the document in XML format into a tree-shaped data structure through XML parsing technology, and obtain the required information by traversing the tree-shaped data structure. Perform a parsing operation for each pom.xml file, and cache the dependency information obtained by the parsing into the memory. In this way, the dependency information of any module can be quickly obtained. Specifically, the XML parsing library can be imported in advance, and the JSoup library can be introduced in the Java project to use the XML parsing function provided by it. You can add JSoup dependencies in the pom.xml file of the project, or manually download the JSoup library and add it to the class path of the project. According to the structure of the pom.xml file, create a Java entity class for mapping the content of pom.xml. The entity class contains fields corresponding to the elements and attributes in pom.xml. Java classes and fields can be used to represent the various elements and attributes in pom.xml. For example, you can create a class called "POM" that contains fields corresponding to the groupId, artifactId, and version elements in pom.xml. Figure 4 , you can cache the POM entity class collection into memory.
[0045] Optionally, analyzing the POM entity class object to obtain dependency information corresponding to the module includes:
[0046] The POM entity class object to be analyzed is determined, and the direct dependency information of the module is obtained by traversing the direct dependency list in the POM entity class object.
[0047] Among them, JSoup can be used to parse a single pom.xml file. Figure 4 As shown in the figure, the pom.xml file is loaded as a Document object using the parsing function of the JSoup library. Through the Document object, the selectors and methods provided by JSoup are used to extract the elements and attribute values in pom.xml and set them to the corresponding fields of the POM entity class. For example, the JSoup selector can be used to locate and extract the values of elements such as groupId, artifactId, and version, and set them to the corresponding fields of the POM entity class to create a POM entity class.
[0048] Optionally, the acquiring the modules having the dependency relationship and integrating the dependency information of the modules having the dependency relationship into the dependency information of the module currently being analyzed includes:
[0049] If the module currently being analyzed has a dependent module with a dependent relationship, obtain the POM entity class object of the dependent module;
[0050] Obtain the dependency information of the dependency-related modules from the POM entity class object and copy it to the module currently being analyzed.
[0051] Optionally, obtaining dependency information of the dependency-related module from the POM entity class object and copying it to the module currently being analyzed includes:
[0052] If the dependent module is the parent module of the module currently being analyzed, obtain the POM entity class object of the parent module;
[0053] Obtain the dependencies, dependency management and configuration definitions in the POM entity class object of the parent module and copy them to the corresponding submodule;
[0054] If there is still a parent tag in the parent module, recursively execute the steps of obtaining the POM entity class object of the parent module and copying the dependencies, dependency management and configuration definitions in the POM entity class object of the parent module to the corresponding child module until there is no parent module;
[0055] Replace the tag content defined in the ${} method in the global configuration with the specific configuration.
[0056] Among them, (1) determine the module to be analyzed and obtain its corresponding POM entity class object. (2) If the module has a parent module, obtain the coordinate information of the parent module. Figure 4 , (3) Search for the POM entity class object of the parent module from the cache. If it does not exist in the cache, obtain the pom.xml file of the parent module from the central repository and parse it into a POM entity class object. (4) Copy the dependencies, dependency management, and configuration definitions in the parent module to the corresponding child module. If there are parent tags in the parent module, recursively execute steps (3) and (4) until there is no parent module. (5) Replace the tag content defined in the ${} method in the global configuration with the specific configuration. Complete direct dependency analysis.
[0057] Optionally, traversing directly dependent dependencies in the dependency information to determine indirect dependencies between the modules includes:
[0058] Use a breadth-first algorithm to traverse the directly dependent dependencies and obtain the POM entity class object of the dependency;
[0059] If the dependency item has a parent module, repeatedly execute the step of obtaining the dependency information of the dependency-related module through the POM entity class object and copying it to the module currently being analyzed;
[0060] If a dependency conflict occurs, the first dependency traversed is selected according to Maven's rules for resolving dependency conflicts.
[0061] Among them, the indirect dependency analysis can use the breadth-first algorithm to traverse the dependencies of the direct dependencies, and first query whether the dependency entity class object exists in the cache. If it does not exist in the cache, obtain the pom.xml file from the central repository and parse it into a POM entity class object; obtain the POM entity class object of the dependency. If the parent module exists, repeat the above steps (3)-(5) to obtain the POM entity class object of the direct dependency. If a dependency conflict is encountered, select the dependency that is traversed for the first time according to the Maven rules for resolving dependency conflicts. Repeat the above steps until the leaf node dependency.
[0062] Based on the above technical solution provided in the embodiment of the present application, compared with the traditional Maven tool for obtaining the project dependency tree, the technical solution in the embodiment of the present application has multiple beneficial technical effects such as improving efficiency, saving resources, flexible calling and accuracy.
[0063] Since the embodiment of the present application uses static analysis technology, it avoids the time-consuming and resource consumption of the traditional Maven tool to actually build. Compared with actually building a project to obtain a dependency tree, our method can obtain the dependency tree information of the project more quickly, thereby improving development efficiency. Then, the traditional Maven tool needs to occupy certain system resources for project construction, including network bandwidth, disk space and memory, etc. Our method obtains the dependency tree by statically analyzing the pom.xml file, avoiding resource consumption in the actual construction process, thereby saving system resources. In addition, developers can directly call this method in the program code to perform specific operations, such as obtaining dependency information, parsing pom.xml files, etc. This can be more flexibly integrated into the development process to meet personalized needs. Through static analysis of the pom.xml file, the dependency relationship and dependency tree structure of the project can be accurately obtained, which helps project managers and developers to better understand and manage the dependencies in the project, and perform version management, security assessment and conflict resolution. Embodiment 2
[0064] Figure 2 A schematic diagram of the structure of a Maven project dependency static analysis device provided in the second embodiment of the present invention is shown in FIG. Figure 2 As shown, the Maven project dependency static analysis device includes: a dependency configuration file acquisition module 210, a POM entity class object conversion module 220, a dependency information acquisition module 230, a dependency integration module 240 and an indirect dependency determination module 250, wherein:
[0065] A dependency configuration file acquisition module 210 is used to acquire dependency configuration files of multiple modules in a project;
[0066] A POM entity class object conversion module 220 is used to parse the dependency configuration file and convert it into a project object model POM entity class object;
[0067] The dependency information acquisition module 230 is used to analyze the POM entity class object and obtain the direct dependency information corresponding to the module;
[0068] A dependency integration module 240 is used to obtain the modules with dependency relationships and integrate dependency information of the modules with dependency relationships into dependency information of the module currently being analyzed;
[0069] The indirect dependency determination module 250 is used to traverse the directly dependent dependency items in the dependency information to determine the indirect dependencies between the modules.
[0070] Optionally, the dependency configuration file acquisition module 210 is specifically used to:
[0071] Get the root directory of the project, and call the file operation API to traverse the files under the root directory;
[0072] The dependency configuration file is screened out from the files under the root directory, wherein the dependency configuration file is an XML format file.
[0073] Optionally, the POM entity class object conversion module 220 is specifically used for:
[0074] The dependency configuration file in XML format is converted into a tree-shaped data structure based on XML parsing technology to construct the POM entity class object.
[0075] Optionally, the dependency information acquisition module 230 is specifically used to:
[0076] The POM entity class object to be analyzed is determined, and the direct dependency information of the module is obtained by traversing the direct dependency list in the POM entity class object.
[0077] Optionally, the dependency integration module 240 includes:
[0078] A dependency-related module entity class object acquisition unit, used for acquiring the POM entity class object of a dependency-related module if the module currently being analyzed has a dependency-related module with which it has a dependency relationship;
[0079] The dependency information copying unit is used to obtain the dependency information of the dependency-related modules from the POM entity class object and copy it to the module currently being analyzed.
[0080] Optional, dependent information copy unit, specifically used for:
[0081] If the dependent module is the parent module of the module currently being analyzed, obtain the POM entity class object of the parent module;
[0082] Obtain the dependencies, dependency management and configuration definitions in the POM entity class object of the parent module and copy them to the corresponding submodule;
[0083] If there is still a parent tag in the parent module, recursively execute the steps of obtaining the POM entity class object of the parent module and copying the dependencies, dependency management and configuration definitions in the POM entity class object of the parent module to the corresponding child module until there is no parent module;
[0084] Replace the tag content defined in the ${} method in the global configuration with the specific configuration.
[0085] Optionally, the indirect dependency determination module 250 is specifically configured to:
[0086] Use a breadth-first algorithm to traverse the directly dependent dependencies and obtain the POM entity class object of the dependency;
[0087] If the dependency item has a parent module, repeatedly execute the step of obtaining the dependency information of the dependency-related module through the POM entity class object and copying it to the module currently being analyzed;
[0088] If a dependency conflict occurs, the first dependency traversed is selected according to Maven's rules for resolving dependency conflicts.
[0089] The Maven project dependency static analysis device provided in the embodiment of the present invention can execute the Maven project dependency static analysis method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Embodiment 3
[0090] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention is shown in FIG. Figure 3 As shown, the electronic device includes a processor 310, a memory 320, an input device 330 and an output device 340; the number of the processor 310 in the electronic device can be one or more. Figure 3 A processor 310 is taken as an example; the processor 310, the memory 320, the input device 330 and the output device 340 in the electronic device can be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0091] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the Maven project dependency static analysis method in the embodiment of the present invention (for example, the dependency configuration file acquisition module 210, the POM entity class object conversion module 220, the dependency information acquisition module 230, the dependency integration module 240 and the indirect dependency determination module 250 in the Maven project dependency static analysis device). The processor 310 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 320, that is, implements the above-mentioned Maven project dependency static analysis method.
[0092] The memory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 320 may further include a memory remotely arranged relative to the processor 310, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0093] The input device 330 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 340 may include a display device such as a display screen. Embodiment 4
[0094] Embodiment 4 of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a Maven project dependency static analysis method when executed by a computer processor, including:
[0095] Get the dependency configuration files of multiple modules in the project;
[0096] Parse the dependency configuration file and convert it into a project object model POM entity class object;
[0097] Analyze the POM entity class object to obtain the direct dependency information corresponding to the module;
[0098] Acquire the modules with dependency relationships, and integrate dependency information of the modules with dependency relationships into dependency information of the module currently being analyzed;
[0099] The directly dependent dependencies in the dependency information are traversed to determine the indirect dependencies between the modules.
[0100] Of course, the computer executable instructions of a storage medium including computer executable instructions provided in an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the Maven project dependency static analysis method provided in any embodiment of the present invention.
[0101] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk or an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0102] It is worth noting that in the above-mentioned embodiment of the Maven project dependency static analysis device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0103] Although the present invention has been described in detail above by means of general description, specific implementation methods and tests, it is obvious to those skilled in the art that some modifications or improvements may be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection claimed by the present invention.
Claims
1. A Maven project dependency static analysis method, characterized in that: include: Get the dependency configuration files of multiple modules in the project; Parse the dependency configuration file and convert it into a project object model POM entity class object; Specifically, create a class named POM that contains fields corresponding to the groupId, artifactId, and version elements in the dependency configuration file; Analyze the POM entity class object to obtain the direct dependency information corresponding to the module; Obtain the module with the dependency relationship, and integrate the dependency information of the module with the dependency relationship into the dependency information of the module currently being analyzed; specifically, if the module currently being analyzed has a dependency-related module with a dependency relationship, obtain the POM entity class object of the dependency-related module; obtain the dependency information of the dependency-related module from the POM entity class object, and copy it to the module currently being analyzed; The directly dependent dependencies in the dependency information are traversed to determine the indirect dependencies between the modules.
2. The method according to claim 1, characterized in that The step of obtaining dependency configuration files of multiple modules in a project includes: Get the root directory of the project, and call the file operation API to traverse the files under the root directory; The dependency configuration file is screened out from the files under the root directory, wherein the dependency configuration file is an XML format file.
3. The method according to claim 2, characterized in that The parsing of the dependency configuration file and converting it into a project object model POM entity class object includes: The dependency configuration file in XML format is converted into a tree-shaped data structure based on XML parsing technology to construct the POM entity class object.
4. The method according to claim 3, characterized in that Analyze the POM entity class object to obtain the direct dependency information corresponding to the module, including: The POM entity class object to be analyzed is determined, and the direct dependency information of the module is obtained by traversing the direct dependency list in the POM entity class object.
5. The method according to claim 4, characterized in that Obtaining dependency information of the dependency-related module from the POM entity class object and copying it to the module currently being analyzed includes: If the dependent module is the parent module of the module currently being analyzed, obtain the POM entity class object of the parent module; Copy the dependencies, dependency management and configuration definitions in the POM entity class object of the parent module to the corresponding child module; If there is still a parent tag in the parent module, recursively execute the steps of obtaining the POM entity class object of the parent module and copying the dependencies, dependency management and configuration definitions in the POM entity class object of the parent module to the corresponding child module until there is no parent module; Replace the tag content defined in the ${} method in the global configuration with the specific configuration.
6. The method according to claim 5, characterized in that The traversing directly dependent dependencies in the dependency information to determine the indirect dependencies between the modules includes: Use a breadth-first algorithm to traverse the directly dependent dependencies and obtain the POM entity class object of the dependency; If the dependency item has a parent module, repeatedly execute the step of obtaining the dependency information of the dependency-related module from the POM entity class object and copying it to the module currently being analyzed; If a dependency conflict occurs, the first dependency traversed is selected according to Maven's rules for resolving dependency conflicts.
7. A Maven project dependency static analysis device, characterized in that: include: The dependency configuration file acquisition module is used to obtain the dependency configuration files of multiple modules in the project; A POM entity class object conversion module is used to parse the dependency configuration file and convert it into a project object model POM entity class object; specifically, a class named POM is created, which contains fields corresponding to elements such as groupId, artifactId and version in the dependency configuration file; A dependency information acquisition module is used to analyze the POM entity class object and obtain the direct dependency information corresponding to the module; A dependency integration module is used to obtain the module with a dependency relationship, and integrate the dependency information of the module with a dependency relationship into the dependency information of the module currently being analyzed; specifically, if the module currently being analyzed has a dependency-related module with a dependency relationship, obtain the POM entity class object of the dependency-related module; obtain the dependency information of the dependency-related module from the POM entity class object, and copy it to the module currently being analyzed; The indirect dependency determination module is used to traverse the directly dependent dependency items in the dependency information to determine the indirect dependencies between the modules.
8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the Maven project dependency static analysis method as described in any one of claims 1-6.
9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the Maven project dependency static analysis method as described in any one of claims 1 to 6 when executed by a computer processor.
Citation Information
Patent Citations
Dependency analysis method and device of JAVA component and medium
CN115357898A
Data governance: change management based on contextualized dependencies
US20170288940A1
