CN112506561B - Packing method for filter implementation based on maven - Google Patents
Packing method for filter implementation based on maven Download PDFInfo
- Publication number
- CN112506561B CN112506561B CN202011482734.XA CN202011482734A CN112506561B CN 112506561 B CN112506561 B CN 112506561B CN 202011482734 A CN202011482734 A CN 202011482734A CN 112506561 B CN112506561 B CN 112506561B
- Authority
- CN
- China
- Prior art keywords
- configuration
- directory
- file
- env
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method for packing a filter implementation based on maven, which comprises the following steps of S1, adding a filters directory under a root directory of a java item, S2, adding a configuration file under the filters directory according to packing requirements, S3, adding a configuration item in a key=value format to the configuration file, wherein the key is the configuration item, the value is a value of the configuration item, S4, adding configuration in a pore file corresponding to the maven item, S5, configuring a packing command, deploying a specific value of the platform maven command into the directory, and the specific value is a file name of a file specified according to the packing requirements in the configuration file, and S6, triggering packing operation to finish packing. The maven packing command of different projects is flexibly configured according to packing requirements, automatic packing is realized, and the method is suitable for various project structures.
Description
Technical Field
The invention relates to the technical field of software, in particular to a packing method for realizing a filter based on maven.
Background
In the prior art, a maven packaging command is generally adopted for packaging, a configuration file directory is designated, and an online war package is generated, but the method is only suitable for items with a single function in an item structure, and many existing item structures depend on different dependent packages to realize different functions.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a packing method realized by a filter based on maven, which aims to solve the technical problems.
The invention discloses a packing method realized by a filter based on maven, which is characterized by comprising the following steps of S1, adding a filters directory under a java project root directory, S2, adding a configuration file under the filters directory according to packing requirements, adding a configuration item to the configuration file according to the packing requirements, S3, adopting a key=value format of the configuration file, wherein the key is the configuration item, the value is the value of the configuration item, S4, adding configuration in the corresponding pom file of the maven project, S5, configuring a packing command, deploying a specific value of the directory which is transmitted by the platform maven command, wherein the specific value is the file name of a file specified according to the packing requirements in the configuration file, S6, triggering packing operation, and finishing packing.
In the above method, step S2 includes the steps of:
S21, adding a deployment environment directory env and a sub-application package directory subpackage under a filters directory;
S22, adding configuration files under the deployment environment catalog env and the sub-application package catalog subpackage, wherein the file names of the configuration files are different.
In the above method, step S3 includes the steps of:
S31, adding configuration items to the configuration files under the deployment environment catalog env in a key=value format;
s32, adding configuration items to the configuration files under the sub-application package catalog subpackage in a key=value format;
S33, judging whether the value of the configuration file under the deployment environment directory env is crossed with the value of the configuration file under the sub-application package directory subpackage, if so, adding an application name configuration app_name in the configuration file under the sub-application package directory subpackage, namely, the application name of each sub-application, jumping to S4, and if not, directly jumping to S4.
In the method, when the key to be configured is determined, the configuration item is directly configured by adopting static configuration, and when the key to be configured is uncertain, the configuration item is dynamically configured and is transmitted through a configuration file or a command.
In the above method, the log_path of the configuration item in the configuration file of the deployment environment directory env is dynamically configured, configured as log_path= $ (app_name), where log_path is the configuration item key in the configuration file under the deployment environment directory env, and app_name is the configuration item key in the configuration file under the sub-application package directory subpackage.
In the above method, step S4 includes the steps of:
S41, adding profile configuration in a pon file corresponding to a maven item, wherein the id value of the profile is the file name of each configuration file under a deployment environment directory env;
S42, adding filter configuration in a pore file corresponding to a maven item, configuring two filters, designating the deployment environment directory env and the sub-application package directory subpackage by two filter labels, designating one configuration file of configuration files under the deployment environment directory env and the sub-application package directory subpackage according to packaging requirements, and dynamically acquiring file names of the configuration files, namely $ (env) and $ (subpackage).
In the above method, in step S5, the specific value is a file name of a configuration file specified according to the packaging requirement in the configuration files under the deployment environment directory env and the sub-application package directory subpackage.
The invention has the advantages of realizing flexible configuration of maven packing commands of different projects according to packing requirements, realizing automatic packing, having strong expandability, being capable of adding configuration files to realize corresponding packing requirements when new packing requirements exist, managing each dependent package of the projects based on version number specification, ensuring that version upgrading is clear at a glance, being suitable for various project structures, and realizing the packing requirements according to configuration whether single function or multiple functions.
Drawings
FIG. 1 is a flow chart of a method of packing a maven-based filter implementation of the present invention.
Detailed Description
The invention will be further described with reference to the drawings and examples.
The conception, specific structure, and technical effects produced by the present invention will be clearly and completely described below with reference to the embodiments and the drawings to fully understand the objects, features, and effects of the present invention. It is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments, and that other embodiments obtained by those skilled in the art without inventive effort are within the scope of the present invention based on the embodiments of the present invention. In addition, all the coupling/connection relationships referred to in the patent are not direct connection of the single-finger members, but rather, it means that a better coupling structure can be formed by adding or subtracting coupling aids depending on the specific implementation. The technical features in the invention can be interactively combined on the premise of no contradiction and conflict.
Referring to fig. 1, a packing method implemented by a maven-based filter of the present invention includes the steps of:
S1, adding a files directory under the root directory of the java item, wherein the files directory is one directory of the java item and is used for storing configuration files.
S2, adding a catalog according to the packing requirement under the filters catalog, adding a configuration file according to the packing requirement under the catalog,
Specifically, in this embodiment, the deployment environment directory env and the sub-application package directory subpackage are added under the filters directory, and then the configuration files are added under the deployment environment directory env and the sub-application package directory subpackage, where the file names of the configuration files are different.
S3, adding a configuration item to the configuration file in a format of key=value, wherein the format is a general configuration mode of the java configuration file, the key is the configuration item, the value is a value of the configuration item,
Specifically, in this embodiment, a configuration item is added to a configuration file under the deployment environment directory env in a key=value format, a configuration item is added to a configuration file under the sub-application package directory subpackage in a key=value format, when a key to be configured is determined, that is, when a value to be configured is known, the configuration item is configured statically and directly, when the key to be configured is uncertain, other configuration files or commands need to be relied on to be input, and the configuration item is configured dynamically,
When the value of the configuration file under the deployment environment directory env is crossed with the value of the configuration file under the sub-application package directory subpackage, adding an application name configuration app_name in the configuration file under the sub-application package directory subpackage, wherein the app_name is the application name of each sub-application, the sub-application refers to the names of different services, then jumping to the step S4, continuing the downward flow, and adding configuration in the pon file corresponding to the maven item in the step S4;
When the value of the configuration file under the deployment environment directory env and the value of the configuration file under the sub-application package directory subpackage do not cross, directly jumping to the step S4, continuing the downward flow, and increasing the configuration in the pon file corresponding to the maven item in the step S4.
In this embodiment, the log_path of the configuration item in the configuration file of the deployment environment directory env is dynamically configured, and is configured as log_path= $ (app_name), where log_path is a configuration item key in the configuration file under the deployment environment directory env, app_name is a configuration item key in the configuration file under the sub-application package directory subpackage, based on this configuration mode, different environment packages can be implemented, sub-application names can be dynamically obtained, and different applications can be saved to different log paths.
And S4, adding configuration in the pon file corresponding to the maven item. The pon file is a fixed configuration file in the maven item,
Specifically, in this embodiment, a profile configuration is added to a pon file corresponding to a maven item, the profile configuration is a tag in the pon file, the pon file is an xml format file, a profile tag is defined, the id value of the profile is the file name of each profile under the deployment environment directory env, a filter configuration is added to the pon file corresponding to the maven item, the filter configuration is a tag defined by the pon file in the pon file, two filters are configured, the two filter tags specify the deployment environment directory env and the sub-application package directory subpackage, namely, the two filters are the deployment environment directory env and the sub-application package directory subpackage, one profile under the deployment environment directory env and the sub-application package directory subpackage is specified according to packaging requirements, and the file names of the profiles, namely $ (env) and the sub-application package directory subpackage, are dynamically obtained
And (subpackage) associating the deployment environment directory env and the sub-application package directory subpackage with maven items to ensure that configuration files can be obtained in the packaging process.
S5, configuring a packaging command, wherein a specific value of a directory transmitted by a deployment platform maven command is a file name of a file specified according to packaging requirements in a configuration file,
In this embodiment, the specific value is a file name of a configuration file specified according to a packaging requirement in the configuration files under the deployment environment directory env and the sub-application package directory subpackage, so that different packaging commands are configured according to the combination of different env and subpackage, and the packaging requirements of different services in different environments are realized.
S6, triggering packaging operation to finish packaging.
The packing method based on the maven filter implementation realizes flexible configuration of maven packing commands of different projects according to packing requirements, realizes automatic packing, has strong expandability, can increase configuration files to realize corresponding packing requirements when new packing requirements exist, manages each dependence package of the projects based on version number specifications, has clear version upgrading dependence, is suitable for various project structures, has single functions or multiple functions, and can realize the packing requirements according to the configuration.
While the preferred embodiment of the present application has been described in detail, the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present application, and the equivalent modifications or substitutions are included in the scope of the present application as defined in the appended claims.
Claims (2)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011482734.XA CN112506561B (en) | 2020-12-15 | 2020-12-15 | Packing method for filter implementation based on maven |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011482734.XA CN112506561B (en) | 2020-12-15 | 2020-12-15 | Packing method for filter implementation based on maven |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN112506561A CN112506561A (en) | 2021-03-16 |
| CN112506561B true CN112506561B (en) | 2025-01-17 |
Family
ID=74972319
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011482734.XA Active CN112506561B (en) | 2020-12-15 | 2020-12-15 | Packing method for filter implementation based on maven |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112506561B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120406991B (en) * | 2025-07-04 | 2025-09-26 | 浪潮通用软件有限公司 | Patch automatic production method and system based on low-code SDK (software development kit) |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7559059B2 (en) * | 2001-09-21 | 2009-07-07 | Bea Systems, Inc. | Method and apparatus for smart directories for application deployment |
| CN107707625A (en) * | 2017-09-05 | 2018-02-16 | 江苏电力信息技术有限公司 | Foreground resource based on Maven is packed and carries out version management and the method used |
| CN108958753B (en) * | 2018-07-13 | 2022-04-12 | 中国银行股份有限公司 | Code packaging deployment method and device |
| CN110968357B (en) * | 2018-09-30 | 2023-04-07 | 北京国双科技有限公司 | Method and device for packaging maven item, storage medium and processor |
| CN111813439B (en) * | 2020-07-17 | 2024-03-29 | 前海人寿保险股份有限公司 | Distribution material quality control method, device, equipment and computer storage medium |
-
2020
- 2020-12-15 CN CN202011482734.XA patent/CN112506561B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN112506561A (en) | 2021-03-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11467854B2 (en) | Method and apparatus for loading multiple differing versions of a native library into a native environment | |
| JP5542796B2 (en) | Method and apparatus for managing mobile device software | |
| US8275795B2 (en) | Model extension framework | |
| US8516464B2 (en) | Computer system and method for resolving dependencies in a computer system | |
| US8266588B2 (en) | Creating projects in a rational application developer workspace | |
| US20040088397A1 (en) | System and method for management of software applications | |
| JP6881948B2 (en) | Bidirectional synchronization of data between Product Lifecycle Management (PLM) and Source Code Management (SCM) systems | |
| EP3166029B1 (en) | Exporting hierarchical data from a source code management (scm) system to a product lifecycle management (plm) system | |
| JP6673359B2 (en) | System construction support system, method and program | |
| CN113434194A (en) | Continuous integration and delivery system, method, electronic device and storage medium | |
| CN102339219A (en) | System and method for supporting object-oriented script tool | |
| US7325240B2 (en) | Method for generating calling convention transformation process | |
| CN112506561B (en) | Packing method for filter implementation based on maven | |
| CN105373406A (en) | Android platform based application layout dynamic switching method and system | |
| CN107133055A (en) | A kind of method that customized development is realized based on ClassLoader | |
| CN102200918B (en) | The method of server disposition application program and device | |
| US20220207438A1 (en) | Automatic creation and execution of a test harness for workflows | |
| EP3166030B1 (en) | Exporting hierarchical data from a product lifecycle management (plm) system to a source code management (scm) system | |
| CN112965714B (en) | Method, device and equipment for quickly updating code and storage medium | |
| CN101344858A (en) | J2EE engineering deploying method and device | |
| CN111176652A (en) | Method, apparatus, device and medium for application management | |
| CN114936049A (en) | Hot-pluggable data fusion platform operator dynamic extension method | |
| JP2024147348A (en) | Pipeline setting update device, pipeline setting update method, and program | |
| Zandstra | Continuous Integration | |
| CN114064151A (en) | Cross-platform high-performance cluster application software management and use method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |