[go: up one dir, main page]

CN108829430A - Java Web project update method and relevant apparatus based on Eclipse and Tomcat - Google Patents

Java Web project update method and relevant apparatus based on Eclipse and Tomcat Download PDF

Info

Publication number
CN108829430A
CN108829430A CN201810629891.5A CN201810629891A CN108829430A CN 108829430 A CN108829430 A CN 108829430A CN 201810629891 A CN201810629891 A CN 201810629891A CN 108829430 A CN108829430 A CN 108829430A
Authority
CN
China
Prior art keywords
file
patch
tomcat
java
project
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
CN201810629891.5A
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.)
XIAMEN HYMAKE TECHNOLOGY Co Ltd
Original Assignee
XIAMEN HYMAKE 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 XIAMEN HYMAKE TECHNOLOGY Co Ltd filed Critical XIAMEN HYMAKE TECHNOLOGY Co Ltd
Priority to CN201810629891.5A priority Critical patent/CN108829430A/en
Publication of CN108829430A publication Critical patent/CN108829430A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

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

Abstract

This application involves a kind of Java Web project update method and relevant apparatus based on Eclipse and Tomcat.The method that the mode of the complete war packet of the embodiment of the present application abandoning tradition is updated application, but use and the patch file for needing to update first is generated according to the parameter of configuration, then patch file packing is disposed.That is, realizing a kind of mode of incremental update.Relative to traditional complete war packet, the data volume of update is much smaller, convenient for transmission and deployment.Moreover, the mode updated does not need manually to search catalogue, administration of the counterpart Ministry of worker can be avoided manually-operated mistake.

Description

Java Web project update method and relevant apparatus based on Eclipse and Tomcat
Technical field
Presently filed embodiment is related to the technical field of code publication and patch production, more particularly, to being based on The Java Web project update method and relevant apparatus of Eclipse and Tomcat.
Background technique
Java Web is the technology summation that related web internet area is solved with Java technology.It is now widely used in each Kind internet product.
Tomcat server is the Web Application Server of a free open source code, belongs to lightweight application service Device is commonly used in the case where middle-size and small-size system and concurrent users are not many occasions, is exploitation and debugging JSP program It is preferred.
It is all often to export complete generation with tools such as Eclipse or ANT when needing to issue update in traditional scene War packet after code compiling is uploaded under the catalogue of production environment place by file transfer conveyance, then passes through the tools such as remote desktop It is connected to production environment, carries out Tomcat server resets.And export war packet and upload war packet it is all very time-consuming.Currently, being It practices every conceivable frugality this part consuming time, when only modifying a small amount of file, common alternative is manually to find the volume of these files Then file after translating uploads these files to the corresponding catalogue of production environment, code directory is all more complicated, it is easy to Cause some manually-operated mistakes.
Therefore, the scheme of efficient patch production, online deployment and server resets is with a wide range of applications.
Summary of the invention
The application provides a kind of Java Web project update method and relevant apparatus based on Eclipse and Tomcat, uses Low efficiency when needing complete war packet to lead to operating cost when solving patch installing in the prior art, and artificial patch installing are easy The problem of error.
The embodiment of the present application provides a kind of Java Web project update method based on Eclipse and Tomcat, the side Method includes:
It for application to be updated, is instructed according to parameter configuration, configures relevant parameter;The parameter configuration instruction includes should The list of patches file of application, wherein be provided with project name in advance for the application and generate information required for patch;
The information according to required for generating patch generates each patch file in list of patches file, by each benefit of generation Under fourth file copy to the target directory constructed in advance, and by the file where the target directory with corresponding project name into Row name;It wherein, include the file of a project under a file;
It receives and this document is pressed from both sides into the Disposition Instructions being deployed in Tomcat;
The file under the target directory of this document folder is deployed according to the title of file according to the Disposition Instructions In the corresponding catalogue of Tomcat;
According to the instruction of restarting that remote reboot is applied, the remote reboot application.
The embodiment of the present application also provides a kind of Java Web project updating device based on Eclipse and Tomcat, the dress Set including:
Parameter configuration module instructs according to parameter configuration for being directed to application to be updated, configures relevant parameter;It is described Parameter configuration instruction includes the list of patches file of the application, wherein is provided with project name and generation in advance for the application Information required for patch;
Patch file processing module generates each in list of patches file for the information according to required for generating patch Patch file copies each patch file of generation under the target directory constructed in advance to, and by the text where the target directory Part folder is named with corresponding project name;It wherein, include the file of a project under a file;
This document is pressed from both sides the Disposition Instructions being deployed in Tomcat for receiving by Disposition Instructions receiving module;
Deployment module is used for according to the Disposition Instructions, according to the title of file, under the target directory that this document is pressed from both sides File be deployed in the corresponding catalogue of Tomcat;
Restart module, the instruction of restarting for being applied according to remote reboot, the remote reboot application.
Another embodiment of the application additionally provides a kind of calculating equipment comprising memory and processor, wherein described to deposit Reservoir is for storing program instruction, and the processor is for calling the program instruction stored in the memory, according to acquisition Program instruction executes any Java Web project update method based on Eclipse and Tomcat in the embodiment of the present application.
Another embodiment of the application additionally provides a kind of computer storage medium, wherein the computer storage medium is deposited Computer executable instructions are contained, the computer executable instructions are for making computer execute any in the embodiment of the present application Java Web project update method based on Eclipse and Tomcat.
According to the Java Web project update method provided by the present application based on Eclipse and Tomcat, by configuring ginseng Number automatically generate patch file, only by patch file upload onto the server in dispose, carried out relative to by complete war packet The mode of deployment is passed, quantity amount is small, and transmission and deployment speed are fast.In addition, file where patch file is named with project name, And patch file is stored according to the list mode of project itself under file, it, can be according to this document title in deployment Each file is deployed in corresponding catalogue, searches catalogue without artificial.
Detailed description of the invention
The following detailed description is read with reference to the accompanying drawings, above-mentioned and other mesh of the application illustrative embodiments , feature and advantage will become prone to understand.In the accompanying drawings, if showing the application's by way of example rather than limitation Dry embodiment, wherein:
Fig. 1 schematically shows the application scenarios schematic diagram according to the application embodiment;
Fig. 2 schematically shows Java Web based on Eclipse and Tomcat according to the application embodiment The flow diagram of mesh update method;
Fig. 3 schematically shows a kind of institutional framework modular diagram according to the application embodiment;
Fig. 4 schematically shows Java Web based on Eclipse and Tomcat according to the application embodiment Another flow diagram of mesh update method;
Fig. 5 schematically shows Java Web based on Eclipse and Tomcat according to the application embodiment The structural schematic diagram of mesh updating device;
Fig. 6 schematically shows Java Web based on Eclipse and Tomcat according to the application embodiment Another structural schematic diagram of mesh updating device;
Fig. 7 schematically shows the structural schematic diagram of the calculating equipment according to the application embodiment;
Fig. 8 schematically shows a kind of structural schematic diagram of terminal according to the application embodiment;
In the accompanying drawings, identical or corresponding label indicates identical or corresponding part.
Specific embodiment
The principle and spirit of the application are described below with reference to illustrative embodiments.It should be appreciated that providing these realities Mode is applied just for the sake of making those skilled in the art can better understand that realizing the application in turn, and be not in any way Limit scope of the present application.On the contrary, these embodiments are provided so that this disclosure will be more thorough and complete, and can incite somebody to action The scope of the present disclosure is completely communicated to those skilled in the art.
According to presently filed embodiment, a kind of Java Web project update based on Eclipse and Tomcat is proposed Method and relevant apparatus.
Herein, it is to be understood that related term:
JAVA:Java is an Object-Oriented Programming Language, not only absorbs the various advantages of C Plus Plus, has also abandoned C ++ the concepts such as inner elusive more succession, pointers, therefore Java language has powerful and easy to use two features.
Eclipse:Eclipse is an open source code, the expansible development platform based on Java.With regard to itself Speech, it is a frame and one group of service, for making up environment by plug in component.
Tomcat:One Web Application Server freely increased income, belongs to lightweight application server, in middle-size and small-size system It is not to be commonly used under many occasions with concurrent users, is the first choice of exploitation and debugging JSP program.
Java Web project update method provided by the embodiments of the present application based on Eclipse and Tomcat, abandoning tradition The method that application is updated by the way of complete war packet.But it uses and first needs to update according to the generation of the parameter of configuration Patch file, then by patch file packing dispose.That is, realizing a kind of mode of incremental update.Relative to traditional Complete war packet, the data volume of update is much smaller, convenient for transmission and deployment.Moreover, the mode updated does not need manually to search mesh Record, administration of the counterpart Ministry of worker can be avoided manually-operated mistake.
Java Web project update method applicable neck provided by the embodiments of the present application based on Eclipse and Tomcat Domain includes:It, can be by and when having the demand frequently updated on a small quantity when using Tomcat as Java Web application container Eclipse, which is realized, quickly to be updated, and is largely reduced traditional approach and is spent in packing and upload the time of link.
It is one of application scenarios schematic diagram provided by the embodiments of the present application with reference to Fig. 1, which for example may include using Family 10, terminal device 21 and Tomcat server 22.Wherein, mountable in terminal device 21 to have various clients, such as the application Middle progress parameter configuration generates patch file and carries out the patch client of patch installing etc..
Wherein, user can carry out parameter configuration in the client of patch installing, and some of them parameter can be configured once It completes, such as project name, the root folder title of project workspace code, the path of working space, Eclipse project work After making space path, Java code catalogue, the catalogue of web resource, the catalogue of other resources in addition to web resource, compiling The local storage position of code directory, patch.It can also include list of patches file in the parameter of configuration, list of patches file needs It wants to be updated when each patch installing for specific patch.It is then possible to according to the parameter of configuration generate patch file and on It passes to and carries out deployment update in server.In this way, it is accomplished that the update for updating rather than entire war packet to partial document, And it can be corresponding according to the corresponding storage of storage catalogue of the preset storage target of file and server local when deployment Patch file searches storage catalogue without artificial, so more accurate relative to artificial storage.
Wherein, mobile terminal device 21 and server 22 can be communicatively coupled by communication network, which can be Local area network, wide area network etc., naturally it is also possible to pass through wireless connection.Terminal device 11 can be mobile phone, tablet computer, notebook electricity Brain, personal computer etc..
Java Web project update method to provided by the embodiments of the present application based on Eclipse and Tomcat below, does It further illustrates, as shown in Fig. 2, this method includes:
Step 201:It for application to be updated, is instructed according to parameter configuration, configures relevant parameter;The parameter configuration refers to Enable the list of patches file including the application, wherein be provided with project name in advance for the application and generate required for patch Information;
As previously mentioned, list of patches file is update when needing each patch installing, the content of the inside can pass through right button The code file for needing to generate patch in Eclipse code resource catalogue, in right button popup menu selection duplication qualified name and It obtains.
Step 202:The information according to required for generating patch generates each patch file in list of patches file, will give birth to At each patch file copy under the target directory constructed in advance, and by the file where the target directory with corresponding item Mesh title is named;It wherein, include the file of a project under a file;
Step 203:It receives and this document is pressed from both sides into the Disposition Instructions being deployed in Tomcat;
Step 204:According to the Disposition Instructions, according to the title of file, by the text under the target directory of this document folder Part is deployed in the corresponding catalogue of Tomcat;
Step 205:According to the instruction of restarting that remote reboot is applied, the remote reboot application.
Here, in the embodiment of the present application, the service that can be carried using Tomcat provides the service of remote reboot application, this As long as sample user operates in front of a computer, easy to operate.
Wherein, in one embodiment, it in order to preferably generate patch, is generated required for patch in the embodiment of the present application Information may include:The root folder title of project workspace code, the path of working space, Eclipse project workspace Path, Java code catalogue, web resource catalogue, Resource TOC, local storage position of patch etc..Wherein, project workspace The root folder title of code, the available code directory by after compiling in path of working space replace.
When it is implemented, Eclipse project workspace path, content is similar to D:Eclipse workspaces, be item The place of mesh code storage, for positioning and finding the code file of composition patch.Java code catalogue, Resource TOC, web money Source directory, respectively corresponds java code, resource file, web code file, these three catalogues are primarily used to judgement and constitute patch Each code file be which class file for belonging to the above three classes, specific judgment mode is more than judging that file full path diameter includes Any, as which class file of three kinds of information, in order to classification processing again after sorting out to code file.
Code directory after compiling is exactly working space catalogue plus project name catalogue, in addition project compiling file presss from both sides Catalogue, and patch code file is constituted for positioning and finding, content is similar to:D:\eclipse\workspaces\ projectName\target。
The local storage position of patch is the file copy needed for composition patch to the position, and is fabricated to benefit Fourth file.
When it is implemented, the core ideas of the scheme of copy patch file is the source for the code file being related to temporary patch The partial information of the destination path of path and copy, is spliced into complete source path and destination path, for copying.In view of This, list of patches file can be text file (i.e. suffix is .txt file), and each file occupies a line, by each of generation Patch file copies under the target directory constructed in advance, including:
Every row information in list of patches file is read by row with variable fullFileName, and the information of reading is stored in In array;Then array is looped through in the following way:
It is with character string replacement function that project name, Java code path, other resource paths, web resource path is whole It is substituted for null character string and is copied to variable fileName;
If fileName is ended up with .java, the .java of fileName and fullFileName are substituted for .class;
The value for defining catalogue variable tempDesPath is that fileName arrives the content between a last slash from the beginning; And define following three variables, target directory desFilePathStr, file destination complete trails desFileNameStr and source document Part complete trails scourceFileNameStr;Wherein, file destination complete trails=target directory+filename;
Spliced according to tempDesPath, desFilePathStr, desFileNameStr and scourceFileNameStr The source path and target directory of patch file out;
Patch file is copied under target directory from source path.
Wherein, sourceFileNameStr is the source path of file, i.e., file is in the path of Eclipse tool storage.Make Used time according to scourceFileNameStr file copy to DesFileNameStr, and copied files to particular category it Before, it can be created with each file where it, so using this information of desFilePathStr, be passed through DesFilePathStr.exists is judged whether there is, if there is no then file is created by mkdir, in order to later It can smoothly copy.
Here, since java file is to need to be run with the class document form after compiling in production environment, So it is also that corresponding class file is needed to find out that we, which only do patch, it is copied to patch catalogue and carries out patch production.Institute If fileName is ended up with .java, the .java of fileName and fullFileName to be replaced in the embodiment of the present application At .class.
Further, one of following two mode can be used, the information according to required for generating patch generates list of patches Each patch file in file, specifically includes:
Mode one:Patch generator is copied in the form of .java code under any java resource path of project;It connects Receive the instruction for running specified file according to the method for operation of java application program;Patch file is generated according to the instruction.For example, It uses and patch generator is copied in the form of .java code under any java resource path of project.Such as:
/ src/main/java/com/hymake/common/utils/PatchUtil.java,
Then right button this document selects the method for operation-java application program in right button popup menu, after execution, mends Fourth just makes and finishes.
Mode two:Patch generator is copied under any catalogue in the form of .java code;According in an operating system The command prompt cmd order of input, generates each patch file.
For example.java file is placed on any catalogue, such as:D:\patch\PatchUtil.java;Then system is clicked Actions menu of uniting is run, and input cmd and carriage return input cd D in the command window of pop-up:Patch enter file directory In, it then inputs Javac PatchUtil.java and then inputs java PatchUtil again and just complete patch and make.
Further, in order to avoid maliciously disposing patch, the update deployment of patch is needed to carry out in the embodiment of the present application Authentication.Logging request can be first received when specific implementation, include authentication information in the logging request;According to identity Authentication information authenticates the user identity of login;If certification passes through, executes and receive folder arrangement into Tomcat Disposition Instructions the step of.If certification is not by that can not allow further to operate.Wherein, authentication information such as user name And password.Certainly, any other information for capableing of authenticating identity is suitable for the embodiment of the present application, and the application does not limit this It is fixed.
Further, in order to further reduce the data volume of transmission, the efficiency that patch installing updates, the embodiment of the present application are improved In, after the project name that the file where target directory is applied is named, this document can also be pressed from both sides and be pressed Contracting, and be named using customized suffix name;So, it receives and refers to folder arrangement to the deployment in Tomcat server It enables, can be performed to receive the instruction of choosing to the file of customized suffix name, and using the file chosen as needing portion Affix one's name to the file in Tomcat.
Here, the data volume of patch file is on the one hand further reduced by way of compression, furthermore by after customized Sewing name can help user when selecting patch file folder, can be easy-to-look-up, can quickly and accurately find the benefit of needs Fourth file carries out upload deployment.Here customized suffix name is, for example, pzip.
Below by specific embodiment, the technical solution of the application is described further.
Overall framework can be as shown in figure 3, include two large divisions in the application:Patch generator 31 and application management platform 32。
1, patch generator 31:For making patch.It may include three modules, parameter configuration module 311, copied files Module 312 and file packetization module 313.
Parameter configuration module:The parameter needed for configuring production patch.Title including project:Project work control generation The root folder title of code, such as MyProject;The path of working space:Eclipse project workspace path, such as D:/ Program Files/eclipse/workspace/;Java code directory:Similar/src/main/java/;The catalogue of resource: Similar/src/main/resources/;The catalogue of web resource:Similar/src/main/webapp/;Code mesh after compiling Record:Similar D:/Program Files/eclipse/workspace/MyProject/target;List of patches file: Patch.txt, the inside content format is for example
/ATMOS/src/main/java/com/hymake/atmos/dao/TTempCreditCqsTotalScor The each code file a line of eHisDao.java;Patch storage position:Such as D:/patch.
Copied files module:Parameter for being configured according to parameter configuration module finds corresponding code file, copies to Under the catalogue of patch storage, stored according to the specification of Tomcat;
File packetization module:Patch file folder for having copied copied files module compresses, compressed format For zip compression, suffix name uses customized suffix name pzip, and compression can be such that the volume of patch file further decreases, and reduces Upload the time of patch.
2, application management module 32:For disposing patch online and restarting application.It includes three modules:Login module 321, patch module 322 is disposed, restarts module 323 online.
Login module:For carrying out proof of identity, prevent any people from can access application management module.
Dispose patch module:For disposing patch, patch is selected, is disposed.
Module is restarted online:For restarting the application under Tomcat online, it will here directly adopt what Tomcat was carried Function.
After understanding corresponding module and dividing, Fig. 4, including following step are referred in the embodiment of the present application when being executed Suddenly:
401, patch generator relevant parameter is configured.
402, code generator is executed, patch file is generated;
Wherein, the specific execution step of code generator is to be read in patch.txt with the coded format of utf-8 Hold, read by row and puts array into;Then array being looped through, it is assumed that traversal is named as fullFileName, FullFileName first uses character string replacement function that project name and java code path, resource path, web resource path is complete Portion is substituted for null character string and is copied to fileName;Such as:
/ATMOS/src/main/java/com/hymake/atmos/dao/TTempCreditCqsTotalScor eHisDao.java
Become after replacement
com/hymake/atmos/dao/TTempCreditCqsTotalScoreHisDao.java
Then judge whether fileName is to end up with .java, if so, fileName's and fullFileName .java it is substituted for .class.Catalogue variable tempDesPath is defined, value is that fileName arrives a last slash, example from the beginning Such as com/hymake/atmos/dao/;Subsequently define three variables, desFilePathStr:Target directory, desFileNameStr:File destination complete trails=target directory+filename, scourceFileNameStr:Source file system-wide Diameter;It is that can be compiled in classes catalogue when deployment, so these two types of texts for java file and resource file The connecting method of the desFilePathStr and desFileNameStr of part are for example:
D:/patch/20180508_2016/ATMOS/WEB-INF/classes/com/hymake/atmos/dao/ TTempCreditCqsTotalScoreHisDao.class;If web resource file, desFilePathStr and The connecting method of desFileNameStr is for example:
D:/patch/20180508_2016/ATMOS/WEB-INF/index.jsp;
ScourceFileNameStr is looked for from Eclipse code operation space, has spliced content for example:
D:/Program Files/eclipse/workspace/ATMOS/target/classes/com/hymake/ atmos/dao/TTempCreditCqsTotalScoreHisDao.class;Then target directory is judged with file class DesFilePathStr whether there is, if there is no then creating;Then using BufferedInputStream and File is copied to destination path from source path scourceFileNameStr by BufferedOutputStream desFileNameStr;After having traversed file array, i.e., the file copy of patch needs to target directory, and with entry name Claim name this document folder.
403, using java.util.zip tool-class, patch catalogue file folder is traversed, is compressed using recursive mode At zip, then changing suffix is pzip.
404, according to pre-set user name password is inputted, application management platform is logged in.Login module is defeated user The user name password entered is submitted to verification the class Login, Login on backstage for user name and password and the user name password that sets It is matched.If successful match jumps to welcome page, if it fails to match, return to login page, and prompt user name or Password mistake.
Wherein, user name password can use simple preserving type, be stored in user.properties, with userid: Password form saves, each user name password a line.
405, welcome page is shown, the interface is there are two menu, and one is deployment patch module, and one is to restart mould online Block shows corresponding interface after detecting that clicking to enter deployment patch module operates, only one select file of interface The button of column and a deployment.In the patch for receiving selection generation, such as:Patch_20180501_2030.pzip's After selection instruction, if detecting the operation for clicking deployment, after waiting deployment, prompt, deployment success will pop up.
Wherein, upper transmitting file can pass through tool-class UploadFile.java;Wherein, by FileInputStream come The patch file that front end uploads is read, the patch file received is saved in the form of streaming by FileOutputStream To the webapps catalogue of Tomcat;Then the patch file being saved is unziped it by unzip method, until This is deployed to finish.
406, it is included that Tomcat can be jumped to after line restarts the instruction of module in the entrance for detecting click menu triggering The manager page.User can choose the application for wanting to restart at the interface, clicks reload and can be completed and restarts.
Based on identical inventive concept, the application provides a kind of Java Web project based on Eclipse and Tomcat more New equipment, as shown in figure 5, the device includes:
Parameter configuration module 501 instructs according to parameter configuration for being directed to application to be updated, configures relevant parameter;Institute State the list of patches file that parameter configuration instruction includes the application, wherein be provided with project name and life in advance for the application At information required for patch;
Patch file processing module 502 generates in list of patches file for the information according to required for generating patch Each patch file copies each patch file of generation under the target directory constructed in advance to, and will be where the target directory File is named with corresponding project name;It wherein, include the file of a project under a file;
This document is pressed from both sides the Disposition Instructions being deployed in Tomcat for receiving by Disposition Instructions receiving module 503;
Deployment module 504, for according to the Disposition Instructions, according to the title of file, the target mesh that this document is pressed from both sides File under record is deployed in the corresponding catalogue of Tomcat;
Restart module 505, the instruction of restarting for being applied according to remote reboot, the remote reboot application.
Further, generating information required for patch includes:The root folder title of project workspace code, work The path in space, Eclipse project workspace path, Java code catalogue, the catalogue of web resource, in addition to web resource The local storage position of code directory, patch after the catalogues of other resources, compiling.
Further, as shown in fig. 6, patch file processing module 502, including:
Code copies unit 5021, for patch generator to be copied to any of project in the form of .java code Under java resource path;
Instruction receiving unit 5022, for receiving the finger for running specified file according to the method for operation of java application program It enables;
Patch generation unit 5023, for generating patch file according to the instruction.
Further, patch file processing module 502 includes:
Copy cell 5024, for patch generator to be copied under any catalogue in the form of .java code;
Patch file generation unit 5025, for generating according to the command prompt cmd order inputted in an operating system Each patch file.
Further, list of patches file is text file, and each file occupies a line, patch file processing module 502 include:
Reading unit 5026, for reading every row information in list of patches file by row with variable fullFileName, And the information of reading is stored in array;
Unit 5027 is looped through, for looping through in the following way to array:
It is with character string replacement function that project name, Java code path, other resource paths, web resource path is whole It is substituted for null character string and is copied to variable fileName;
If fileName is ended up with .java, the .java of fileName and fullFileName are substituted for .class;
The value for defining catalogue variable tempDesPath is that fileName arrives the content between a last slash from the beginning; And define following three variables, target directory desFilePathStr, file destination complete trails desFileNameStr and source document Part complete trails scourceFileNameStr;Wherein, file destination complete trails=target directory+filename;
For according to tempDesPath, desFilePathStr, desFileNameStr and scourceFileNameStr It is spliced into the source path and target directory of patch file;
Patch file is copied under target directory from source path.
Further, referring to Fig. 6, described device further includes:
Logging request receiving module 506 includes authentication information in the logging request for receiving logging request;
Authentication module 507, for being authenticated according to user identity of the authentication information to login;If certification passes through, It then triggers deployment command reception module 503 and executes the step of receiving the Disposition Instructions by folder arrangement into Tomcat.
Further, referring to Fig. 6, described device further includes:
Compression module 508, the project for applying the file where target directory for patch file processing module 502 After title is named, this document folder is compressed, and is named using customized suffix name;
Disposition Instructions receiving module 503, for receiving the instruction of choosing to the file of customized suffix name, and will choosing In file as the file for needing to be deployed in Tomcat.
Next, the application provides a kind of calculating equipment, it may include memory and processor, wherein the memory is used In storage program instruction, the processor refers to for calling the program instruction stored in the memory according to the program of acquisition It enables and executes any Java Web project update method based on Eclipse and Tomcat in the embodiment of the present application.It please join Fig. 7 is examined, it illustrates the application to calculate the structural block diagram that equipment is.During the calculating equipment 700 is embodied as in Fig. 1 or Fig. 2 Control node or memory node.Specifically:
It includes central processing unit (CPU) 701 including random access memory (RAM) 702 and read-only for calculating equipment 700 The system storage 704 of memory (ROM) 703, and connection system storage 704 and central processing unit 701 system it is total Line 705.The equipment 700 that calculates further includes that the basic input/output of information is transmitted between each device helped in computer System (I/O system) 706, and large capacity for storage program area 713, application program 714 and other program modules 715 are deposited Store up equipment 707.
The basic input/output 706 includes display 708 for showing information and inputs letter for user The input equipment 709 of such as mouse, keyboard etc of breath.Wherein the display 708 and input equipment 709 are all by being connected to The input and output controller 76 of system bus 705 is connected to central processing unit 701.The basic input/output 706 is also May include input and output controller 76 with for receive and handle from keyboard, mouse or electronic touch pen etc. it is multiple other The input of equipment.Similarly, input and output controller 76 also provides output to display screen, printer or other kinds of output and sets It is standby.
The mass-memory unit 707 is by being connected to the bulk memory controller (not shown) of system bus 705 It is connected to central processing unit 701.The mass-memory unit 707 and its associated computer-readable medium are to calculate to set Standby 700 provide non-volatile memories.That is, the mass-memory unit 707 may include such as hard disk or CD- The computer-readable medium (not shown) of ROM drive etc.
Without loss of generality, the computer-readable medium may include computer storage media and communication media.Computer Storage medium includes information such as computer readable instructions, data structure, program module or other data for storage The volatile and non-volatile of any method or technique realization, removable and irremovable medium.Computer storage medium includes RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storages its technologies, CD-ROM, DVD or other optical storages, tape Box, tape, disk storage or other magnetic storage devices.Certainly, skilled person will appreciate that the computer storage medium It is not limited to above-mentioned several.Above-mentioned system storage 704 and mass-memory unit 707 may be collectively referred to as memory.
According to the various embodiments of the application, the calculating equipment 700 can also be connected to the network by internet etc. Remote computer operation on to network.Namely calculate equipment 700 can be by the network that is connected on the system bus 705 Interface unit 711 is connected to network 712, in other words, Network Interface Unit 711 can be used also to be connected to other kinds of net Network or remote computer system (not shown).
The memory further includes that one or more than one program, the one or more programs are stored in In memory, the one or more programs include for carry out it is provided by the embodiments of the present application based on Eclipse and The instruction of the Java Web project update method of Tomcat.
Those of ordinary skill in the art will appreciate that above-described embodiment by simulator operation based on Eclipse and All or part of the steps in the Java Web project update method of Tomcat is that relevant hardware can be instructed by program It completes, which can be stored in a computer readable storage medium, storage medium may include:Read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc..
Referring to FIG. 8, the structural schematic diagram of the terminal provided it illustrates the application one embodiment.The terminal 800 is Mobile terminal in Fig. 2.Specifically:
Terminal 800 may include RF (Radio Frequency, radio frequency) circuit 810, include one or more meter It is the memory 820 of calculation machine readable storage medium storing program for executing, input unit 830, display unit 840, sensor 850, voicefrequency circuit 860, close The components such as field communication module 870, the processor 880 for including one or more than one processing core and power supply 890.This Field technical staff is appreciated that the restriction of the not structure paired terminal of terminal structure shown in Fig. 8, may include than illustrating more More or less component perhaps combines certain components or different component layouts.Wherein:
RF circuit 810 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, one or the processing of more than one processor 880 are transferred to.In general, RF circuit 810 includes but is not limited to day Line, at least one amplifier, tuner, one or more oscillators, subscriber identity module (SIM) card, transceiver, coupling Device, LNA (Low Noise Amplifier, low-noise amplifier), duplexer etc..In addition, RF circuit 88 can also be by wireless Communication is communicated with network and other equipment.Any communication standard or agreement can be used in the wireless communication, including but not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, code Point multiple access), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short Messaging Service, short message service) etc..
Memory 820 can be used for storing software program and module, and processor 880 is stored in memory 820 by operation Software program and module, thereby executing various function application and data processing.Memory 820 can mainly include storage journey Sequence area and storage data area, wherein storing program area can the (ratio of application program needed for storage program area, at least one function Such as sound-playing function, image player function) etc.;Storage data area, which can be stored, uses created number according to terminal 800 According to (such as audio data, phone directory etc.) etc..In addition, memory 820 may include high-speed random access memory, can also wrap Include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts. Correspondingly, memory 820 can also include Memory Controller, to provide processor 880 and input unit 830 to memory 820 access.
Input unit 830 can be used for receiving the number or character information of input.
Display unit 840 can be used for showing information input by user or the information and terminal 800 that are supplied to user Various graphical user interface, these graphical user interface can be made of figure, text, icon, video and any combination thereof. Display unit 840 may include display panel 841, optionally, can use LCD (Liquid Crystal Display, liquid crystal Show device), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) configure display panel 841。
Terminal 800 may also include at least one sensor 850, such as optical sensor, motion sensor and other sensings Device.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 841, and proximity sensor can close display when terminal 800 is moved in one's ear Panel 841 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions (generally Three axis) acceleration size, can detect that size and the direction of gravity when static, can be used to identify mobile phone posture application (ratio Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);Extremely In other sensors such as gyroscope, barometer, hygrometer, thermometer, the infrared sensors that terminal 800 can also configure, herein It repeats no more.
Voicefrequency circuit 860, loudspeaker 861, microphone 862 can provide the audio interface between user and terminal 800.Audio Electric signal after the audio data received conversion can be transferred to loudspeaker 861, be converted to sound by loudspeaker 861 by circuit 860 Sound signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 862, after being received by voicefrequency circuit 860 Audio data is converted to, then by after the processing of audio data output processor 880, such as another electricity is sent to through RF circuit 810 Sub- equipment, or audio data is exported to memory 820 to be further processed.Voicefrequency circuit 860 is also possible that earplug Jack, to provide the communication of peripheral hardware earphone Yu terminal 800.
Terminal 800 is established near-field communication with external equipment by near-field communication module 870 and is connect, and passes through the near-field communication Connection carries out data interaction.In the present embodiment, which specifically includes bluetooth module and/or WiFi module.
Processor 880 is the control centre of terminal 800, utilizes each portion of various interfaces and connection whole mobile phone Point, by running or execute the software program and/or module that are stored in memory 820, and calls and be stored in memory 820 Interior data execute the various functions and processing data of terminal 800, to carry out integral monitoring to mobile phone.Optionally, processor 880 may include one or more processing cores;Preferably, processor 880 can integrate application processor and modem processor, Wherein, the main processing operation system of application processor, user interface and application program etc., modem processor mainly handles nothing Line communication.It is understood that above-mentioned modem processor can not also be integrated into processor 880.
Terminal 800 further includes the power supply 890 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and processor 880 are logically contiguous, to realize management charging, electric discharge and power consumption by power-supply management system The functions such as management.Power supply 890 can also include one or more direct current or AC power source, recharging system, power supply event Hinder the random components such as detection circuit, power adapter or inverter, power supply status indicator.
Although being not shown, terminal 800 can also be including bluetooth module etc., and details are not described herein.
Specifically in the present embodiment, terminal 800 further includes having memory and one or more than one program, In one perhaps more than one program be stored in memory and be configured to be executed by one or more than one processor with Realize the above-mentioned Java Web project update method based on Eclipse and Tomcat.
Those of ordinary skill in the art will appreciate that all or part of the steps in the method for registering of above-described embodiment is can It is completed with instructing relevant hardware by program, which can store in computer readable storage medium, and storage is situated between Matter may include:Read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc..
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
The foregoing is merely the preferred embodiments of the application, not to limit the application, it is all in spirit herein and Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.

Claims (10)

1. a kind of Java Web project update method based on Eclipse and Tomcat, which is characterized in that the method includes:
It for application to be updated, is instructed according to parameter configuration, configures relevant parameter;The parameter configuration instruction includes the application List of patches file, wherein for the application be provided in advance project name and generate patch required for information;
The information according to required for generating patch generates each patch file in list of patches file, by each patch text of generation Part copies under the target directory constructed in advance, and the file where the target directory is ordered with corresponding project name Name;It wherein, include the file of a project under a file;
It receives and this document is pressed from both sides into the Disposition Instructions being deployed in Tomcat;
The file under the target directory of this document folder is deployed according to the title of file according to the Disposition Instructions In the corresponding catalogue of Tomcat;
According to the instruction of restarting that remote reboot is applied, the remote reboot application.
2. the method according to claim 1, wherein information required for generation patch includes:Project work is empty Between code root folder title, Eclipse project workspace path, Java code catalogue, web resource catalogue, resource mesh It records, the local storage position of patch, wherein;Code directory after compiling can be used for replacing the root of the project workspace code Folder name and Eclipse project workspace path.
3. the method according to claim 1, wherein the information according to required for generating patch, generates patch column Each patch file in list file, including:
Patch generator is copied in the form of .java code under any java resource path of project;
Receive the instruction for running specified file according to the method for operation of java application program;
Patch file is generated according to the instruction.
4. the method according to claim 1, wherein the information according to required for generating patch, generates patch column Each patch file in list file, including:
Patch generator is copied under any catalogue in the form of .java code;
According to the command prompt cmd order inputted in an operating system, each patch file is generated.
5. according to the method described in claim 2, and each file accounts for it is characterized in that, list of patches file is text file With a line, each patch file of generation is copied under the target directory constructed in advance, including:
Every row information in list of patches file is read by row with variable fullFileName, and the information of reading is stored in array In;
Array is looped through in the following way:
Project name, Java code path, other resource paths, web resource path are all replaced with character string replacement function At null character string and it is copied to variable fileName;
If fileName is ended up with .java, the .java of fileName and fullFileName are substituted for .class;
The value for defining catalogue variable tempDesPath is that fileName arrives the content between a last slash from the beginning;And it is fixed Adopted following three variables, target directory desFilePathStr, file destination complete trails desFileNameStr and source file are complete Path scourceFileNameStr;Wherein, file destination complete trails=target directory+filename;
Benefit is spliced into according to tempDesPath, desFilePathStr, desFileNameStr and scourceFileNameStr The source path and target directory of fourth file;
Patch file is copied under target directory from source path.
6. the method according to claim 1, wherein the method also includes:
Logging request is received, includes authentication information in the logging request;
It is authenticated according to user identity of the authentication information to login;
If certification passes through, the step of receiving the Disposition Instructions by folder arrangement into Tomcat is executed.
7. the method according to claim 1, wherein the entry name by the file where target directory to apply After title is named, the method also includes:
This document folder is compressed, and is named using customized suffix name;
The Disposition Instructions by folder arrangement into Tomcat are received, including:
The instruction of choosing to the file of customized suffix name is received, and is deployed to the file chosen as needs File in Tomcat.
8. a kind of Java Web project updating device based on Eclipse and Tomcat, which is characterized in that the device includes:
Parameter configuration module instructs according to parameter configuration for being directed to application to be updated, configures relevant parameter;The parameter Configuration-direct includes the list of patches file of the application, wherein is provided with project name in advance for the application and generates patch Required information;
Patch file processing module generates each patch in list of patches file for the information according to required for generating patch File copies each patch file of generation under the target directory constructed in advance to, and by the file where the target directory It is named with corresponding project name;It wherein, include the file of a project under a file;
This document is pressed from both sides the Disposition Instructions being deployed in Tomcat for receiving by Disposition Instructions receiving module;
Deployment module, for the text according to the Disposition Instructions, according to the title of file, under the target directory that this document is pressed from both sides Part is deployed in the corresponding catalogue of Tomcat;
Restart module, the instruction of restarting for being applied according to remote reboot, the remote reboot application.
9. a kind of calculating equipment, which is characterized in that including memory and processor, wherein the memory is for storing program Instruction, the processor are executed according to the program instruction of acquisition as weighed for calling the program instruction stored in the memory Benefit requires 1~7 any Java Web project update method based on Eclipse and Tomcat.
10. a kind of computer storage medium, which is characterized in that the computer storage medium is stored with the executable finger of computer Enable, the computer executable instructions be used for make computer execute as described in claim 1~7 is any based on Eclipse with The Java Web project update method of Tomcat.
CN201810629891.5A 2018-06-19 2018-06-19 Java Web project update method and relevant apparatus based on Eclipse and Tomcat Pending CN108829430A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810629891.5A CN108829430A (en) 2018-06-19 2018-06-19 Java Web project update method and relevant apparatus based on Eclipse and Tomcat

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810629891.5A CN108829430A (en) 2018-06-19 2018-06-19 Java Web project update method and relevant apparatus based on Eclipse and Tomcat

Publications (1)

Publication Number Publication Date
CN108829430A true CN108829430A (en) 2018-11-16

Family

ID=64142562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810629891.5A Pending CN108829430A (en) 2018-06-19 2018-06-19 Java Web project update method and relevant apparatus based on Eclipse and Tomcat

Country Status (1)

Country Link
CN (1) CN108829430A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905463A (en) * 2019-01-29 2019-06-18 北京海杭通讯科技有限公司 The method issued automatically based on web application multiserver
CN110427343A (en) * 2019-06-27 2019-11-08 苏州浪潮智能科技有限公司 A kind of method of deployment file, computer equipment and readable storage medium storing program for executing
CN110502276A (en) * 2019-08-21 2019-11-26 深圳市钱海网络技术有限公司 Service packs generation method, device, equipment and computer readable storage medium
CN111078265A (en) * 2019-11-28 2020-04-28 上海三零卫士信息安全有限公司 Jenkins-based web project update patch generation method
CN111724133A (en) * 2020-06-19 2020-09-29 北京达佳互联信息技术有限公司 A method and apparatus for creating a project
CN113127419A (en) * 2019-12-30 2021-07-16 腾讯科技(深圳)有限公司 File detection method and device, computer equipment and storage medium
CN114168146A (en) * 2021-12-07 2022-03-11 深圳我家云网络科技有限公司 Method, device and equipment for generating patch package
CN114741089A (en) * 2022-03-15 2022-07-12 深圳开源互联网安全技术有限公司 Method and device for remotely deploying product folders by using recursive function

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156649A (en) * 2011-03-01 2011-08-17 奇智软件(北京)有限公司 Patch installation method and device thereof
CN104539696A (en) * 2014-12-26 2015-04-22 北京像素软件科技股份有限公司 Client end incremental updating method and system
CN106325952A (en) * 2016-08-30 2017-01-11 广西电网有限责任公司 Tomcat single-machine one-key automatic deployment method
US20170090902A1 (en) * 2015-09-30 2017-03-30 Apple Inc. Software Updating
CN107861736A (en) * 2017-11-01 2018-03-30 网易(杭州)网络有限公司 Patch generates and update method and device, electronic equipment, storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156649A (en) * 2011-03-01 2011-08-17 奇智软件(北京)有限公司 Patch installation method and device thereof
CN104539696A (en) * 2014-12-26 2015-04-22 北京像素软件科技股份有限公司 Client end incremental updating method and system
US20170090902A1 (en) * 2015-09-30 2017-03-30 Apple Inc. Software Updating
CN106325952A (en) * 2016-08-30 2017-01-11 广西电网有限责任公司 Tomcat single-machine one-key automatic deployment method
CN107861736A (en) * 2017-11-01 2018-03-30 网易(杭州)网络有限公司 Patch generates and update method and device, electronic equipment, storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LIZHUQUAN0769: "【SVN】SVN增量打包", 《HTTPS://BLOG.51 CTO.COM/IIZHUQUAN0769/1750790》 *
SCHOOL11: "eclipse实现JavaWeb应用增量打包", 《HTTPS://BLOG.CSDN.NET/SCHOOL11/ARTICLE/DETAILS/41745263》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905463A (en) * 2019-01-29 2019-06-18 北京海杭通讯科技有限公司 The method issued automatically based on web application multiserver
CN110427343A (en) * 2019-06-27 2019-11-08 苏州浪潮智能科技有限公司 A kind of method of deployment file, computer equipment and readable storage medium storing program for executing
CN110502276A (en) * 2019-08-21 2019-11-26 深圳市钱海网络技术有限公司 Service packs generation method, device, equipment and computer readable storage medium
CN111078265A (en) * 2019-11-28 2020-04-28 上海三零卫士信息安全有限公司 Jenkins-based web project update patch generation method
CN111078265B (en) * 2019-11-28 2024-04-02 上海三零卫士信息安全有限公司 Web project update patch generation method based on jenkins
CN113127419A (en) * 2019-12-30 2021-07-16 腾讯科技(深圳)有限公司 File detection method and device, computer equipment and storage medium
CN113127419B (en) * 2019-12-30 2023-09-22 腾讯科技(深圳)有限公司 File detection method, device, computer equipment and storage medium
CN111724133A (en) * 2020-06-19 2020-09-29 北京达佳互联信息技术有限公司 A method and apparatus for creating a project
CN114168146A (en) * 2021-12-07 2022-03-11 深圳我家云网络科技有限公司 Method, device and equipment for generating patch package
CN114741089A (en) * 2022-03-15 2022-07-12 深圳开源互联网安全技术有限公司 Method and device for remotely deploying product folders by using recursive function

Similar Documents

Publication Publication Date Title
CN108829430A (en) Java Web project update method and relevant apparatus based on Eclipse and Tomcat
CN106970790B (en) Application program creating method, related equipment and system
US20210034336A1 (en) Executing a process-based software application in a first computing environment and a second computing environment
CA2915620C (en) Method and apparatus for code virtualization and remote process call generation
CN103279288B (en) Data transmission method, device and terminal unit
EP3680761A1 (en) Notification display method and terminal
CN106778117B (en) Permission open method, apparatus and system
WO2005081130A1 (en) Device and method of operation
CN105426165B (en) A kind of processing method and processing device of wscript.exe
CN108874866A (en) Data import management method, apparatus, mobile terminal and storage medium
CN102223736B (en) The server communicated is carried out with using the multi-mode equipment of multi-mode application
US20200065094A1 (en) Automatically mapping data while designing process flows
CN105630685A (en) Method and device for testing program interface
CN108345543A (en) A kind of data processing method, device, equipment and storage medium
CN104104711B (en) Reading histories treating method and apparatus
CN110058850A (en) A kind of development approach of application, device and storage medium
CN106357521A (en) Data sharing method and device
CN109309696A (en) Folder sending method, sender, receiver, and storage medium
CN110489679A (en) A kind of processing method of browser kernel, device and storage medium
EP2823411A1 (en) A method and system of application development for multiple device client platforms
CN107992498B (en) Method and system for importing data into data warehouse
CN107026908A (en) By the method and device of the Data Migration of second terminal to first terminal
CN110196795A (en) Detect the method and relevant apparatus of mobile terminal application operating status
CN110196833A (en) Searching method, device, terminal and the storage medium of application program
US10019519B2 (en) Methods and systems for utilizing global entities in software applications

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181116