CN113360140A - Configuration method and device based on Spring frame scaffold - Google Patents

Configuration method and device based on Spring frame scaffold Download PDF

Info

Publication number
CN113360140A
CN113360140A CN202110599252.0A CN202110599252A CN113360140A CN 113360140 A CN113360140 A CN 113360140A CN 202110599252 A CN202110599252 A CN 202110599252A CN 113360140 A CN113360140 A CN 113360140A
Authority
CN
China
Prior art keywords
input
file
scaffold
spring frame
target
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
CN202110599252.0A
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.)
WUHAN HONGXU INFORMATION TECHNOLOGY CO LTD
Original Assignee
WUHAN HONGXU INFORMATION TECHNOLOGY 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 WUHAN HONGXU INFORMATION TECHNOLOGY CO LTD filed Critical WUHAN HONGXU INFORMATION TECHNOLOGY CO LTD
Priority to CN202110599252.0A priority Critical patent/CN113360140A/en
Publication of CN113360140A publication Critical patent/CN113360140A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • 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)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for configuring a scaffold based on a Spring frame, wherein the method comprises the following steps: receiving a first input of a user; responding to the first input, and generating a plurality of folders corresponding to the Spring frame scaffold; receiving a second input of the user; generating a pom file of a Maven warehouse corresponding to the Spring frame scaffold in the target folder in response to the second input; receiving a third input of the user; in response to a third input, the pom file is updated such that the pom file stores the dependency of the Spring framework scaffolding on the target configuration item in the Maven repository. According to the configuration method and device based on the Spring frame scaffold, the configuration required by introducing other open-source projects is completed through a short code writing dependency relationship based on the pom file, developers do not need to spend a large amount of time in complicated xml configuration, and project development efficiency can be improved.

Description

Configuration method and device based on Spring frame scaffold
Technical Field
The invention relates to the field of Java development, in particular to a configuration method and device based on a Spring frame scaffold.
Background
With the explosion of the internet, the Java development language is almost the most widely used and popular development language at present. The most widely applied framework is a Spring framework, and Spring serves as a container and can manage the life cycle of the objects and the dependency relationship among the objects. Objects may be defined by configuration files and set up dependencies with other objects.
In the prior art, every time the Spring framework integrates an open source software, a large amount of configuration and dependence management are required. Therefore, developers spend a lot of time in a cumbersome xml configuration, resulting in inefficient development based on the Spring framework.
Disclosure of Invention
The invention provides a method and a device for configuring a scaffold based on a Spring frame, which are used for solving the defect of low development efficiency based on the Spring frame in the prior art, realizing the introduction of a corresponding dependency relationship in a project through a short code according to a pom file, and improving the development efficiency.
The invention provides a method for configuring a scaffold based on a Spring frame, which comprises the following steps:
receiving a first input of a user;
generating a plurality of folders corresponding to the Spring frame scaffold in response to the first input;
receiving a second input of the user;
generating a pom file of a Maven warehouse corresponding to the Spring frame scaffold in a target folder in response to the second input;
receiving a third input of the user;
in response to the third input, updating the pom file so that the pom file stores the dependency of the Spring framework scaffolding on the target configuration item in the Maven warehouse;
wherein the target folder is a new folder different from the one of the plurality of folders.
According to the configuration method based on the Spring frame scaffold provided by the invention, the generating of the plurality of folders corresponding to the Spring frame scaffold comprises the following steps:
generating a plurality of folders corresponding to the Spring frame scaffold, and generating a target configuration file in a first folder in the plurality of folders.
According to the configuration method based on the Spring frame scaffold provided by the invention, after the plurality of folders corresponding to the Spring frame scaffold are generated in response to the first input, the method further comprises the following steps:
receiving a fourth input from the user;
in response to the fourth input, updating the target profile such that the target profile stores information of a target attribute.
According to the method for configuring the Spring frame-based scaffold, the updating the pom file in response to the third input includes:
in response to the third input, storing the coordinates of the target configuration item carried by the third input in the pom file;
and the coordinates of the target configuration item are used for representing the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse.
According to the configuration method of the Spring frame-based scaffold provided by the invention, the generating of the target configuration file in the first folder of the plurality of folders comprises the following steps:
and generating a target configuration file of a first file type in the first folder.
According to the configuration method of the Spring frame-based scaffold provided by the invention, after the target configuration file of the first file type is generated in the first folder, the method further comprises the following steps:
receiving a fifth input of the user;
deleting a target profile of the first file type in response to the fifth input;
receiving a sixth input of the user;
in response to the sixth input, generating a target profile of a second file type in the first folder.
The invention also provides a configuration device based on the Spring frame scaffold, which comprises the following components:
the first input acquisition module is used for receiving first input of a user;
the Spring frame scaffold acquisition module is used for responding to the first input and generating a plurality of folders corresponding to the Spring frame scaffold;
the second input acquisition module is used for receiving second input of the user;
an initial pom file acquisition module, configured to generate a pom file of the Maven warehouse corresponding to the Spring frame scaffold in a target folder in response to the second input;
the third input acquisition module is used for receiving third input of the user;
a dependency relationship obtaining module, configured to update the pom file in response to the third input, so that the pom file stores a dependency relationship of the Spring framework scaffold on a target configuration item in the Maven warehouse;
wherein the target folder is a new folder different from the one of the plurality of folders.
The invention further provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the method for configuring the scaffold based on the Spring framework.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of configuring a Spring frame based scaffold as described in any one of the above.
The invention provides a configuration method and a configuration device based on a Spring frame scaffold, which are characterized in that a project development file directory is obtained based on the Spring frame scaffold, a pot file for managing dependence is obtained in the project development file directory based on the introduction of a Maven warehouse, and the configuration required when other projects are introduced is completed by writing the dependence relationship of a target configuration project in the pot file. In contrast, in the prior art, a large amount of configuration codes need to be written in the xml file every time other open source projects are introduced, corresponding dependency relationships are introduced into the projects only through short codes, configuration required by the introduction of other open source projects is completed according to the dependency relationships, developers do not need to spend a large amount of time in complicated xml configuration, and project development efficiency can be improved.
Drawings
Fig. 1 is a schematic flow chart of a configuration method of a Spring frame-based scaffold provided by an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a configuration device based on a Spring frame scaffold provided by an embodiment of the invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The terms "comprises" and "comprising" indicate the presence of the described features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Fig. 1 is a schematic flow chart of a configuration method of a Spring frame-based scaffold provided by the invention. As shown in fig. 1, a method for configuring a scaffold based on a Spring frame according to an embodiment of the present invention includes: step 101, receiving a first input of a user.
The main execution body of the method for arranging scaffolds based on Spring frames provided by the embodiment of the present invention is an arrangement device for scaffolds based on Spring frames.
Specifically, in step 101, a user may input a first input to a development tool in a Spring frame scaffold-based configuration device based on a process of creating a Spring frame scaffold.
A first input for initializing Spring frame scaffolding. The user can select a plurality of controls in the development tool through the first input to complete the initialization of the Spring framework scaffold.
Optionally, the first input may be a touch input, a voice input, a gesture input, or a key input to a plurality of controls in the above-mentioned hair styling tool. The first input may also be a first operation comprising instructions for determining a procedure for creating a Spring framework scaffold.
And 102, responding to the first input, and generating a plurality of folders corresponding to the Spring frame scaffold.
It should be noted that the Spring data source framework, which is created to solve the complexity of enterprise application development, is a lightweight Control Inversion (IOC) and a container framework facing to a tangent plane, and is also the most popular open source framework in the Java development field, and is widely used for design and research and development of enterprise application software and government information systems.
Scaffolding on software development is a meta-programming approach for building database-based applications.
In the development process, after the dependence items of the project environment configuration are built in the scaffold, the required business logic development can be directly carried out in the project.
Specifically, in step 102, after receiving the first input in step 101, the configuration device based on the Spring framework scaffold executes corresponding operations according to instructions included in the first input in sequence, and the built Spring framework scaffold is output in the form of a plurality of folders in a project development file directory.
Preferably, the Spring frame scaffold is a Spring boot frame.
It should be noted that creating a SpringBoot project through the development tool requires keeping the network clear.
And 103, receiving a second input of the user.
Specifically, in step 103, the user may input a second input to the development tool that created the Maven repository based on the process that created the Maven repository.
A second input for creating a Maven repository. The user can select a plurality of controls in the development tool through the second input to complete the creation of the Maven warehouse.
Optionally, the second input may be a touch input, a voice input, a gesture input, or a key input to a plurality of controls in the above-mentioned hair styling tool. The second input may also be a second operation comprising instructions in the process for determining to create the created Maven repository.
And step 104, responding to the second input, and generating a pom file of the Maven warehouse corresponding to the Spring frame scaffold in the target folder.
Wherein the target folder is a new folder different from the one of the plurality of folders.
It should be noted that Maven is a Project Management tool, which is a place for storing jar packages, and includes a Project Object Model (Project Object Model), a set of standards, a Project Lifecycle (Project Lifecycle), a Dependency Management System (Dependency Management System), and logic for running plug-in (plugin) objects (good) defined in the Lifecycle phase (phase).
The pom file is a pom.xml file generated after a Maven web project is created, and the Maven warehouse is driven to automatically download the third party jar package by configuring in the file.
Specifically, in step 104, after receiving the second input in step 103, the configuration device based on the Spring framework scaffold executes corresponding operations according to the instructions included in the second input in sequence, and completes creation of the Maven warehouse. And generates a new folder on the basis of the directory structure of step 102, and the corresponding generated pom file is stored under the folder.
Specifically, after the Maven repository is created, a target folder is generated based on the project development file directory for storing the pom file generated in step 104.
The storage path is a default storage location of the pom file, and the location of the pom file may also be set by user, which is not specifically limited in the embodiment of the present invention.
And step 105, receiving a third input of the user.
It should be noted that before introducing the dependency relationship into the pom file, the pom file acquired in step 104 needs to be opened first. The third input comprises two parts, one part being an action input and the other part being a content input.
Specifically, in step 105, the user may input a third input to the development tool in the Spring framework scaffold-based configuration device based on the flow of introducing the dependency in the pom file.
And a third input for opening the pom file and introducing the dependency relationship to the pom file. The user may select a target folder in the development tool to open the pom file via an action input included in the third input. And the user performs code compiling on the pom file through content input contained in the third input to complete the introduction of the dependency relationship.
Optionally, the motion input in the third input may be touch input, voice input, gesture input, or key input to the control corresponding to the pom file. The content input in the third input may be touch input, voice input, character input, or key input. The third input may also be a third operation, containing instructions to open and compile a pom file.
And step 106, responding to the third input, updating the pom file, so that the pom file stores the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse.
It should be noted that the initial pom file generated in step 104 includes the root element and the necessary configuration. Wherein, the < project > tag is the root element of the pom file, and the < project > tag is provided with important elements such as modelVersion, groupId, artifactId, version, and packaging. The < dependencies > tag is a necessary configuration of the pom file, and includes a plurality of < dependency > sub-tags, and the three elements of groupId, artifactId and version under the sub-tags are used to define the coordinates of an item, that is, in a maven warehouse, an identical set of groupId, artifactId and version can only correspond to one item.
The target configuration project refers to a jar package which is introduced into the project from a Maven warehouse by a user according to actual logic business requirements.
The dependency relationship refers to a logical relationship between a method class and a parameter when the item uses the method class and the parameter in another configuration item to be introduced, namely, the dependency relationship.
Specifically, in step 106, after receiving the third input in step 105, the configuration device based on Spring framework scaffolding sequentially adds to the initial pom file in step 104 according to the content input contained in the third input, and generates an updated pom file. The updated pom file includes the compiled code of the content input in the third input written into the root element < project > tag in the initial pom file to complete the dependencies that need to be established to import the target configuration item from the Maven repository to the Spring framework scaffolding.
It should be appreciated that after the development environment is successfully built, the pom file can still be updated according to new business requirements.
The method and the device for managing the dependency of the project development files have the advantages that the project development file directory is obtained based on the Spring framework scaffold, the pom file for managing the dependency is obtained in the project development file directory based on the introduction of the Maven warehouse, and the needed configuration when other projects are introduced is completed by writing the dependency of the target configuration project into the pom file. In contrast, in the prior art, a large amount of configuration codes need to be written in the xml file every time other open source projects are introduced, corresponding dependency relationships are introduced into the projects only through short codes, configuration required by the introduction of other open source projects is completed according to the dependency relationships, developers do not need to spend a large amount of time in complicated xml configuration, and project development efficiency can be improved.
On the basis of any one of the above embodiments, creating a plurality of folders corresponding to Spring frame scaffolds includes: creating a plurality of folders corresponding to the Spring framework scaffold, and generating a target configuration file in a first folder in the plurality of folders.
The target configuration file is a computer file, which is generated along with the creation of the project development file directory, and can be used for configuring and initially setting parameters for a project.
The first folder refers to a certain folder in the project development file directory.
Specifically, in step 102, when an instruction is received and a project is created based on the instruction, a project development file directory is generated, which at least includes a src root directory for storing source codes and test codes, a main directory for storing the source codes of the project, a test directory for storing the source codes of the test, and a resources directory for storing resources. Each time such a project is created, an empty configuration file, i.e., a target configuration file, is generated in the resources directory of the project development file directory.
The embodiment of the invention acquires the corresponding configuration file based on the created project, and provides the configuration file for configuring information such as system attributes, environment variables and command parameters for the project on the basis of introducing the dependency configuration. Furthermore, only necessary configuration items can be written, other configuration processes are omitted, and project development efficiency can be improved.
On the basis of any of the above embodiments, after generating the plurality of folders corresponding to the Spring framework scaffolds in response to the first input, the method further includes: a fourth input by the user is received.
It should be noted that, before writing the necessary configuration into the target configuration file, the acquired target configuration file needs to be opened first. The fourth input comprises two parts, one part being an action input and the other part being a content input.
Specifically, the user may input a fourth input to the development tool in the Spring framework scaffold-based configuration device based on the process of configuring in the target configuration file.
And a fourth input for opening the target configuration file and writing the necessary configuration in the target configuration file. The user may select the first folder in the development tool to open the target configuration file via an action input included in the fourth input. And the user carries out code compiling on the target configuration file through the content input contained in the fourth input to complete necessary configuration.
Optionally, the action input in the fourth input may be touch input, voice input, gesture input, or key input to the control corresponding to the target profile. The content input in the fourth input may be touch input, voice input, character input, or key input. The fourth input may also be a fourth operation comprising instructions for opening and compiling the target configuration file.
In response to a fourth input, the target profile is updated such that the target profile stores information of the target attribute.
It should be noted that the target attribute refers to a configuration item that needs to be additionally added.
Specifically, after receiving the fourth input, the Spring framework scaffold-based configuration device sequentially adds the content input included in the fourth input to the initial target configuration file, and generates an updated target configuration file. And the updated target configuration file comprises the step of writing the compiled code input by the content in the fourth input into the initial target configuration file in a corresponding grammar so as to complete parameter definition corresponding to the target attribute or related setting corresponding to the target attribute of the project.
According to the embodiment of the invention, the corresponding fourth input is obtained based on the necessary configuration item, the corresponding configuration file is updated based on the fourth input, and only the necessary configuration is provided for the project. Furthermore, only necessary configuration items can be written, other configuration processes are omitted, and project development efficiency can be improved.
On the basis of any of the above embodiments, updating the pom file in response to a third input includes: and responding to the third input, and storing the coordinates of the target configuration item carried by the third input in the pom file.
It should be noted that the coordinates of the target configuration item refer to an information combination at least including groupId and artifactId elements, and are used to define a path of the configuration item. In the Maven repository, the coordinates have a one-to-one correspondence with the configuration items in the repository.
Specifically, in step 106, after receiving the third input, the configuration device based on the Spring framework scaffold adds the coordinate information of the target configuration item carried by the third input to the initial pom file in step 104 according to the user-entered content included in the third input in sequence, and generates an updated pom file.
Some basic configuration of the Spring framework and the third-party plug-in API are placed in the open-source Maven warehouse in the form of a packaged jar package.
Optionally, when the user needs to perform basic configuration on the Spring framework, the user needs to find a jar package corresponding to the basic configuration of the Spring framework in the Maven warehouse, and obtain an organization Id (i.e., groupId) and a name (artifactId) of a project of the jar package. And taking the coordinates consisting of groupId and artifactId and the corresponding information as a third input, and writing the third input into the < dependency > sub-label in the initial pom file.
For example, a Spring mvc frame needs to be integrated in a Spring frame scaffold, and then a user only needs to add corresponding frame coordinates into a pom file to complete the relevant basic configuration of the frame, and the specific implementation manner of the method is as follows:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
the basic configuration mechanism of the springMVC framework is that spring-boot-starter-web corresponding dependence is introduced, and the following spring MVC essential components are automatically configured by default:
1. necessary ViewResolvers such as ContentNegotationViewResolver and Bean-NameViewResolver.
2. The necessary beans such as conveverter, genericconveverter, and format are registered to the IoC container.
3. A series of http messages converter is added to support Web requests and corresponding type conversion.
4. The error codes used by the MessageCodesResolver to render the error information are automatically configured and registered.
Optionally, when the user needs to introduce a third-party plug-in API to the Spring framework, the user needs to find a jar package corresponding to the third-party plug-in API in the Maven repository, and obtain an organization Id (i.e., groupId) and a name (artifactId) of a project of the jar package. And taking the coordinates consisting of groupId and artifactId and the corresponding information as a third input, and writing the third input into the < dependency > sub-label in the initial pom file. The specific implementation mode is as follows:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
it should be understood that different jar packs correspond to different coordinates, and that different coordinates are written under different < dependency > sub-tags.
And the coordinates of the target configuration item are used for representing the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse.
Specifically, the relevant information of the target configuration item is determined through the coordinates of the target configuration item, the dependency relationship between the Spring framework scaffold and the Maven warehouse can be established based on the relevant information of the target configuration item, and the target configuration item can be directly called in the Spring framework scaffold according to the dependency relationship.
According to the embodiment of the invention, the coordinates are adopted to carry out dependency management in the pom file, so that the project to be introduced can be automatically configured, a large amount of complicated configuration contents do not need to be written, the out-of-box use is realized, and the project development efficiency can be improved.
On the basis of any of the above embodiments, generating a target profile at a first folder in a plurality of folders comprises: a target configuration file of a first file type is generated in a first folder.
Note that the first file type refers to a configuration file that is application.
Specifically, the type of configuration file generated accompanying creation of the project may be application properties.
It should be noted that, for application properties configuration files, the syntax structure is as follows: value.
Properties is written, for example, in the form of:
userinfo.age=25
userinfo.active=true
userinfo.created-date=2018/03/31 16:54:30
according to the embodiment of the invention, the necessary configuration items are configured on the basis of the application properties configuration file and the corresponding grammar on the basis of the file, all the configuration items do not need to be configured, and the project development efficiency can be improved.
On the basis of any of the above embodiments, after generating the target configuration file of the first file type in the root folder, the method further includes: a fifth input by the user is received.
Specifically, the user may input a fifth input to the development tool in the Spring framework scaffold-based configuration device based on the flow of deleting the target configuration file.
A fifth input for deleting the target configuration file. The user can select a plurality of controls in the development tool to complete the deletion of the target configuration file through the fifth input.
Optionally, the fifth input may be a touch input, a voice input, a gesture input, or a key input to a plurality of controls in the above-mentioned hair tool. The fifth input may also be a fifth operation comprising an instruction to delete a target profile flow.
In response to a fifth input, deleting the target profile of the first file type.
Specifically, after receiving the fifth input, the configuration device based on the Spring framework scaffold deletes the target configuration file with the file type application.
A sixth input by the user is received.
Before writing the necessary configuration into the target configuration file of the second file type, it is necessary to create a new target configuration file of the second file type under the first folder, and open the obtained target configuration file of the second file type. The sixth input comprises two parts, one part being an action input and the other part being a content input.
Specifically, the user may input a sixth input to the development tool in the Spring framework scaffold-based configuration device based on the process of configuring the target configuration file in the second file type.
And a sixth input for creating and opening the target configuration file of the second file type and writing the necessary configuration in the target configuration file of the second file type. The user can select the first folder in the development tool through the action input included in the sixth input, and open the target configuration file of the second file type after the target configuration file is created. And the user carries out code compiling on the target configuration file of the second file type through the content input contained in the sixth input to complete necessary configuration.
Optionally, the action input in the sixth input may be touch input, voice input, gesture input, or key input to the control corresponding to the target configuration file of the second file type. The content input in the sixth input may be touch input, voice input, character input, or key input. The sixth input may also be a sixth operation comprising an instruction to create a target configuration file of the second file type and open the file for compilation thereof.
In response to a sixth input, a target profile of the second file type is generated in the first folder.
It should be noted that the second file type refers to a configuration file that is application.
Specifically, after receiving the sixth input, the configuration device based on the Spring framework scaffold sequentially generates a new target configuration file in the directory corresponding to the first folder according to the action input included in the sixth input, and opens the new target configuration file. Different from the original target configuration file, the file types of the target configuration file and the target configuration file are different. Yml is the second file type corresponding to the new target configuration file. The user adds the content input included in the sixth input to the configuration file of application. And writing the compiling code input by the content in the sixth input into the initial configuration file of the application.yml in a corresponding syntax so as to complete parameter definition corresponding to the target attribute or relevant setting corresponding to the target attribute of the item.
It should be noted that for the application. yml configuration file, its syntax structure is: key: value's key-value pair. And the level relation is controlled by the indentation degree of the blank, wherein the number of the blank is not important, the left blank is considered as the same level as long as the left blank is aligned, but the blank cannot be replaced by the tab. In addition, the case is sensitive, three data structures of face value, object and array are supported, and a composite structure is also supported.
Yml is written, for example, in the form:
"name": Liguang "
Values [1,2,45, "hello ].
It can be understood that after the above-mentioned pom file and target configuration file are processed correspondingly, a basic project is already built, and the call can be realized by writing corresponding comments in the front-end business logic code.
For example, when the front-end corresponding annotation @ RestController implements a call, the specific implementation may be:
Figure BDA0003092318990000151
the embodiment of the invention configures the necessary configuration items on the basis of the configuration files of different file types based on the corresponding grammars. The configuration file types can be changed and configured according to the requirements of users, all configuration items do not need to be configured, and the project development efficiency can be improved.
The creation and introduction of Spring frame based scaffolding into a Maven warehouse is described below in connection with a specific embodiment.
For example, the user clicks on the New File control in the development tool, selecting the Project control. And selecting the Spring Initializr control, checking whether the corresponding JDK version is proper or not after the loading is finished, and ensuring that the next control is clicked afterwards until the Spring boot project is created completely.
And then, the user sequentially clicks a New control, a Project control, a Maven Project control and a Create a single Project control in an interface in the development tool, and the creation of the Maven warehouse is finished.
Fig. 2 is a schematic structural diagram of a configuration device based on a Spring frame scaffold provided according to an embodiment of the present invention. Based on the content of any of the above embodiments, as shown in fig. 2, the apparatus includes a first input obtaining module 210, a Spring framework scaffold obtaining module 220, a second input obtaining module 230, an initial pom file obtaining module 240, a third input obtaining module 250, and a dependency relationship obtaining module 260, where:
the first input obtaining module 210 is configured to receive a first input from a user.
The Spring frame scaffold obtaining module 220 is configured to generate a plurality of folders corresponding to the Spring frame scaffold in response to the first input.
And a second input obtaining module 230, configured to receive a second input of the user.
And the initial pom file acquisition module 240 is configured to generate a pom file of the Maven warehouse corresponding to the Spring framework scaffold in the target folder in response to the second input.
And a third input obtaining module 250, configured to receive a third input from the user.
And the dependency relationship obtaining module 260 is configured to update the pom file in response to the third input, so that the pom file stores the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse.
Wherein the target folder is a new folder different from the one of the plurality of folders.
Specifically, the first input obtaining module 210, the Spring frame scaffold obtaining module 220, the second input obtaining module 230, the initial pom file obtaining module 240, the third input obtaining module 250, and the dependency relationship obtaining module 260 are electrically connected in sequence.
The first input obtaining module 210 receives a first input from a user, which can be sent to a development tool for building a Spring frame scaffold based on a process for creating the Spring frame scaffold.
The Spring frame scaffold acquisition module 220 sequentially executes corresponding operations according to the instructions included in the first input, and the built Spring frame scaffold is output in the form of a plurality of folders in a project development file directory.
The second input acquisition module 230 receives a second input from a user that may be sent to a development tool that created the Maven repository based on a process that created the Maven repository.
The initial pom file obtaining module 240 executes corresponding operations according to the instructions included in the second input in sequence, and completes creation of the Maven warehouse. And a new folder is generated on the basis of the directory structure of the Spring frame scaffold acquisition module 220, and the corresponding generated pom file is stored under the folder.
The third input acquisition module 250 receives a third input from a pom file that the user may generate in the initial pom file acquisition module 240 based on the jar package to be imported from the Maven repository and the flow of configuration dependencies.
The dependency relationship obtaining module 260 sequentially adds the user-entered content included in the third input to the initial pom file in the initial pom file obtaining module 240, and generates an updated pom file. The updated pom file is the dependency that needs to be established to write the third input to the root element < project > tag in the original pom file to complete the import of the target configuration item from the Maven repository to the Spring framework scaffolding.
The creation of the Maven repository generates a new folder based on the project development file directory, and the new folder is used for storing the pot file generated by the initial pot file acquisition module 240.
Optionally, the Spring frame scaffold acquisition module 220 further includes a configuration file acquisition sub-module, wherein:
the configuration file obtaining submodule is specifically used for generating a plurality of folders corresponding to the Spring frame scaffold and generating a target configuration file in a first folder in the plurality of folders.
Optionally, after the Spring frame scaffold acquisition module 220, the apparatus further comprises a fourth input acquisition module and a configuration acquisition module, wherein:
the fourth input acquisition module is used for receiving fourth input of the user;
and the configuration acquisition module is used for responding to the fourth input and updating the target configuration file so that the target configuration file stores the information of the target attribute.
Optionally, the dependency relationship obtaining module 260 is specifically configured to, in response to a third input, store the coordinates of the target configuration item carried by the third input in the pom file;
and the coordinates of the target configuration item are used for representing the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse.
Optionally, the configuration obtaining module is specifically configured to generate a target configuration file of the first file type in the first folder.
Optionally, the configuration obtaining module further includes a fifth input obtaining sub-module, a configuration deleting sub-module, a sixth input obtaining sub-module, and a new configuration sub-module, where:
and the fifth input acquisition submodule is used for receiving fifth input of the user.
And the configuration deleting submodule is used for responding to the fifth input and deleting the target configuration file of the first file type.
And the sixth input acquisition submodule is used for receiving sixth input of the user.
And the new configuration submodule is used for responding to the sixth input and generating a target configuration file of the second file type in the first folder.
The configuration device based on the Spring frame scaffold provided by the embodiment of the invention is used for executing the configuration method based on the Spring frame scaffold provided by the invention, the implementation mode of the configuration device based on the Spring frame scaffold provided by the invention is consistent with that of the configuration method based on the Spring frame scaffold provided by the invention, and the same beneficial effects can be achieved, and the details are not repeated herein.
The method and the device for managing the dependency of the project development files have the advantages that the project development file directory is obtained based on the Spring framework scaffold, the pom file for managing the dependency is obtained in the project development file directory based on the introduction of the Maven warehouse, and the needed configuration when other projects are introduced is completed by writing the dependency of the target configuration project into the pom file. In the prior art, when other open source projects are introduced, a large amount of configuration codes need to be written in the xml file, and in contrast, corresponding dependency relationships are introduced into the projects only through short codes, so that the configurations required by the other open source projects are introduced according to the dependency relationships, developers do not need to spend a large amount of time in complicated xml configurations, and project development efficiency can be improved.
Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor)310, a communication interface (communication interface)320, a memory (memory)330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call logic instructions in the memory 330 to perform a method of configuring a Spring framework based scaffold, the method comprising: receiving a first input of a user; responding to the first input, and generating a plurality of folders corresponding to the Spring frame scaffold; receiving a second input of the user; generating a pom file of a Maven warehouse corresponding to the Spring frame scaffold in the target folder in response to the second input; receiving a third input of the user; in response to a third input, updating the pom file so that the pom file stores the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse; wherein the target folder is a new folder different from the one of the plurality of folders.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In another aspect, the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer being capable of executing the method for configuring a Spring frame-based scaffold provided by the above methods, the method including: receiving a first input of a user; responding to the first input, and generating a plurality of folders corresponding to the Spring frame scaffold; receiving a second input of the user; generating a pom file of a Maven warehouse corresponding to the Spring frame scaffold in the target folder in response to the second input; receiving a third input of the user; in response to a third input, updating the pom file so that the pom file stores the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse; wherein the target folder is a new folder different from the one of the plurality of folders.
In yet another aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the method for configuring a Spring frame-based scaffold provided in the above aspects, the method including: receiving a first input of a user; responding to the first input, and generating a plurality of folders corresponding to the Spring frame scaffold; receiving a second input of the user; generating a pom file of a Maven warehouse corresponding to the Spring frame scaffold in the target folder in response to the second input; receiving a third input of the user; in response to a third input, updating the pom file so that the pom file stores the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse; wherein the target folder is a new folder different from the one of the plurality of folders.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Although the invention has been described in detail hereinabove with respect to a general description and specific embodiments thereof, it will be apparent to those skilled in the art that modifications or improvements may be made thereto based on the invention. Accordingly, such modifications and improvements are intended to be within the scope of the invention as claimed.

Claims (9)

1. A method for configuring a scaffold based on a Spring frame is characterized by comprising the following steps:
receiving a first input of a user;
generating a plurality of folders corresponding to the Spring frame scaffold in response to the first input;
receiving a second input of the user;
generating a pom file of a Maven warehouse corresponding to the Spring frame scaffold in a target folder in response to the second input;
receiving a third input of the user;
in response to the third input, updating the pom file so that the pom file stores the dependency of the Spring framework scaffolding on the target configuration item in the Maven warehouse;
wherein the target folder is a new folder different from the one of the plurality of folders.
2. The method according to claim 1, wherein the generating of the plurality of folders corresponding to the Spring frame scaffold comprises:
generating a plurality of folders corresponding to the Spring frame scaffold, and generating a target configuration file in a first folder in the plurality of folders.
3. A method of configuring a Spring frame-based scaffold according to claim 2, wherein after generating a plurality of folders corresponding to said Spring frame scaffold in response to said first input, said method further comprises:
receiving a fourth input from the user;
in response to the fourth input, updating the target profile such that the target profile stores information of a target attribute.
4. A method of configuring a Spring frame based scaffold according to any of claims 1 to 3, wherein said updating said pom file in response to said third input comprises:
in response to the third input, storing the coordinates of the target configuration item carried by the third input in the pom file;
and the coordinates of the target configuration item are used for representing the dependency relationship of the Spring framework scaffold on the target configuration item in the Maven warehouse.
5. A method of configuring a Spring frame based scaffold according to claim 3, wherein said generating a target configuration file in a first folder of said plurality of folders comprises:
and generating a target configuration file of a first file type in the first folder.
6. A method of configuring a Spring frame based scaffold according to claim 5, wherein said method further comprises, after generating a target profile of a first file type in said first folder:
receiving a fifth input of the user;
deleting a target profile of the first file type in response to the fifth input;
receiving a sixth input of the user;
in response to the sixth input, generating a target profile of a second file type in the first folder.
7. A configuration device based on Spring frame scaffold frame, characterized by includes:
the first input acquisition module is used for receiving first input of a user;
the Spring frame scaffold acquisition module is used for responding to the first input and generating a plurality of folders corresponding to the Spring frame scaffold;
the second input acquisition module is used for receiving second input of the user;
an initial pom file acquisition module, configured to generate a pom file of the Maven warehouse corresponding to the Spring frame scaffold in a target folder in response to the second input;
the third input acquisition module is used for receiving third input of the user;
a dependency relationship obtaining module, configured to update the pom file in response to the third input, so that the pom file stores a dependency relationship of the Spring framework scaffold on a target configuration item in the Maven warehouse;
wherein the target folder is a new folder different from the one of the plurality of folders.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the method for configuring a Spring frame based scaffold according to any of claims 1 to 6.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the method of configuring a Spring frame based scaffold according to any of claims 1 to 6.
CN202110599252.0A 2021-05-31 2021-05-31 Configuration method and device based on Spring frame scaffold Pending CN113360140A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110599252.0A CN113360140A (en) 2021-05-31 2021-05-31 Configuration method and device based on Spring frame scaffold

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110599252.0A CN113360140A (en) 2021-05-31 2021-05-31 Configuration method and device based on Spring frame scaffold

Publications (1)

Publication Number Publication Date
CN113360140A true CN113360140A (en) 2021-09-07

Family

ID=77528324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110599252.0A Pending CN113360140A (en) 2021-05-31 2021-05-31 Configuration method and device based on Spring frame scaffold

Country Status (1)

Country Link
CN (1) CN113360140A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181991A (en) * 2020-01-03 2020-05-19 苏州融卡智能科技有限公司 Method and device for constructing terminal access platform of Internet of things
CN111897570A (en) * 2020-07-15 2020-11-06 杭州安恒信息技术股份有限公司 Multi-dependency file extraction method and device based on Maven plug-in

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181991A (en) * 2020-01-03 2020-05-19 苏州融卡智能科技有限公司 Method and device for constructing terminal access platform of Internet of things
CN111897570A (en) * 2020-07-15 2020-11-06 杭州安恒信息技术股份有限公司 Multi-dependency file extraction method and device based on Maven plug-in

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ALLENALAN: "随手写个SpringBoot的maven脚手架", pages 1 - 7, Retrieved from the Internet <URL:《https://www.cnblogs.com/allennote/articles/12402086.html》> *
狂丰: "pom中parent标签使用", pages 1 - 6, Retrieved from the Internet <URL:《https://blog.csdn.net/fz13768884254/article/details/87936528》> *

Similar Documents

Publication Publication Date Title
CN110928529B (en) Method and system for assisting operator development
US20130332449A1 (en) Generating data processing code from a directed acyclic graph
CN107656729B (en) List view updating apparatus, method and computer-readable storage medium
WO2021037050A1 (en) Code change method and device
JP2005293578A (en) Test case inheritance controlled via attribute
CN108363566A (en) File configuration method, intelligent terminal and storage medium in a kind of project development process
US20140223408A1 (en) Integration project center
CN110737460A (en) platform project management method and device
US8051426B2 (en) Co-routines native to a virtual execution environment
CN114996619A (en) Page display method and device, computer equipment and storage medium
CN111752841A (en) Single test simulation method, device, equipment and computer readable storage medium
CN109558121B (en) Interface driver development method, device, equipment and storage medium
CN114968192A (en) Project creation method and device, computer equipment and storage medium
US9244706B2 (en) Command line shell command generation based on schema
CN114706616A (en) Applet construction method and device
Botturi et al. Model-driven design for the development of multi-platform smartphone applications
CN112068879A (en) Method and device for constructing client application development framework based on configuration
CN113360140A (en) Configuration method and device based on Spring frame scaffold
Knupp Writing Idiomatic Python 2.7. 3
CN116243923A (en) Applet processing method and device and electronic equipment
CN115629802A (en) Program migration processing method and device
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
US11429358B2 (en) Representing asynchronous state machine in intermediate code
CN114816475A (en) Method, device, equipment and medium for updating embedded operating system
CN111625830B (en) Data processing method, data display method, system and equipment

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