Version package assembly method and device based on Maven

By checking version dependency conflicts, implicit dependencies and non-specified versions in the Maven project, and selecting the appropriate tool set to group packages, the problem of group package errors in the Maven project is solved, improving the accuracy and reliability of version packages, and reducing the accuracy and reliability of version packages. Deployment and run errors.

CN113741959BActive Publication Date: 2025-01-10BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111092275.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-17
Publication Date
2025-01-10
Estimated Expiration
2041-09-17

AI Technical Summary

Technical Problem

In Maven projects, group package errors are often caused by version dependency conflicts, implicit dependencies and non-specified versions, resulting in generation problems and deployment errors. It is difficult for existing technologies to effectively solve these problems.

Method used

A Maven-based version package grouping method is proposed. By checking version dependency conflicts, implicit dependencies and non-specified versions, selecting the appropriate tool set to group packages, and checking the correctness of the configuration file to generate accurate version packages, including Version dependency conflict check module, implicit dependency check module, non-specified version check module, tool set acquisition module, and configuration file check module.

Benefits of technology

Improve the accuracy of the package grouping of version packages, avoid the risk of Maven dependency management and environmental inconsistency, reduce deployment errors and operational errors, and ensure the accuracy and reliability of version packages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113741959B_ABST
    Figure CN113741959B_ABST
Patent Text Reader

Abstract

The present invention provides a version package assembly method and device based on Maven, which can be used in the field of distributed technology. The method includes: checking whether there is a version dependency conflict between code blocks to be assembled in a Maven project; if not, checking whether there is an implicit dependency between the code blocks to be assembled; if not, checking whether there is a non-specified version between the code blocks to be assembled; if not, selecting the toolset required for this assembly from the toolset in the encapsulated docker environment required for assembly according to the environment list of the Maven project; assembling the code blocks to be assembled based on the toolset required for this assembly, and generating a version package of the Maven project; checking whether the configuration file required for the version package is correct, and if so, obtaining a Maven version package with correct assembly. The present invention can realize the assembly of version packages based on Maven, and can improve the accuracy of the assembly of version packages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a version package assembly method and system based on Maven. Background Art

[0002] A large part of production bugs comes from packaging errors, including packaging errors caused by Maven dependencies, environment, etc., which ultimately lead to various generation problems. Therefore, an effective packaging method is needed. Summary of the invention

[0003] The embodiment of the present invention provides a version package assembly method based on Maven, which is used to implement the version package assembly based on Maven and improve the accuracy of the version package assembly. The method includes:

[0004] Check whether there are version dependency conflicts between the code blocks to be packaged in the Maven project;

[0005] If not, check whether there are implicit dependencies between the code blocks to be packaged;

[0006] If not, check whether there are non-specified versions between the code blocks to be packaged;

[0007] If not, select the toolset required for this package assembly from the toolset in the docker environment required for the package assembly according to the environment list of the Maven project;

[0008] Based on the toolset required for this package building, package the code blocks to be packaged and generate the version package of the Maven project;

[0009] Check whether the configuration files required by the version package are correct. If so, obtain the Maven version package with the correct package assembly.

[0010] The embodiment of the present invention provides a version package assembly device based on Maven, which is used to implement version package assembly based on Maven and improve the accuracy of version package assembly. The device includes:

[0011] The version dependency conflict check module is used to check whether there are version dependency conflicts between the code blocks to be packaged in the Maven project;

[0012] Implicit dependency check module, used to check whether there are implicit dependencies between the code blocks to be packaged;

[0013] The non-specified version check module is used to check whether there are non-specified versions between the code blocks to be packaged;

[0014] The toolset acquisition module is used to select the toolset required for this package assembly from the toolset in the docker environment required for the package assembly according to the environment list of the Maven project;

[0015] The package assembly module is used to ensure that there is no version dependency conflict between the code blocks to be assembled, no implicit dependency between the code blocks to be assembled, and no non-specified version between the code blocks to be assembled. Based on the toolset required for this package assembly, the code blocks to be assembled are assembled to generate a version package for the Maven project.

[0016] The configuration file checking module is used to check whether the configuration file required by the version package is correct. If so, obtain the Maven version package with the correct package assembly.

[0017] An embodiment of the present invention further proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned Maven-based version package assembly method when executing the computer program.

[0018] The embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above-mentioned Maven-based version package assembly method.

[0019] In an embodiment of the present invention, it is checked whether there are version dependency conflicts between the code blocks to be packaged in the Maven project; if not, it is checked whether there are implicit dependencies between the code blocks to be packaged; if not, it is checked whether there are non-specified versions between the code blocks to be packaged; if not, according to the environment list of the Maven project, the toolset required for this package is selected from the toolset in the docker environment required for the packaged package; based on the toolset required for this package, the code blocks to be packaged are packaged to generate a version package of the Maven project; it is checked whether the configuration file required for the version package is correct, and if so, the version package of Maven with the correct package is obtained. In the above process, before the package is packaged, a comprehensive check is performed on the code blocks to be packaged, including version dependency conflicts, implicit dependencies, and non-specified versions, so as to avoid the risk of Maven dependency management in advance. The toolset in the docker environment required for the package is packaged, which can avoid the risk of environment inconsistency, and also reduce the repeated configuration of the environment, which can be pulled and built on demand; the inspection of the configuration file reduces the errors caused by the package guide error, deployment error, and even the incomplete parameter customization during the operation phase when the generated version package is deployed. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0021] Figure 1 It is a flowchart of a version package assembly method based on Maven in an embodiment of the present invention;

[0022] Figure 2 It is a detailed flow chart of the version package assembly method based on Maven in an embodiment of the present invention;

[0023] Figure 3 Schematic diagram of a version package assembly device based on Maven in an embodiment of the present invention Figure 1 ;

[0024] Figure 4 Schematic diagram of a version package assembly device based on Maven in an embodiment of the present invention Figure 2 ;

[0025] Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0027] In the description of this specification, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps is not limited and can be appropriately adjusted as needed.

[0028] First, the terms involved in the embodiments of the present invention are explained.

[0029] Maven: Maven is a build tool that mainly serves project building, dependency management, and project information management on the Java platform.

[0030] Maven dependency: In the Internet age, Java applications will reference some third-party class libraries for cost-efficiency reasons. As the program size grows and the dependencies increase, these third-party dependencies imported through Maven are called Maven dependencies.

[0031] Maven transitive dependency: A-->C B-->A==>B-->C, that is, A depends on C, B depends on A, and then B depends on C.

[0032] Maven dependency conflict: depends on different versions of the same jar package. For example: if a depends on version 1.0 of b, c depends on version 1.1 of b, d depends on a and c, and d depends on version b, then the version of b that d depends on conflicts. In this case, the version of the dependency written first in d's pom will be used; if a depends on version 1.0 of b, c depends on version 1.1 of b, d depends on a and c, and f depends on d and c, b still has a version conflict, and Maven will choose the smallest one based on the length of the dependency path.

[0033] Maven dependency conflict problem: If Maven has a dependency conflict, Maven will automatically select a version according to the above rules, which may result in the introduction of a dependency that is not required by the project.

[0034] Maven implicit dependency: A depends on B. According to the transitive dependency principle, when a project declares dependency on A, B is automatically introduced, and the project implicitly depends on B.

[0035] Maven implicit dependency problem: The Maven project code directly uses the interface of B without an explicit declaration. However, if the version of A changes, the version of B may also change accordingly, and the interface used in the code is still the interface of the previous version, resulting in an error.

[0036] Maven introduces the problem of non-specified versions: Maven dependencies do not write version numbers, or use latest, release, snapshot, etc., which causes Maven to pull the corresponding version package according to the build situation when assembling the package, and the fixed version package, and this changed version may not be compatible with the previous version.

[0037] Missing package configuration file: The automatically deployed configuration file is the prerequisite for the version package to be automatically deployed. Missing the package configuration file will result in failure of automatic deployment.

[0038] Figure 1FIG. 1 is a flowchart of a version package assembly method based on Maven in an embodiment of the present invention, such as Figure 1 As shown, including:

[0039] Step 101, check whether there is a version dependency conflict between the code blocks to be packaged in the Maven project;

[0040] Step 102: If not, check whether there is an implicit dependency between the code blocks to be packaged;

[0041] Step 103: If not, check whether there is a non-specified version between the code blocks to be packaged;

[0042] Step 104, if not, select the toolset required for this package assembly from the toolset in the docker environment required for the package assembly according to the environment list of the Maven project;

[0043] Step 105, based on the toolset required for this package assembly, assemble the code blocks to be assembled and generate a version package for the Maven project;

[0044] Step 106, check whether the configuration file required by the version package is correct, and if so, obtain the Maven version package with the correct package assembly.

[0045] In the embodiment of the present invention, before packaging, a comprehensive check is performed on the code blocks to be packaged, including version dependency conflicts, implicit dependencies, and non-specified versions, so as to avoid Maven dependency management risks in advance. The tool set in the docker environment required for packaging is encapsulated to avoid the risk of environment inconsistency, and also reduce the repeated configuration of the environment, which can be pulled and built on demand; the configuration file check reduces the package guide errors, deployment errors, and even errors caused by incomplete parameter customization during the operation stage.

[0046] In step 101, it is checked whether there is a version dependency conflict between the code blocks to be packaged in the Maven project.

[0047] In one embodiment, the method further comprises:

[0048] If there are version dependency conflicts between the code blocks to be packaged, a version dependency conflict prompt message is generated;

[0049] Receive the code block version selected by the developer based on the version dependency conflict prompt information. This can eliminate unnecessary versions and build successfully after another build. Version dependency conflict checking can be implemented through the maven-dependency-versions-check-plugin plug-in.

[0050] Step 102: If not, check whether there is an implicit dependency between the code blocks to be packaged.

[0051] In one embodiment, the method further comprises:

[0052] If there are implicit dependencies between the code blocks to be packaged, the generated version will contain implicit dependency prompt information;

[0053] The receiving developer checks the Show declaration requires code block version checkbox based on the implicit version dependency prompt.

[0054] Implicit dependency checking can be implemented through the maven-enforcer-plugin plug-in. You can also configure the plug-ins maven-enforcer-plugin and illegal-transitive-dependency-check to check whether the reference is an implicit dependency and set an alarm or error.

[0055] Step 103: If not, check whether there is any non-specified version between the code blocks to be packaged.

[0056] When a code block is found without a specified version or the version is latest, release, or snapshot, an unspecified version exists.

[0057] In one embodiment, the method further comprises:

[0058] If there are non-specified versions between the code blocks to be packaged, the non-specified versions are disabled.

[0059] In the above embodiment, the requirePluginVersions configuration option of the enforce target of the maven-enforcer-plugin plug-in is used to forcibly prohibit the use of latest, release, snapshot or not writing.

[0060] Step 104: If not, select the toolset required for this package assembly from the toolset in the packaged docker environment required for the package assembly according to the environment list of the Maven project.

[0061] The above toolsets include jdk6, jdk7, jdk8, npm7, npm8, gcc, etc. When assembling packages, select the corresponding toolset according to the environment list specified by the project.

[0062] Step 105: Based on the toolset required for this package assembly, the code blocks to be packaged are assembled to generate a version package for the Maven project.

[0063] The specific packaging steps include compilation, building, static code checking, Maven package packaging, and automatic deployment version package packaging.

[0064] Step 106, check whether the configuration file required by the version package is correct, and if so, obtain the Maven version package with the correct package assembly.

[0065] In one embodiment, the method further comprises:

[0066] If the version package is incorrect, a configuration file error prompt message is generated.

[0067] Developers need to modify the code and re-package according to the error message in the configuration file. Only after the package specifications are met can the package be successfully assembled and uploaded to the version library.

[0068] In one embodiment, checking whether the configuration file required by the version package is correct includes:

[0069] In the docker environment required for package assembly, based on the jar package and script checked by the configuration file, check whether the configuration file required by the version package is correct. If so, obtain the Maven version package with the correct package assembly.

[0070] In the current devops automatic deployment, our versions need to comply with certain automatic deployment version packaging specifications. If our package assembly does not comply with the specifications, errors will occur in the automatic deployment system during the package guide, during the deployment phase, or even during operation.

[0071] For example:

[0072] If the automatically deployed configuration file is incomplete, there will be package import errors.

[0073] In the configuration file, if the deployment directory field is empty, an error will be reported during the deployment phase.

[0074] If the parameters are not fully extracted, the problem will be more serious if the parameters are not customized and are not found until runtime. Therefore, we need to provide a mechanism and method for checking version package errors.

[0075] In order to flexibly provide inspection plug-ins for devops deployment platforms of different cloud platforms, at least one of the following inspections is performed on the configuration file:

[0076] Configuration file completeness check, module type completeness check, package name and deployment name completeness check, file encoding format check, parameter extraction completeness check, configuration file format check.

[0077] Among them, the above inspections all provide inspection templates to achieve fast and accurate inspections.

[0078] A) Configuration file completeness check: Check whether all configuration files required for automatic deployment exist.

[0079] B) Module type completeness check: Check whether the configuration file of the module unit of the automatically deployed version package includes the module type: APACHFG, APACHEGB, JBOSS, SERVICE, MYSQL, etc., so as to select the appropriate deployment engine to deploy the version during automatic deployment.

[0080] C) Check the completeness of the package name and deployment name: Check whether the package file name and deployment directory name are configured in the version package configuration file. If they do not exist, an error will be reported. This will prevent errors caused by failure to create a deployment directory during deployment.

[0081] D) File encoding format check: It needs to be utf-8 and without BOM header, otherwise an error will be reported. This will prevent parsing errors due to encoding issues when the automatic deployment system parses the configuration file.

[0082] E) Parameter extraction completeness check: Are all ${} type parameters extracted and maintained in the parameter.txt configuration file? Scan the configuration files under ParameterFileList to check the ${} format parameters and compare them with the configuration file list maintained in parameterList.txt. If any parameters do not exist in parameterList.txt, the package assembly is wrong.

[0083] F) Configuration file format check: Check whether the configuration file meets the standard format through standard file format requirements.

[0084] Among them: We can provide customized templates and provide version package checks for different automatic deployment platforms.

[0085] Configuration file completeness check: The template includes parameter file path and file name, and supports simple prefixes and suffixes as well as regular expressions.

[0086] Module type completeness check: The template includes the defined file path and line number corresponding positions, and the corresponding module type list.

[0087] Package name and deployment name sanity check: The template includes the path and file location of the package name and deployment name configuration.

[0088] File encoding format check: The template supports utf-8 format check.

[0089] Parameter extraction completeness check: The template includes the file path list configuration file path and parameter list path.

[0090] Configuration file format check: The template supports file type [txt, excel], number of columns, and space check.

[0091] Based on the above embodiments, Figure 2 The following is a detailed flow chart of the version package assembly method based on Maven in an embodiment of the present invention, and the specific steps include:

[0092] Step 201, check whether there is a version dependency conflict between the code blocks to be packaged in the Maven project; if so, go to step 202; if not, go to step 203;

[0093] Step 202: Generate version dependency conflict prompt information; and receive the code block version selected by the developer according to the version dependency conflict prompt information.

[0094] Step 203: Check whether there is an implicit dependency between the code blocks to be packaged; if so, go to step 204; if not, go to step 205;

[0095] Step 204, generating a prompt message indicating that a version has an implicit dependency; and receiving a display declaration requiring a code block version selected by the developer according to the prompt message indicating that a version has an implicit dependency.

[0096] Step 205, check whether there are non-specified versions between the code blocks to be packaged; if so, go to step 206; if not, go to step 207;

[0097] Step 206, disabling the non-specified version;

[0098] Step 207, according to the environment list of the Maven project, select the toolset required for this package assembly from the toolset in the docker environment required for the package assembly;

[0099] Step 208: Based on the toolset required for this package assembly, the code blocks to be packaged are assembled to generate a version package for the Maven project.

[0100] Step 209, check whether the configuration file required by the version package is correct, if so, go to step 210; if not, go to step 211;

[0101] Step 210, obtaining a Maven version package with the correct package assembly;

[0102] Step 211, generating configuration file error prompt information.

[0103] The present invention also proposes a version package assembly device based on Maven, the principle of which is the same as the version package assembly method based on Maven, and will not be repeated here.

[0104] Figure 3Schematic diagram of a version package assembly device based on Maven in an embodiment of the present invention Figure 1 ,like Figure 3 As shown, including:

[0105] The version dependency conflict checking module 301 is used to check whether there is a version dependency conflict between the code blocks to be packaged in the Maven project;

[0106] An implicit dependency checking module 302 is used to check whether there is an implicit dependency between the code blocks to be packaged;

[0107] A non-specified version checking module 303 is used to check whether there is a non-specified version between the code blocks to be packaged;

[0108] A tool set acquisition module 304 is used to select the tool set required for this package assembly from the tool set in the packaged docker environment required for the package assembly according to the environment list of the Maven project;

[0109] The package assembly module 305 is used to assemble the code blocks to be assembled based on the toolset required for this package assembly, and generate a version package for the Maven project, if there is no version dependency conflict between the code blocks to be assembled, no implicit dependency between the code blocks to be assembled, and no non-specified version between the code blocks to be assembled;

[0110] The configuration file checking module 306 is used to check whether the configuration file required by the version package is correct, and if so, obtain the Maven version package with the correct package assembly.

[0111] Figure 4 Schematic diagram of a version package assembly device based on Maven in an embodiment of the present invention Figure 2 In one embodiment, the device further includes an exception handling module 401, which is used to generate version dependency conflict prompt information if there is a version dependency conflict between the code blocks to be packaged;

[0112] The code block version selected by the developer according to the version dependency conflict prompt information is received.

[0113] In one embodiment, the exception handling module 401 is further used to:

[0114] If there are implicit dependencies between the code blocks to be packaged, the generated version will contain implicit dependency prompt information;

[0115] The receiving developer checks the Show declaration requires code block version checkbox based on the implicit version dependency prompt.

[0116] In one embodiment, the exception handling module 401 is further used to:

[0117] If there are non-specified versions between the code blocks to be packaged, the non-specified versions are disabled.

[0118] In one embodiment, the exception handling module 401 is further used to:

[0119] If the version package is incorrect, a configuration file error prompt message is generated.

[0120] In one embodiment, the configuration file checking module is specifically used to:

[0121] Perform at least one of the following checks on the configuration file:

[0122] Configuration file completeness check, module type completeness check, package name and deployment name completeness check, file encoding format check, parameter extraction completeness check, configuration file format check.

[0123] In one embodiment, the configuration file checking module is specifically used to:

[0124] In the docker environment required by the package assembly, based on the jar package and script checked by the configuration file, check whether the configuration file required by the version package is correct.

[0125] In summary, in the method and device proposed in the embodiment of the present invention, the version dependency conflict checking module is used to check whether there is a version dependency conflict between the code blocks to be packaged in the Maven project; the implicit dependency checking module is used to check whether there is an implicit dependency between the code blocks to be packaged; the non-specified version checking module is used to check whether there is a non-specified version between the code blocks to be packaged; the tool set acquisition module is used to select the toolset required for this package from the toolset in the docker environment required for packaged package according to the environment list of the Maven project; the package module is used to package the code blocks to be packaged based on the toolset required for this package, if there is no version dependency conflict between the code blocks to be packaged, and there is no implicit dependency between the code blocks to be packaged, and there is no non-specified version between the code blocks to be packaged, and there is no non-specified version between the code blocks to be packaged, and the version package of the Maven project is generated based on the toolset required for this package; the configuration file checking module is used to check whether the configuration file required for the version package is correct, and if so, obtain the correct Maven version package for packaged package. In the above process, before the package is packaged, the code blocks to be packaged are comprehensively checked, including version dependency conflicts, implicit dependencies, and non-specified versions, so as to avoid the risk of Maven dependency management in advance. The tool set required for package assembly in the docker environment is encapsulated to avoid the risk of environment inconsistency, and also reduce the repeated configuration of the environment. It can be pulled and built on demand; the configuration file inspection reduces the errors caused by package guide errors, deployment errors, and even incomplete parameter customization during the operation phase when the generated version package is deployed. The embodiment of the present invention also provides a computer device, Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. The computer device can implement all steps in the version package assembly method based on Maven in the above embodiment. The computer device specifically includes the following contents:

[0126] Processor (processor) 501, memory (memory) 502, communication interface (CommunicationsInterface) 503 and communication bus 504;

[0127] The processor 501, the memory 502, and the communication interface 503 communicate with each other through the communication bus 504; the communication interface 503 is used to realize information transmission between the server-side device, the detection device, the user-side device and other related devices;

[0128] The processor 501 is used to call the computer program in the memory 502. When the processor executes the computer program, all steps in the version package assembly method based on Maven in the above embodiment are implemented.

[0129] An embodiment of the present invention further provides a computer-readable storage medium, which can implement all the steps in the Maven-based version package assembly method in the above embodiment. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements all the steps in the Maven-based version package assembly method in the above embodiment.

[0130] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0131] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0132] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0134] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A version package assembly method based on Maven, characterized in that: include: Check whether there are version dependency conflicts between the code blocks to be packaged in the Maven project; If not, check whether there are implicit dependencies between the code blocks to be packaged; If not, check whether there are non-specified versions between the code blocks to be packaged; If not, select the toolset required for this package assembly from the toolset in the docker environment required for the package assembly according to the environment list of the Maven project; Based on the toolset required for this package building, package the code blocks to be packaged and generate the version package of the Maven project; Check whether the configuration files required by the version package are correct. If so, obtain the Maven version package with the correct package assembly. When a code block is found to have no specified version or the version is latest, release, or snapshot, an unspecified version exists; Check whether the configuration files required by the version package are correct, including: Perform at least one of the following checks on the configuration file: Configuration file completeness check, module type completeness check, package name and deployment name completeness check, file encoding format check, parameter extraction completeness check, configuration file format check; The inspection provides a template that can be customized in a customized manner; In the configuration file integrity check, the template includes the parameter file path and file name, and supports simple prefixes and suffixes as well as regular expressions; In the module type completeness check, the template includes the corresponding location of the defined file path and line number, and the corresponding module type list; In the package name and deployment name sanity check, the template includes the path and file location of the package name and deployment name configuration; In the file encoding format check, the template supports utf-8 format check; In the parameter extraction completeness check, the template includes the file path list configuration file path and parameter list path; In the configuration file format check, the template supports file type [txt, excel], number of columns, and space checks.

2. The version package assembly method based on Maven according to claim 1, characterized in that: Also includes: If there are version dependency conflicts between the code blocks to be packaged, a version dependency conflict prompt message is generated; The code block version selected by the developer according to the version dependency conflict prompt information is received.

3. The version package assembly method based on Maven according to claim 1, characterized in that: Also includes: If there are implicit dependencies between the code blocks to be packaged, the generated version will contain implicit dependency prompt information; The receiving developer checks the Show declaration requires code block version checkbox based on the implicit version dependency prompt.

4. The version package assembly method based on Maven according to claim 1, characterized in that: Also includes: If there are non-specified versions between the code blocks to be packaged, the non-specified versions are disabled.

5. The version package assembly method based on Maven according to claim 1, characterized in that: Also includes: If the version package is incorrect, a configuration file error prompt message is generated.

6. The version package assembly method based on Maven according to claim 1, characterized in that: Check whether the configuration files required by the version package are correct, including: In the docker environment required by the package assembly, based on the jar package and script checked by the configuration file, check whether the configuration file required by the version package is correct.

7. A version package assembly device based on Maven, characterized in that: include: The version dependency conflict check module is used to check whether there are version dependency conflicts between the code blocks to be packaged in the Maven project; Implicit dependency check module, used to check whether there are implicit dependencies between the code blocks to be packaged; The non-specified version check module is used to check whether there are non-specified versions between the code blocks to be packaged; The toolset acquisition module is used to select the toolset required for this package assembly from the toolset in the docker environment required for the package assembly according to the environment list of the Maven project; The package assembly module is used to ensure that there is no version dependency conflict between the code blocks to be assembled, no implicit dependency between the code blocks to be assembled, and no non-specified version between the code blocks to be assembled. Based on the toolset required for this package assembly, the code blocks to be assembled are assembled to generate a version package for the Maven project. The configuration file checking module is used to check whether the configuration file required by the version package is correct. If so, obtain the Maven version package with the correct package assembly; Check whether the configuration files required by the version package are correct, including: Perform at least one of the following checks on the configuration file: Configuration file completeness check, module type completeness check, package name and deployment name completeness check, file encoding format check, parameter extraction completeness check, configuration file format check; When a code block is found to have no specified version or the version is latest, release, or snapshot, an unspecified version exists; Check whether the configuration files required by the version package are correct, including: Perform at least one of the following checks on the configuration file: Configuration file completeness check, module type completeness check, package name and deployment name completeness check, file encoding format check, parameter extraction completeness check, configuration file format check; The inspection provides a template that can be customized in a customized manner; In the configuration file integrity check, the template includes the parameter file path and file name, and supports simple prefixes and suffixes as well as regular expressions; In the module type completeness check, the template includes the corresponding location of the defined file path and line number, and the corresponding module type list; In the package name and deployment name sanity check, the template includes the path and file location of the package name and deployment name configuration; In the file encoding format check, the template supports utf-8 format check; In the parameter extraction completeness check, the template includes the file path list configuration file path and parameter list path; In the configuration file format check, the template supports file type [txt, excel], number of columns, and space checks.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Shell script-based automatic deployment method and system

    CN108647037A

  • Method for automatically detecting dependency conflict problem in Maven project based on GitHub

    CN112799937A