Synchronization method and device of nexus repository artifact, computer device and storage medium
By receiving Select, List, and Sync commands, the Nexus private database artifact data path is determined and filtered, resolving network connectivity issues during large-scale migration of Nexus private database data and achieving efficient artifact data synchronization and storage optimization.
Patent Information
- Application Number
- CN202311696740.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-12-11
AI Technical Summary
The large amount of legacy data in the Nexus private repository and network connectivity issues in the remote data center prevented the normal migration of product data from the private repository.
The synchronization process requests the control layer to receive the Select command to determine the context data of the current artifact path; in response to the List command, it lists and filters artifact data in the Nexus source artifact library; upon receiving the Sync command, it synchronizes the target data from the Nexus source artifact library to the target artifact library, and processes the target data using custom configurations and commands.
It enables on-demand synchronization of Nexus private repository artifact data, solves network connectivity issues during large-scale data migration, and improves migration efficiency and storage space utilization.
Smart Images

Figure CN117807043B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data synchronization technology, and in particular to a method, apparatus, computer equipment and storage medium for synchronizing Nexus warehouse artifacts. Background Technology
[0002] Nexus private repositories are widely used, primarily for storing company binary artifacts, acting as a central repository, and storing mirrored data. Therefore, over time, the amount of legacy artifacts in various companies' private repositories has become enormous, making data migration a very challenging issue. Thus, resolving the problem of large amounts of legacy data in Nexus private repositories and network connectivity issues in remote data centers hindering data migration has become a pressing technical challenge. Summary of the Invention
[0003] This application provides a method, apparatus, computer equipment, and storage medium for synchronizing Nexus warehouse artifacts, in order to solve the problem that the large amount of legacy data in the Nexus private warehouse and the inability to migrate private warehouse artifact data normally due to network connectivity issues in remote data centers.
[0004] In a first aspect, this application provides a method for synchronizing artifacts in a Nexus warehouse, the method comprising:
[0005] The synchronous procedure requests the control layer to receive the Select command and determines the context data of the current workpiece path;
[0006] In response to the List command, the synchronization procedure requests the control layer to determine the artifact data of the context data in the Nexus source artifact library;
[0007] When the synchronization program request control layer receives the Sync command, the target data in the product data is synchronized from the Nexus source product library to the Nexus target product library, thus completing the synchronization of Nexus warehouse products.
[0008] Furthermore, in response to the List command, before requesting the control layer to determine the artifact data of the context data in the Nexus source artifact library via the synchronization procedure, the method further includes:
[0009] Detect whether the current product path is a real and valid path;
[0010] If the current product path is the true and valid path, list all product data in the current product path, and filter all product data to remove useless product data.
[0011] Furthermore, before detecting whether the current product path is a genuine and valid path, the process also includes:
[0012] Configure the corresponding account and password based on the List command.
[0013] Further, after detecting whether the current product path is a real and valid path, the process includes:
[0014] In the case that the current product path is not the actual valid path, and / or
[0015] If the target data is not found in the current product path, a Reback command is sent to return to the preset path.
[0016] Furthermore, the default path includes the root directory or the parent directory.
[0017] Furthermore, upon receiving a Sync command from the synchronization program request control layer, the target data in the artifact data is synchronized from the Nexus source artifact library to the Nexus target artifact library, completing the synchronization of Nexus warehouse artifacts, including:
[0018] Based on the Sync command, the target data is converted into source product data corresponding to the Nexus OpenAPI interface;
[0019] The source artifact data is synchronized from the Nexus source artifact library to the Nexus target artifact library.
[0020] Furthermore, the Nexus source artifact library and the Nexus target artifact library are connected via a 4A jump board.
[0021] Secondly, this application also provides a synchronization device for Nexus warehouse artifacts, the device comprising:
[0022] The context data determination module is used to request the control layer to receive the Select command through the synchronization program and determine the context data of the current product path;
[0023] The product data determination module is used to respond to the List command by requesting the control layer to determine the product data of the context data in the Nexus source product library through the synchronization program;
[0024] The synchronization module is used to synchronize the target data in the product data from the Nexus source product library to the Nexus target product library when the synchronization program requests the control layer to receive the Sync command, thereby completing the synchronization of Nexus warehouse products.
[0025] Thirdly, this application also provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the synchronization method of Nexus warehouse artifacts as described above.
[0026] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the Nexus warehouse artifact synchronization method as described above.
[0027] This application discloses a method, apparatus, computer device, and storage medium for synchronizing Nexus warehouse artifacts. The method includes requesting the control layer to receive a Select command via a synchronization program to determine the context data of the current artifact path; responding to a List command, requesting the control layer to determine the artifact data of the context data in the Nexus source artifact library via the synchronization program; and, upon receiving a Sync command from the control layer via the synchronization program request, synchronizing the target data in the artifact data from the Nexus source artifact library to the Nexus target artifact library, thus completing the synchronization of Nexus warehouse artifacts. Through this method, this application, based on a custom configuration of the target data in the Nexus source artifact library and the Nexus target artifact library, and by applying different processing methods to the target data according to different commands such as Select, List, and Sync commands, achieves the synchronization of target data from the Nexus source artifact library to the Nexus target artifact library. This solves the problem of large amounts of legacy data in the Nexus private database and network connectivity issues in remote data centers preventing the normal migration of private database artifact data. Attached Figure Description
[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a schematic flowchart of a method for synchronizing Nexus warehouse artifacts provided in the first embodiment of this application;
[0030] Figure 2 This is a schematic flowchart of a method for synchronizing Nexus warehouse artifacts provided in the second embodiment of this application;
[0031] Figure 3A schematic block diagram of a synchronization device for Nexus warehouse products provided for embodiments of this application;
[0032] Figure 4 A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0034] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0035] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0036] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0037] This application provides a method, apparatus, computer device, and storage medium for synchronizing Nexus repository artifacts. The synchronization method can be applied to a server. Based on a custom configuration of target data in the Nexus source artifact repository and the Nexus target artifact repository, and using different commands such as Select, List, and Sync, the target data is processed differently to synchronize it from the Nexus source artifact repository to the Nexus target artifact repository. This solves the problem of large amounts of legacy data in the Nexus private repository and network connectivity issues in remote data centers preventing normal data migration. The server can be a standalone server or a server cluster.
[0038] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0039] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating a method for synchronizing Nexus repository artifacts according to the first embodiment of this application. This method can be applied to a server. Based on custom configurations of the Nexus source artifact repository and the target artifact repository, and using different commands such as Select, List, and Sync, the target data is processed differently to synchronize it from the Nexus source artifact repository to the Nexus target artifact repository. This solves the problem of large amounts of legacy data in the Nexus private repository and network connectivity issues in remote data centers preventing normal migration of private repository artifact data.
[0040] like Figure 1 As shown, the synchronization method for Nexus warehouse artifacts specifically includes steps S10 to S30.
[0041] Step S10: Request the control layer to receive the Select command through the synchronization program to determine the context data of the current workpiece path;
[0042] In one embodiment, the Select command is used to determine the context data of the current artifact path. Its purpose is to tell the user the starting path for synchronizing data, facilitating the user's next operation. For example, Select com / ctg / devops means that the path currently selected by the user is ${repository.source.url} / com / ctg / devops, and subsequent user queries and data synchronization will be performed under this path. The biggest function of this command is to determine the synchronization path, reduce the amount of data of synchronized artifacts, meet the requirements of on-demand synchronization, and is a unique command of MSAP products, specifically designed to solve the problem of artifact synchronization in MAVEN warehouses.
[0043] Step S20: In response to the List command, the synchronization procedure requests the control layer to determine the artifact data of the context data in the Nexus source artifact library;
[0044] In one embodiment, the List command is used to list subdirectories or product data under the currently selected directory, such as List. When executing the List command, it is first necessary to ensure that the current path is real and valid, and then obtain the corresponding list data through Nexusopenapi. If an account and password are required, the corresponding warehouse account and password must be configured in the device. The main function of this command is to list which product data is under the current directory, and further filter the data that the user needs to synchronize.
[0045] Step S30: When the synchronization program request control layer receives the Sync command, the target data in the product data is synchronized from the Nexus source product library to the Nexus target product library, thus completing the synchronization of Nexus warehouse products.
[0046] In one embodiment, the `Sync` command is used to synchronize artifacts. This embodiment can synchronize a specific artifact from the NexusB source repository to the target artifact repository NexusA. It includes the following input parameters: `-Dfolder`, `-Dfile`, `-DgroupId`, `-DartifactId`, `-Dversion`, `-Dpackaging`, and `-DpomFile`. For example, `Sync -Dfolder = org / apache`. `-Dfolder` and `-Dfile` cannot be used simultaneously; the former synchronizes the entire directory, while the latter synchronizes specific artifacts. They are used in conjunction with the five input parameters `-DgroupId`, `-DartifactId`, `-Dversion`, `-Dpackaging`, and `-DpomFile`. This command is crucial for artifact synchronization. It converts user commands into data required by the corresponding Nexus OpenAPI interface, uploads the source artifact repository data to the target artifact repository, and completes the synchronization process. This command is a key artifact synchronization command, a self-implemented capability, unaffected by other Maven private repository versions, flexible and simple, and compatible with native Maven commands.
[0047] This embodiment discloses a method, apparatus, computer device, and storage medium for synchronizing Nexus warehouse artifacts. The method includes requesting the control layer to receive a Select command via a synchronization program to determine the context data of the current artifact path; responding to a List command, requesting the control layer to determine the artifact data of the context data in the Nexus source artifact library via the synchronization program; and, upon receiving a Sync command from the control layer via the synchronization program request, synchronizing the target data in the artifact data from the Nexus source artifact library to the Nexus target artifact library, thus completing the synchronization of Nexus warehouse artifacts. Through this method, this application, based on a custom configuration of the target data in the Nexus source artifact library and the Nexus target artifact library, and by applying different processing to the target data according to different commands such as Select, List, and Sync commands, achieves the synchronization of target data from the Nexus source artifact library to the Nexus target artifact library. This solves the problem of large amounts of legacy data in the Nexus private database and network connectivity issues in remote data centers preventing the normal migration of private database artifact data.
[0048] Please see Figure 2 , Figure 2This is a schematic flowchart illustrating a method for synchronizing Nexus repository artifacts according to a second embodiment of this application. This method can be applied to a server. Based on custom configurations of target data in the Nexus source artifact repository and the Nexus target artifact repository, and using different commands such as Select, List, and Sync, the target data is processed differently to synchronize it from the Nexus source artifact repository to the Nexus target artifact repository. This solves the problem of large amounts of legacy data in the Nexus private repository and network connectivity issues in remote data centers preventing normal migration of private repository artifact data.
[0049] based on Figure 1 The illustrated embodiment, for example Figure 2 As shown, steps S11 to S12 are included before step S20.
[0050] Step S11: Detect whether the current product path is a real and valid path;
[0051] Step S12: If the current product path is the real and valid path, list all product data in the current product path, and filter all product data to remove useless product data.
[0052] In one embodiment, taking the folder com / ctg / itrdc / cache as an example, the synchronization command is:
[0053] Sync-Dfolder=com / ctg / itrdc / cache
[0054] To synchronize the folder, you first need to confirm that there is artifact data under the current user's Select com / ctg / itrdc / cache path. This is done by using the / v1 / search interface to query the artifact data. If it is found, return it to the user; otherwise, leave it empty. Note that when synchronizing the folder, you need to block some verification files such as MD5 and SHA1 files to reduce the workload of synchronization.
[0055] Considering the potentially large number of finished product files, or the existence of a single large file, the following four techniques were used:
[0056] 1. Network file stream prefetch stream size;
[0057] 2. Read network file stream data in segments;
[0058] 3. Merge the files again;
[0059] 4. Java multithreading.
[0060] Pre-read the file size based on the value of the Content-Length field in the returned response header. This is useful for determining whether the file needs to be split; if the file exceeds 512MB, reading it from a single file stream would be very time-consuming.
[0061] Segmented reading of streaming data, using the RandomAccessFile class, speeds up the acquisition of source artifact data and writes it to the tmp file, thereby improving synchronization speed;
[0062] File merging involves combining multiple segmented tmp files into a single source file, verifying the correctness of the merged file, and facilitating the next step of the upload process.
[0063] Java multithreading is used for both segmented reading of network file stream data and uploading of multiple pieces of data, as well as to speed up the synchronization process and reduce user waiting time.
[0064] This embodiment discloses a method, apparatus, computer device, and storage medium for synchronizing Nexus warehouse artifacts. The method for synchronizing Nexus warehouse artifacts includes: receiving a Select command through a synchronization program requesting the control layer to determine the context data of the current artifact path; detecting whether the current artifact path is a valid path; if the current artifact path is a valid path, listing all artifact data in the current artifact path and filtering the all artifact data to remove useless artifact data; responding to a List command, requesting the control layer through the synchronization program to determine the artifact data of the context data in the Nexus source artifact library; and, if the synchronization program requesting the control layer receives a Sync command, synchronizing the target data in the artifact data from the Nexus source artifact library to the Nexus target artifact library, thus completing the synchronization of Nexus warehouse artifacts. Through the above method, this application uses the target data in the Nexus source artifact library and the Nexus target artifact library according to the custom configuration, and performs different processing on the target data according to different commands such as Select, List and Sync commands to realize the synchronization of target data from the Nexus source artifact library to the Nexus target artifact library. This solves the problem that the large amount of legacy data in the Nexus private library and the inability to migrate private library artifact data normally due to network incompatibility in remote data centers are the reasons.
[0065] based on Figure 2 In the illustrated embodiment, before step S12, the following steps are also included:
[0066] Configure the corresponding account and password based on the List command.
[0067] based on Figure 2In the illustrated embodiment, before step S11, the following steps are included:
[0068] In the case that the current product path is not the actual valid path, and / or
[0069] If the target data is not found in the current product path, a Reback command is sent to return to the preset path.
[0070] In one embodiment, the Reback command is used to revert to a specified directory. When using this command, the validity of the target path is verified. For example, Reback... reverts to the parent directory. If the current directory is the root directory, it cannot revert further. The main function of this command is to revert to the corresponding target path when the user finds that the required product is not in the current path.
[0071] Based on the above embodiments, in one embodiment, the preset path includes the root directory or the parent directory.
[0072] based on Figure 1 In the illustrated embodiment, step S30 includes:
[0073] Based on the Sync command, the target data is converted into source product data corresponding to the Nexus OpenAPI interface;
[0074] The source artifact data is synchronized from the Nexus source artifact library to the Nexus target artifact library.
[0075] Based on any of the above embodiments, in this embodiment, the Nexus source artifact library and the Nexus target artifact library are connected through a 4A jump server.
[0076] In one embodiment, the application.properties configuration example is as follows:
[0077]
[0078] The Nexus OpenAPI involved is as follows:
[0079]
[0080] Taking the ctg-cache-nclient-2.8.2.jar artifact as an example, its Maven dependencies are as follows:
[0081]
[0082] The synchronization command is as follows:
[0083]
[0084] The -Dpackaging and -DpomFile parameters are optional. The default value for packaging is jar. If it is a war type, then -Dpackaging=war. pomFile is used to synchronize the Maven pom file. If synchronization is required, this parameter needs to be added. For example: -DpomFile=ctg-cache-nclient-2.8.2.pom.
[0085] This embodiment supports on-demand synchronization, avoiding the time-consuming full synchronization, excessive redundant data, and serious disk waste. Currently, this invention supports synchronization by folder and by single file.
[0086] The synchronization speed is fast. For large files, the file stream is split into individual segments. Multi-threading is used to quickly read the stream data, and then the merging technology is used to verify the correctness of the files. Finally, multi-threading is used to synchronize the data of multiple artifacts to the target artifact library.
[0087] It has high scalability. First, it is developed in-house and supports user customization needs. Second, although it currently only supports Maven artifacts, Nexus openapi also supports uploading other mainstream artifacts such as Docker and npm. As long as it is developed in accordance with its specifications, it can support the synchronization of artifact types required by many users.
[0088] Deployment and operation are simple and flexible, and hardware resources are minimal. This invention is built on the Spring Boot scaffolding framework, making development, compilation, and packaging very simple.
[0089] Currently available technologies and tools, such as Nexus, have two main limitations: first, they do not support on-demand synchronization, only full synchronization; second, even if Nexus 3 can directly copy to the target artifact repository, its storage structure is encrypted, not a traditional folder / file structure. Without the source artifact repository's metadata, it cannot be parsed correctly, essentially wasting storage space and performing useless work. This invention aims to solve these two major problems for users. Considering that most private repository files are primarily public packages with a limited number of private artifacts, and since we mostly only need to synchronize the file data of private artifacts, this significantly reduces the synchronization workload and speeds up the artifact data synchronization process.
[0090] Please see Figure 3 , Figure 3 This is a schematic block diagram of a Nexus warehouse artifact synchronization device provided in an embodiment of this application. This Nexus warehouse artifact synchronization device is used to execute the aforementioned Nexus warehouse artifact synchronization method. The Nexus warehouse artifact synchronization device can be configured on a server.
[0091] like Figure 3 As shown, the synchronization device for the Nexus warehouse products includes:
[0092] The context data determination module 410 is used to request the control layer to receive the Select command through the synchronization program and determine the context data of the current workpiece path;
[0093] The product data determination module 420 is used to respond to the List command and request the control layer to determine the product data of the context data in the Nexus source product library through the synchronization program;
[0094] The synchronization module 430 is used to synchronize the target data in the product data from the Nexus source product library to the Nexus target product library when the synchronization program request control layer receives the Sync command, thereby completing the synchronization of Nexus warehouse products.
[0095] Furthermore, the synchronization device for the Nexus warehouse products also includes:
[0096] The real and valid path detection module is used to detect whether the current product path is a real and valid path;
[0097] The product data filtering module is used to list all product data in the current product path when the current product path is the real and valid path, and to filter all product data to remove useless product data.
[0098] Furthermore, the synchronization device for the Nexus warehouse products also includes:
[0099] The account and password configuration module is used to configure the corresponding account and password based on the List command.
[0100] Furthermore, the synchronization device for the Nexus warehouse products also includes:
[0101] The Reback command module is used when the current artifact path is not the actual valid path, and / or
[0102] If the target data is not found in the current product path, a Reback command is sent to return to the preset path.
[0103] Furthermore, the synchronization module 430 includes:
[0104] The source product data conversion unit is used to convert the target data into source product data corresponding to the NexusOpenAPI interface based on the Sync command.
[0105] The source product data synchronization unit is used to synchronize the source product data from the Nexus source product library to the Nexus target product library.
[0106] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0107] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 4 It runs on the computer device shown.
[0108] Please see Figure 4 , Figure 4 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.
[0109] See Figure 4 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0110] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any method of synchronizing Nexus warehouse artifacts.
[0111] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0112] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When executed by a processor, the computer program enables the processor to perform any method of synchronizing Nexus warehouse artifacts.
[0113] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0114] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0115] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:
[0116] The synchronous procedure requests the control layer to receive the Select command and determines the context data of the current workpiece path;
[0117] In response to the List command, the synchronization procedure requests the control layer to determine the artifact data of the context data in the Nexus source artifact library;
[0118] When the synchronization program request control layer receives the Sync command, the target data in the product data is synchronized from the Nexus source product library to the Nexus target product library, thus completing the synchronization of Nexus warehouse products.
[0119] In one embodiment, before requesting the control layer to determine the artifact data of the context data in the Nexus source artifact library in response to the List command, the following is also implemented:
[0120] Detect whether the current product path is a real and valid path;
[0121] If the current product path is the true and valid path, list all product data in the current product path, and filter all product data to remove useless product data.
[0122] In one embodiment, before detecting whether the current product path is a valid path, the following is also implemented:
[0123] Configure the corresponding account and password based on the List command.
[0124] In one embodiment, after detecting whether the current product path is a real and valid path, it is used to achieve:
[0125] In the case that the current product path is not the actual valid path, and / or
[0126] If the target data is not found in the current product path, a Reback command is sent to return to the preset path.
[0127] In one embodiment, when the synchronization program request control layer receives a Sync command, the target data in the artifact data is synchronized from the Nexus source artifact library to the Nexus target artifact library, completing the synchronization of Nexus warehouse artifacts, and is used to achieve:
[0128] Based on the Sync command, the target data is converted into source product data corresponding to the Nexus OpenAPI interface;
[0129] The source artifact data is synchronized from the Nexus source artifact library to the Nexus target artifact library.
[0130] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the Nexus warehouse artifact synchronization methods provided in the embodiments of this application.
[0131] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMediaCard (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0132] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for synchronizing Nexus warehouse artifacts, characterized in that, include: The synchronous program requests the control layer to receive the Select command and determine the context data of the current product path. The context data includes at least the warehouse URL and sub-path information of the currently selected path. In response to the List command, the synchronization procedure requests the control layer to call the Nexus openapi interface to determine the artifact data of the context data in the Nexus source artifact library; When the synchronization program requests the control layer to receive the Sync command, the target data in the artifact data is converted into the data required by the Nexus openapi interface, and then synchronized from the Nexus source artifact library to the Nexus target artifact library to complete the synchronization of Nexus warehouse artifacts. The Nexus source artifact library and the Nexus target artifact library are connected through a 4A jump server.
2. The method for synchronizing Nexus warehouse artifacts according to claim 1, characterized in that, Before responding to the List command and requesting the control layer to determine the artifact data of the context data in the Nexus source artifact library via the synchronization procedure, the method further includes: Detect whether the current product path is a real and valid path; If the current product path is the true and valid path, list all product data in the current product path, and filter all product data to remove useless product data.
3. The method for synchronizing Nexus warehouse artifacts according to claim 2, characterized in that, Before detecting whether the current product path is a valid path, the method further includes: Configure the corresponding account and password based on the List command.
4. The method for synchronizing Nexus warehouse artifacts according to claim 2, characterized in that, After detecting whether the current product path is a real and valid path, the process includes: In the case that the current product path is not the actual valid path, and / or If the target data is not found in the current product path, a Reback command is sent to return to the preset path.
5. The method for synchronizing Nexus warehouse artifacts according to claim 4, characterized in that, The preset path includes the root directory or the parent directory.
6. The method for synchronizing Nexus warehouse artifacts according to claim 1, characterized in that, When the synchronization program request control layer receives a Sync command, the target data in the artifact data is synchronized from the Nexus source artifact library to the Nexus target artifact library to complete the synchronization of Nexus warehouse artifacts, including: Based on the Sync command, the target data is converted into source product data corresponding to the Nexus OpenAPI interface; The source artifact data is synchronized from the Nexus source artifact library to the Nexus target artifact library.
7. The method for synchronizing Nexus warehouse artifacts according to any one of claims 1 to 6, characterized in that, The Nexus source artifact library and the Nexus target artifact library are connected via a 4A jump board.
8. A synchronization device for Nexus warehouse products, characterized in that, include: The context data determination module is used to request the control layer to receive the Select command through a synchronization program and determine the context data of the current product path, wherein the context data includes at least the warehouse URL and sub-path information of the currently selected path; The product data determination module is used to respond to the List command by requesting the control layer to call the Nexusopenapi interface through the synchronization program to determine the product data of the context data in the Nexus source product library; The synchronization module is used to convert the target data in the artifact data into the data required by the Nexus openapi interface after the synchronization program request control layer receives the Sync command, and then synchronize it from the Nexus source artifact library to the Nexus target artifact library to complete the synchronization of Nexus warehouse artifacts. The Nexus source artifact library and the Nexus target artifact library are connected through a 4A jump server.
9. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the method for synchronizing Nexus warehouse artifacts as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the method for synchronizing Nexus warehouse artifacts as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Product synchronization method under network limitation condition
CN116737839A
Nexus repository product synchronization method and apparatus, computer device, and storage medium
WO2024212622A1