CN113934427A - Method and system for jointly deploying front end and back end of software development based on maven plug-in - Google Patents

Method and system for jointly deploying front end and back end of software development based on maven plug-in Download PDF

Info

Publication number
CN113934427A
CN113934427A CN202111139491.4A CN202111139491A CN113934427A CN 113934427 A CN113934427 A CN 113934427A CN 202111139491 A CN202111139491 A CN 202111139491A CN 113934427 A CN113934427 A CN 113934427A
Authority
CN
China
Prior art keywords
project
configuration file
development
maven
package
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.)
Pending
Application number
CN202111139491.4A
Other languages
Chinese (zh)
Inventor
刘熠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongguan Mengda Group Co ltd
Original Assignee
Dongguan Mengda Group Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Dongguan Mengda Group Co ltd filed Critical Dongguan Mengda Group Co ltd
Priority to CN202111139491.4A priority Critical patent/CN113934427A/en
Publication of CN113934427A publication Critical patent/CN113934427A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a system for jointly deploying front and back ends of software development based on a maven plug-in, which configure relevant files and download addresses thereof required by front-end project development through a maven project configuration file to generate a front-end configuration file, and bind the front-end configuration file with a certain node in a maven life cycle; in the development process of the back-end project, when the back-end project is executed to a node bound with the front-end configuration file in the maven life cycle, calling and executing a preset automatic packaging program, wherein the automatic packaging program packages codes in the front-end project into the back-end project according to the front-end configuration file; according to the deployment method, in the whole back-end project development process, developers do not need to build a front-end environment, know the technical details of the front end and the like, development efficiency is effectively improved, the problem that front-end and back-end development software versions and instructions are incompatible can be effectively solved, and the problem that a third-party installation package is unsafe can be solved by packaging front-end and back-end codes together.

Description

Method and system for jointly deploying front end and back end of software development based on maven plug-in
Technical Field
The invention relates to the technical field of software development system deployment, in particular to a method and a system for jointly deploying front and back ends of software development based on a maven plug-in.
Background
In the new stage of internet application development, network application is not limited to a back-end leading and front-end matching mode, and particularly, WEB application using Java language as a back-end development language does not use JSP as a template language any longer, but adopts an RESTFUL style development mode. With the advent of the WEB2.0 era, a development mode represented by Vue.js (a set of progressive frames for constructing a user interface, which only focuses on a view layer and adopts a design of bottom-to-top incremental development) frame is rapidly becoming the mainstream of the control of a WEB front end separation from a back end language template, so that the problem of front end and back end separation also comes along, how to deploy front end codes under the condition that the influence of the back end on the existing environment is minimum is a problem to be solved urgently in the industry. In the current software development process, because the front-end development working environment software, such as node.js, has frequent version change, the situation that a high version is not compatible with a low version often occurs, and the node.js environment is not suitable for being installed at a server end, because the version change does not meet the requirement of the stability of the server, and if different projects correspond to different versions, the management is difficult, therefore, in the back-end development process, developers need to know the technical details of the front-end development in detail to ensure that the packaging of the whole project is not wrong, which not only increases the working difficulty for the back-end developers, but also is easy to make mistakes, needs to increase more debugging time, and is not beneficial to the improvement of the software development efficiency.
Disclosure of Invention
The invention aims to provide a method and a system for jointly deploying front and back ends of software development based on a maven plug-in, which can automatically deploy front-end codes to the back end in the process of separately developing software at the front and back ends so as to solve the problem of incompatibility of versions and instructions of the front and back end development software.
In order to achieve the purpose, the invention discloses a method for jointly deploying front and back ends of software development based on a maven plug-in, which is characterized by comprising the following steps:
configuring relevant files and download addresses thereof required by front-end project development through a maven project configuration file to generate a front-end configuration file, and binding the front-end configuration file with a certain node in a maven life cycle;
and in the development process of the back-end project, when the back-end project is executed to a node bound with the front-end configuration file in the maven life cycle, calling and executing a preset automatic packaging program, wherein the automatic packaging program packages codes in the front-end project into the back-end project according to the front-end configuration file.
Preferably, the front-end configuration file is bound to any node compiled in the maven lifecycle and thereafter.
Preferably, the content in the front-end configuration file includes: developing the version and the download address of the operating environment, the version and the download address of the package management tool, the download address of the dependent package, the project storage catalog and the packaging command to be executed.
Preferably, the executing of the automatic packaging program includes:
acquiring a development operation environment version and a download address recorded in the front-end configuration file, and a configuration package management tool version and a download address, downloading development operation environment software and a package management tool configured for front-end project development by adopting a network programming mode, and storing the development operation environment software and the package management tool in the project storage directory to complete the construction of a front-end project development work environment;
acquiring the package management tool and the download address of the dependency package recorded in the front-end configuration file, executing the download of the dependency package, downloading all dependency packages required by the front-end project and storing the dependency packages in the project storage directory;
and acquiring the packaging command recorded in the front-end configuration file, and executing the packaging command to complete packaging of the front-end project.
The invention also discloses a software development front-end and back-end co-deployment system based on the maven plug-in, which comprises a front-end configuration module and an automatic packaging module;
the front-end configuration module configures the relevant files and the download addresses thereof required by the front-end project development through the maven project configuration file to generate a front-end configuration file, and binds the front-end configuration file with a certain node in the maven life cycle;
and the automatic packaging module is used for calling and executing a preset automatic packaging program when the automatic packaging module is executed to a node bound with the front-end configuration file in the maven life cycle in the development process of the back-end project, and the automatic packaging program packages codes in the front-end project into the back-end project according to the front-end configuration file.
Preferably, the front-end configuration module binds the front-end configuration file to any node compiled and thereafter in the maven lifecycle.
Preferably, the content in the front-end configuration file includes: developing the version and the download address of the operating environment, the version and the download address of the package management tool, the download address of the dependent package, the project storage catalog and the packaging command to be executed.
Preferably, the executing of the automatic packaging program includes:
acquiring a development operation environment version and a download address recorded in the front-end configuration file, and a configuration package management tool version and a download address, downloading development operation environment software and a package management tool configured for front-end project development by adopting a network programming mode, and storing the development operation environment software and the package management tool in the project storage directory to complete the construction of a front-end project development work environment;
acquiring the package management tool and the download address of the dependency package recorded in the front-end configuration file, executing the download of the dependency package, downloading all dependency packages required by the front-end project and storing the dependency packages in the project storage directory;
and acquiring the packaging command recorded in the front-end configuration file, and executing the packaging command to complete packaging of the front-end project.
The invention also discloses a server, which comprises:
one or more processors;
a memory;
and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for performing the maven plug-in based software development front-end co-deployment method described above.
The invention also discloses a computer readable storage medium which comprises a computer program, wherein the computer program can be executed by a processor to complete the method for deploying the front-end and the back-end of the software development based on the maven plug-in.
Compared with the prior art, the front-end and back-end co-deployment method for software development, disclosed by the invention, is characterized in that front-end project development work is configured through a maven project configuration file to form a front-end configuration file, the front-end configuration file is bound with a certain node in a maven life cycle, and when the front-end configuration file is executed to the node bound with the front-end configuration file in the maven life cycle in the back-end project development process, codes in the front-end project are automatically packaged into a back-end project through an automatic packaging program, so that the codes of the front-end project are already included in the subsequent packaging of the back-end project, and the common packaging processing of the front-end project and the back-end project is realized; therefore, by the deployment method, in the whole back-end project development process, developers do not need to build a front-end environment, know the technical details of the front-end and the like, the problem that the front-end and back-end development software versions and instructions are incompatible can be effectively solved, and the problem that a third-party installation package is unsafe can be solved by packaging the front-end and back-end codes together.
Drawings
Fig. 1 is a flowchart of a co-deployment method of a front-end and a back-end of software development in an embodiment of the present invention.
FIG. 2 is a flowchart illustrating an execution process of an automatic packaging program according to an embodiment of the present invention.
Detailed Description
In order to explain technical contents, structural features, and objects and effects of the present invention in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
As shown in fig. 1, this embodiment discloses a method for jointly deploying front and back ends of software development based on a maven plug-in to implement joint packaging and deployment of front and back end projects in a network software development process, which specifically includes the following steps:
s1: configuring relevant files and download addresses thereof required by front-end project development through the maven project configuration file to generate a front-end configuration file, and binding the front-end configuration file with a certain node in the maven life cycle.
S2: and in the development process of the back-end project, calling and executing a preset automatic packaging program when the back-end project is executed to a node bound with the front-end configuration file in the maven life cycle, and packaging the codes in the front-end project into the back-end project by the automatic packaging program according to the front-end configuration file.
In the above embodiments, the Maven lifecycle includes several nodes of cleaning, initializing, compiling, testing, packaging, integrating testing, verifying, deploying, etc. of the project. Preferably, the front-end configuration file is bound to any node compiled and thereafter in the maven lifecycle. Taking binding at a compiling node as an example, in the process of back-end project development, when a maven compiles a Java code, a relevant configuration program of the front-end project development can be automatically completed, and the code in the front-end project is packed into the back-end project, so that when the back-end project is packed subsequently, the back-end project already contains the code of the front-end project, and thus the common packing processing of the front-end project and the back-end project is realized. Therefore, by the deployment method, in the whole back-end project development process, developers do not need to build a front-end environment (such as node. js), know the technical details of the front end and the like, the front-end environment can be automatically generated according to the front-end configuration file, and the problem that the versions and instructions of front-end and back-end development software are incompatible can be effectively solved.
More specifically, the content in the front-end configuration file includes: and developing a running environment (node. js) version and a downloading address, a package management tool version and a downloading address, a downloading address of a dependent package, a project storage directory and a packaging command to be executed.
In view of this, as shown in fig. 2, the step of executing the automatic packaging program includes:
s30: acquiring a development operation environment version and a download address recorded in a front-end configuration file, and a configuration package management tool version and a download address, downloading development operation environment software and a package management tool configured by front-end project development by adopting a network programming mode, and storing the development operation environment software and the package management tool in a project storage directory to complete the construction of a front-end project development working environment;
s31: acquiring a package management tool and a download address of a dependency package recorded in a front-end configuration file, executing the download of the dependency package, downloading all dependency packages required by a front-end project and storing the dependency packages in a project storage directory;
s32: and acquiring the packaging command recorded in the front-end configuration file, and executing the packaging command to complete packaging of the front-end project.
In summary, the workflow of the method for jointly deploying the front end and the back end of the software development based on the maven plug-in disclosed in the above embodiments is as follows:
first, a front-end developer specifies a node.js version and a download address, a package management tool (npm or yarn) version and a download address, a download address of a project dependent package, a project storage directory and a packaging command to be executed in a maven project configuration file pom.xml, so as to generate a front-end configuration file, and the front-end configuration file is bound with a certain node (such as compilation) in a maven life cycle.
Then, when compiling the back-end project code, using the maven plug-in lifecycle interceptor principle, executing the following automatic packaging program:
1. acquiring node.js version and download address, package management tool (npm or yann) version and download address in the front-end configuration file, downloading relevant software in a Java language network programming mode, storing in a server temporary directory, and copying downloaded node.js software and package management work pieces to the configured project storage directory, thereby completing node.js working environment construction.
2. Acquiring a downloaded package management tool and a download address of the item dependent package, and executing dependent package downloading according to a package dependency file package json of the front-end item package to finish all dependent packages required by the front-end item.
3. And acquiring a packaging command in the front-end configuration file, calling a runtime (). exec () method provided by Java language, and executing the packaging command to finish compiling and packaging the front-end item.
According to the maven's workflow, after the execution of the automatic packaging program is finished, the front-end codes are all packaged to the back-end project, and then the codes of the front-end project are included during the subsequent packaging of the back-end project, so that the purpose of common packaging and deployment of the front end and the back end is achieved.
According to the working process of the common deployment method, a back-end developer does not need to install node.js environment and does not need to pay attention to the type and version problem of the package manager independently, the package manager is automatically generated according to the configuration of the front-end project, the problem that the downloading sources of the front-end package are inconsistent is solved, and the downloading sources of different front-end and back-end projects can be configured in a personalized manner; in addition, operation and maintenance personnel do not need to increase the learning cost and do not need to know the details of the front-end project; moreover, the file compiled by the front end and the back end code are packed together, so that the problem that the third party installation package is unsafe is solved, and the influence of a back end operating system on the front end environment does not need to be considered.
The invention also discloses a software development front-end and back-end co-deployment system based on the maven plug-in, which comprises a front-end configuration module and an automatic packaging module.
And the front-end configuration module is used for configuring the related files and the download addresses thereof required by the front-end project development through the maven project configuration file so as to generate a front-end configuration file, and binding the front-end configuration file with a certain node in the maven life cycle.
And the automatic packaging module is used for calling and executing a preset automatic packaging program when the automatic packaging module is executed to a node bound with the front-end configuration file in the maven life cycle in the development process of the back-end project, and the automatic packaging program packages the codes in the front-end project into the back-end project according to the front-end configuration file.
The front-end configuration module binds the front-end configuration file with any node compiled in the maven life cycle and behind the maven life cycle.
The content in the front-end configuration file comprises: developing the version and the download address of the operating environment, the version and the download address of the package management tool, the download address of the dependent package, the project storage catalog and the packaging command to be executed.
The execution of the automatic packaging program includes:
acquiring a development operation environment version and a download address recorded in a front-end configuration file, and a configuration package management tool version and a download address, downloading development operation environment software and a package management tool configured by front-end project development by adopting a network programming mode, and storing the development operation environment software and the package management tool in a project storage directory to complete the construction of a front-end project development working environment;
acquiring a package management tool and a download address of a dependency package recorded in a front-end configuration file, executing the download of the dependency package, downloading all dependency packages required by a front-end project and storing the dependency packages in a project storage directory;
and acquiring the packaging command recorded in the front-end configuration file, and executing the packaging command to complete packaging of the front-end project.
The working principle and the working process of the software development front-and-back end co-deployment system are detailed in the software development front-and-back end co-deployment method, and are not described herein again.
The invention also discloses another server comprising one or more processors, memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for performing the maven plug-in based software development front-end co-deployment method described above. The processor may adopt a general-purpose Central Processing Unit (CPU), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute a related program, so as to implement a function that needs to be executed by a module in an instruction of the software development front-end and back-end co-deployment system according to the embodiment of the present Application, or execute the software development front-end and back-end co-deployment method according to the embodiment of the present Application.
The invention also discloses a computer readable storage medium comprising a computer program executable by a processor to perform the software development front-end and back-end co-deployment method as described above. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a read-only memory (ROM), or a Random Access Memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape, a magnetic disk, or an optical medium, such as a Digital Versatile Disk (DVD), or a semiconductor medium, such as a Solid State Disk (SSD).
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the scope of the present invention, therefore, the present invention is not limited by the appended claims.

Claims (10)

1. A method for jointly deploying front and back ends of software development based on a maven plug-in is characterized by comprising the following steps:
configuring relevant files and download addresses thereof required by front-end project development through a maven project configuration file to generate a front-end configuration file, and binding the front-end configuration file with a certain node in a maven life cycle;
and in the development process of the back-end project, when the back-end project is executed to a node bound with the front-end configuration file in the maven life cycle, calling and executing a preset automatic packaging program, wherein the automatic packaging program packages codes in the front-end project into the back-end project according to the front-end configuration file.
2. The method for mutual deployment of front-end and back-end of software development based on maven plug-ins as claimed in claim 1, wherein the front-end configuration file is bound to any node compiled and followed in the life cycle of maven.
3. The method for mutual deployment of front-end and back-end of software development based on maven plug-in according to claim 1, wherein the content in the front-end configuration file comprises: developing the version and the download address of the operating environment, the version and the download address of the package management tool, the download address of the dependent package, the project storage catalog and the packaging command to be executed.
4. The maven plug-in based software development front-end and back-end co-deployment method of claim 3, wherein the execution of the automatic packaging program comprises:
acquiring a development operation environment version and a download address recorded in the front-end configuration file, and a configuration package management tool version and a download address, downloading development operation environment software and a package management tool configured for front-end project development by adopting a network programming mode, and storing the development operation environment software and the package management tool in the project storage directory to complete the construction of a front-end project development work environment;
acquiring the package management tool and the download address of the dependency package recorded in the front-end configuration file, executing the download of the dependency package, downloading all dependency packages required by the front-end project and storing the dependency packages in the project storage directory;
and acquiring the packaging command recorded in the front-end configuration file, and executing the packaging command to complete packaging of the front-end project.
5. A front-end and back-end co-deployment system for software development based on a maven plug-in is characterized by comprising a front-end configuration module and an automatic packaging module;
the front-end configuration module configures the relevant files and the download addresses thereof required by the front-end project development through the maven project configuration file to generate a front-end configuration file, and binds the front-end configuration file with a certain node in the maven life cycle;
and the automatic packaging module is used for calling and executing a preset automatic packaging program when the automatic packaging module is executed to a node bound with the front-end configuration file in the maven life cycle in the development process of the back-end project, and the automatic packaging program packages codes in the front-end project into the back-end project according to the front-end configuration file.
6. The maven plugin-based software development front-end and back-end co-deployment system of claim 5, wherein the front-end configuration module binds the front-end configuration file with any node compiled and thereafter in a maven lifecycle.
7. The maven plug-in based software development front-end co-deployment system of claim 5, wherein the content in the front-end configuration file comprises: developing the version and the download address of the operating environment, the version and the download address of the package management tool, the download address of the dependent package, the project storage catalog and the packaging command to be executed.
8. The maven plug-in based software development front-end co-deployment system of claim 7, wherein the execution of the automatic packaging program comprises:
acquiring a development operation environment version and a download address recorded in the front-end configuration file, and a configuration package management tool version and a download address, downloading development operation environment software and a package management tool configured for front-end project development by adopting a network programming mode, and storing the development operation environment software and the package management tool in the project storage directory to complete the construction of a front-end project development work environment;
acquiring the package management tool and the download address of the dependency package recorded in the front-end configuration file, executing the download of the dependency package, downloading all dependency packages required by the front-end project and storing the dependency packages in the project storage directory;
and acquiring the packaging command recorded in the front-end configuration file, and executing the packaging command to complete packaging of the front-end project.
9. A server, comprising:
one or more processors;
a memory;
and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for performing the maven plug-in based software development front-end co-deployment method of any one of claims 1 to 4.
10. A computer-readable storage medium comprising a computer program executable by a processor to perform the method for maven plug-in based software development front-end co-deployment as claimed in any one of claims 1 to 4.
CN202111139491.4A 2021-09-27 2021-09-27 Method and system for jointly deploying front end and back end of software development based on maven plug-in Pending CN113934427A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111139491.4A CN113934427A (en) 2021-09-27 2021-09-27 Method and system for jointly deploying front end and back end of software development based on maven plug-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111139491.4A CN113934427A (en) 2021-09-27 2021-09-27 Method and system for jointly deploying front end and back end of software development based on maven plug-in

Publications (1)

Publication Number Publication Date
CN113934427A true CN113934427A (en) 2022-01-14

Family

ID=79277051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111139491.4A Pending CN113934427A (en) 2021-09-27 2021-09-27 Method and system for jointly deploying front end and back end of software development based on maven plug-in

Country Status (1)

Country Link
CN (1) CN113934427A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118170567A (en) * 2024-05-14 2024-06-11 智慧眼科技股份有限公司 Method and system for calling front-end function by back-end program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118170567A (en) * 2024-05-14 2024-06-11 智慧眼科技股份有限公司 Method and system for calling front-end function by back-end program

Similar Documents

Publication Publication Date Title
CN105657191B (en) Application increment upgrading method and system based on Android system
US7971201B2 (en) Multiple operating device version software generating system and multiple operating device version software generation support program and method
US6922827B2 (en) Iterative software development environment with prioritized build rules
EP2245532B1 (en) Method and apparatus for generating virtual software platform based on component model and validating software platform architecture using the platform
Hanappi et al. Asserting reliable convergence for configuration management scripts
WO2022016848A1 (en) Method and apparatus for performing application deployment according to service role
CN106406960B (en) Method for rapidly deploying software in linux environment
US20090319554A1 (en) Unified metadata for external components
US10409567B2 (en) Trimming unused dependencies using package graph and module graph
US10083029B2 (en) Detect application defects by correlating contracts in application dependencies
CN106569880B (en) Method and system for dynamically sharing resources between Android applications
US20180203676A1 (en) Removing library objects from a static library
Philips et al. Towards tierless web development without tierless languages
CN112882718A (en) Compiling processing method, device, equipment and storage medium
US9367429B2 (en) Diagnostics of declarative source elements
CN113934427A (en) Method and system for jointly deploying front end and back end of software development based on maven plug-in
Bartolomei et al. Study of an API migration for two XML APIs
Kousiouris et al. Combining node-red and openwhisk for pattern-based development and execution of complex faas workflows
CN110321138B (en) Program updating and migration method and device
CN115857999A (en) Method and system for obtaining micro front-end system architecture based on vue system architecture transformation
Ma et al. Analyzing distributed Java applications by automatic centralization
US7913259B2 (en) Task-graph for process synchronization and control
US9389838B2 (en) Method for creating a computer software compiler for client server computing
CN110362320B (en) Command implementation method and device of application development platform
Abate et al. Bootstrapping software distributions

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