CN111198708A - Method and device for solving conflict of jar packets - Google Patents
Method and device for solving conflict of jar packets Download PDFInfo
- Publication number
- CN111198708A CN111198708A CN201811368303.3A CN201811368303A CN111198708A CN 111198708 A CN111198708 A CN 111198708A CN 201811368303 A CN201811368303 A CN 201811368303A CN 111198708 A CN111198708 A CN 111198708A
- Authority
- CN
- China
- Prior art keywords
- jar
- packet
- basic
- jar packet
- path
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method and a device for solving conflict of jar packets. The method for solving the conflict of the jar packages obtains a plurality of basic jar packages with dependency relations, wherein at least one basic jar package conflicts with a target jar package; decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents; and modifying the path of each basic jar packet in the middle jar packet to obtain a result jar packet. According to the technical scheme, a plurality of basic jar packets are decompressed to form an intermediate jar packet, so that the basic jar packets have different dependent paths. And modifying the path of each basic jar packet in the middle jar packet, and further distinguishing the path from the conflicting target jar packets to ensure that the paths are different. When an application program is developed, because the path of the basic jar package and the dependent path are changed, the result jar package is directly referred, so that the reference error can not occur, and the conflict of the jar package is effectively avoided.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for solving conflict of jar packages.
Background
The jar package (Java archive file) is a Java archive file, in which classes required by several applications are compressed and can be directly used by the applications. When the application program is developed, the development efficiency can be improved by utilizing the existing jar package. However, when using jar packages developed by different developers, since there may be the same name of the jar package, or since the jar package is updated, there are multiple jar packages of different versions, and using such multiple jar packages with the same name may cause conflict of the jar packages. A corresponding solution is therefore required.
Disclosure of Invention
In view of the above, the present invention has been made to provide a jar packet conflict solution method, apparatus, electronic device and computer-readable storage medium that overcome or at least partially solve the above problems.
According to an aspect of the invention, a jar packet conflict resolution method is provided, which comprises the following steps:
obtaining a plurality of basic jar packages with dependency relationship, wherein at least one basic jar package conflicts with a target jar package;
decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents;
and modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet.
Optionally, the modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet includes:
and sequentially modifying the path of each basic jar packet in the intermediate jar packet according to the dependency relationship to finally obtain the result jar packet.
Optionally, the sequentially modifying the paths of each basic jar packet in the intermediate jar packet according to the dependency relationship, and finally obtaining the result jar packet includes:
when one base jar packet depends on another base jar packet, the path of the dependent base jar packet is modified.
Optionally, the decompressing the plurality of base jar packets, and synthesizing an intermediate jar packet according to the decompressed content includes:
and respectively decompressing the plurality of basic jar packets based on jar commands, and synthesizing an intermediate jar packet according to decompressed contents.
Optionally, the modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet includes:
and modifying the path of each basic jar packet in the intermediate jar packet based on the jar command to obtain a result jar packet.
According to another aspect of the present invention, there is provided a jar packet conflict solution apparatus, comprising:
the device comprises a basic jar packet obtaining unit, a target jar packet obtaining unit and a base jar packet obtaining unit, wherein the basic jar packet obtaining unit is suitable for obtaining a plurality of basic jar packets with dependency relations, and at least one basic jar packet conflicts with a target jar packet;
the intermediate jar packet forming unit is suitable for respectively decompressing the plurality of basic jar packets and synthesizing an intermediate jar packet according to decompressed contents;
and the result jar packet obtaining unit is suitable for modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet.
Optionally, the result jar packet obtaining unit is further adapted to modify paths of each basic jar packet in the intermediate jar packet in sequence according to the dependency relationship, and finally obtain the result jar packet.
Optionally, the result jar packet obtaining unit is further adapted to modify a path of a dependent base jar packet when one base jar packet depends on another base jar packet.
Optionally, the intermediate jar packet forming unit is further adapted to decompress the plurality of basic jar packets based on jar commands, respectively, and synthesize an intermediate jar packet according to decompressed contents.
Optionally, the result jar packet obtaining unit is further adapted to modify a path of each basic jar packet in the intermediate jar packet based on a jar command to obtain a result jar packet.
In accordance with still another aspect of the present invention, there is provided an electronic apparatus including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform a method as any one of the above.
According to a further aspect of the invention, there is provided a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement a method as any one of the above.
According to the technical scheme, a plurality of basic jar packages with dependency relations are obtained, wherein at least one basic jar package conflicts with a target jar package; decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents; and modifying the path of each basic jar packet in the middle jar packet to obtain a result jar packet. According to the technical scheme, a plurality of basic jar packets are decompressed to form an intermediate jar packet, so that the basic jar packets have different dependent paths. And modifying the path of each basic jar packet in the middle jar packet to ensure that the paths are further distinguished from the conflicting target jar packets, wherein the paths of the basic jar packets and the conflicting target jar packets are different. When an application program is developed, because the path of the basic jar package and the dependent path are changed, the result jar package is directly referred, so that the reference error can not occur, and the conflict of the jar package is effectively avoided.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart illustrating a jar packet conflict resolution method according to an embodiment of the invention;
FIG. 2 is a schematic structural diagram of a jar packet conflict resolution device according to an embodiment of the invention;
FIG. 3 shows a schematic structural diagram of an electronic device according to one embodiment of the invention;
fig. 4 shows a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flowchart illustrating a jar packet conflict resolution method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S110, a plurality of basic Jar packages with dependency relations are obtained, wherein at least one basic Jar package conflicts with a target Jar package.
The basic jar packages are jar packages adopted during application program development, wherein the dependency relationship means that each basic jar package has an invoking relationship and is also called an interconnection. For example, when the first jar package is running, class M in the first jar package needs to call N methods of class N in the second jar package. There is at least one base jar packet conflicting with the target class, i.e., there is at least one base jar packet having the same name as the target jar packet. For example, a developer generates a target jar package named as a.jar in the application development process, the developer wants to use an SDK provided by other developers, and a basic jar package contained in the SDK is named as a.jar, so that jar package conflict is generated in subsequent citation.
And step S120, respectively decompressing the plurality of basic jar packets, and synthesizing an intermediate jar packet according to the decompressed content.
And a plurality of basic jar packages have a dependency relationship, and the basic jar packages are combined into an intermediate jar package, so that the basic jar package which conflicts with the target jar package has a new dependent transmission path. For example, the target jar package is a.jar, and the plurality of base jar packages comprise a.jar and a b.jar with dependency relationships, wherein the a.jar and the b.jar have dependency relationships
And the A.jar conflicts with the target jar packet, the A.jar and the B.jar are decompressed and synthesized into a C.jar, and the dependent transmission path of the A.jar is transmitted from the C.jar of the intermediate jar packet and is different from the dependent transmission path of the target jar packet.
And step S130, modifying the path of each basic jar packet in the middle jar packet to obtain a result jar packet.
After the intermediate jar packet is generated, although the dependent transmission path of the A.jar is changed, the path of the A.jar is not changed, namely the A.jar still has the same name as the target jar packet, and the name of the jar packet is the path. Therefore, the path of each basic jar packet needs to be modified correspondingly so as to be distinguished from the target jar packet, namely, the inline reference is modified. For example, after a.jar and b.jar are decompressed to form a c.jar, the path of the a.jar is modified to be qihoo.a.jar, which is distinguished from the target jar packet. When the base jar package A.jar needs to be quoted, quoting the qihoo.A.jar from the path C.jar will not conflict with the target jar package.
When two or more basic jar packets conflict with a plurality of target jar packets, it is difficult to modify the path packets of the basic jar packets with conflicts one by one. Therefore, the paths of all the basic jar packets in the middle jar packet are directly modified, and the problem that a plurality of basic jar packets conflict with a plurality of target jar packets can be effectively solved. For example, the B.jar is also modified into the qihoo.B.jar, so that the problem that the basic jar packages A.jar and B.jar conflict with the target jar packages A.jar and B.jar can be effectively solved.
On the other hand, because the dependency relationship exists between the basic jar packages, after the path of the basic jar package A.jar is modified, the dependency relationship of the other basic jar packages needs to be modified correspondingly so as to keep the correct dependency relationship between the basic jar packages. For example, when the base jar package b.jar depends on the base jar package a.jar, the base jar package b.jar depends on the qihoo.a.jar, which needs to be modified accordingly.
In the embodiment, a plurality of basic jar packages with dependency relationship are obtained, wherein at least one basic jar package conflicts with a target jar package; decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents; and modifying the path of each basic jar packet in the middle jar packet to obtain a result jar packet. According to the technical scheme, a plurality of basic jar packets are decompressed to form an intermediate jar packet, so that the basic jar packets have different dependent paths. And modifying the path of each basic jar packet in the middle jar packet, and further distinguishing the path from the conflicting target jar packets to ensure that the paths are different. When an application program is developed, because the path of the basic jar package and the dependent path are changed, the result jar package is directly referred, so that the reference error can not occur, and the conflict of the jar package is effectively avoided.
In an embodiment of the present invention, in the method shown in fig. 1, the modifying the path of each base jar packet in the intermediate jar packet in step S130 to obtain a result jar packet includes: and sequentially modifying the path of each basic jar packet in the intermediate jar packet according to the dependency relationship to finally obtain a result jar packet.
The embodiment provides a specific method for modifying the path of the basic jar packet. The paths of each basic jar packet in the middle jar packet are modified in sequence according to the dependency relationship, namely the modification of the paths is performed according to a certain sequence, and the method has logic property, can ensure the correctness of the modification of the paths, and avoids omission. For example, a first jar packet depends on a second jar packet in the middle jar packet, and when the path is modified, the path can be modified from front to back according to the dependency relationship, for example, the path of the first jar packet is modified first, and then the path of the second jar packet is modified.
In an embodiment of the present invention, in the method, the sequentially modifying the path of each basic jar packet in the intermediate jar packet according to the dependency relationship, and finally obtaining the result jar packet includes: when one base jar packet depends on another base jar packet, the path of the dependent base jar packet is modified.
For example, a.jar and b.jar in the base jar package, a.jar depends on b.jar. When the path is modified, the path of the dependent B.jar is modified to be qiho.B.jar, and then the path of the A.jar is modified to be qiho.A.jar in sequence. Meanwhile, the dependency relationship in the a.jar also needs to be modified, that is, the dependency b.jar in the a.jar is modified to be the dependency qi.
When there are more than three basic jar packages, such as a.jar, b.jar, and c.jar, a.jar depends on b.jar, b.jar depends on c.jar. Then the path of c.jar is modified first, then the path of b.jar is modified, and finally the path of a.jar is modified. It should be noted that, when there are multiple basic jar packages with dependency relationships, the method may also be used to modify the path of each basic jar package, which is not described herein again.
All the dependency relations among the basic jar packages form a dependency tree, the path of the dependent basic jar packages is modified firstly, namely the paths of the dependent basic jar packages are modified step by step from the treetop of the dependency tree along the dependent transmission path of the dependency tree, the path modification of the basic jar packages is guaranteed to be orderly, and omission is avoided.
In an embodiment of the present invention, in the method shown in fig. 1, decompressing a plurality of base jar packets, respectively, and synthesizing an intermediate jar packet according to the decompressed contents includes: and respectively decompressing the plurality of basic jar packets based on jar commands, and synthesizing an intermediate jar packet according to decompressed contents.
The jar command is one of cmd commands, and can execute corresponding operations on jar packages and class files. For example, a jar packet is decompressed or composed by entering a corresponding jar command in the cmd. In this embodiment, first, a decompression jar command in jar commands is adopted to decompress a plurality of basic jar packets, and class files in each basic jar packet after decompression are stored in a corresponding basic jar packet folder. And then, acquiring class files in each basic jar package folder by adopting a compressed jar command in jar commands, and synthesizing the class files into an intermediate jar package.
In an embodiment of the present invention, in the method shown in fig. 1, modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet includes: and modifying the path of each basic jar packet in the middle jar packet based on the jar command to obtain a result jar packet.
The jar command also comprises a command for modifying the path, and the path modification of the basic jar packet is realized by adopting the modified jar command. For example, the a.jar in the base jar package is modified to qihoo.a.jar. The jar command is adopted to execute the modification operation, so that the method is simple and convenient, and the working efficiency can be improved.
Fig. 2 is a schematic structural diagram of a jar packet conflict resolution device according to an embodiment of the present invention. As shown in fig. 2, the apparatus 200 includes:
the basic jar package obtaining unit 210 is adapted to obtain a plurality of basic jar packages having a dependency relationship, where at least one basic jar package conflicts with a target jar package.
The basic jar packages are jar packages adopted during application program development, wherein the dependency relationship means that each basic jar package has an invoking relationship and is also called an interconnection. For example, when the first jar package is running, class M in the first jar package needs to call N methods of class N in the second jar package. There is at least one base jar packet conflicting with the target class, i.e., there is at least one base jar packet having the same name as the target jar packet. For example, a developer generates a target jar package named as a.jar in the application development process, the developer wants to use an SDK provided by other developers, and a basic jar package contained in the SDK is named as a.jar, so that jar package conflict is generated in subsequent citation.
The intermediate jar packet forming unit 220 is adapted to decompress the plurality of basic jar packets, respectively, and to synthesize an intermediate jar packet according to the decompressed contents.
And a plurality of basic jar packages have a dependency relationship, and the basic jar packages are combined into an intermediate jar package, so that the basic jar package which conflicts with the target jar package has a new dependent transmission path. For example, the target jar package is a.jar, and the plurality of base jar packages comprise a.jar and a b.jar with dependency relationships, wherein the a.jar and the b.jar have dependency relationships
And the A.jar conflicts with the target jar packet, the A.jar and the B.jar are decompressed and synthesized into a C.jar, and the dependent transmission path of the A.jar is transmitted from the C.jar of the intermediate jar packet and is different from the dependent transmission path of the target jar packet.
The result jar packet obtaining unit 230 is adapted to modify the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet.
After the intermediate jar packet is generated, although the dependent transmission path of the A.jar is changed, the path of the A.jar is not changed, namely the A.jar still has the same name as the target jar packet, and the name of the jar packet is the path. Therefore, the path of each basic jar packet needs to be modified correspondingly so as to be distinguished from the target jar packet, namely, the inline reference is modified. For example, after a.jar and b.jar are decompressed to form a c.jar, the path of the a.jar is modified to be qihoo.a.jar, which is distinguished from the target jar packet. When the base jar package A.jar needs to be quoted, quoting the qihoo.A.jar from the path C.jar will not conflict with the target jar package.
When two or more basic jar packets conflict with a plurality of target jar packets, it is difficult to modify the path packets of the basic jar packets with conflicts one by one. Therefore, the paths of all the basic jar packets in the middle jar packet are directly modified, and the problem that a plurality of basic jar packets conflict with a plurality of target jar packets can be effectively solved. For example, the B.jar is also modified into the qihoo.B.jar, so that the problem that the basic jar packages A.jar and B.jar conflict with the target jar packages A.jar and B.jar can be effectively solved.
On the other hand, because the dependency relationship exists between the basic jar packages, after the path of the basic jar package A.jar is modified, the dependency relationship of the other basic jar packages needs to be modified correspondingly so as to keep the correct dependency relationship between the basic jar packages. For example, when the base jar package b.jar depends on the base jar package a.jar, the base jar package b.jar depends on the qihoo.a.jar, which needs to be modified accordingly.
In the embodiment, a plurality of basic jar packages with dependency relationship are obtained, wherein at least one basic jar package conflicts with a target jar package; decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents; and modifying the path of each basic jar packet in the middle jar packet to obtain a result jar packet. According to the technical scheme, a plurality of basic jar packets are decompressed to form an intermediate jar packet, so that the basic jar packets have different dependent paths. And modifying the path of each basic jar packet in the middle jar packet, and further distinguishing the path from the conflicting target jar packets to ensure that the paths are different. When an application program is developed, because the path of the basic jar package and the dependent path are changed, the result jar package is directly referred, so that the reference error can not occur, and the conflict of the jar package is effectively avoided.
In an embodiment of the present invention, as shown in fig. 2, in the apparatus, the result jar packet obtaining unit 230 is further adapted to sequentially modify paths of each basic jar packet in the intermediate jar packet according to the dependency relationship, so as to finally obtain the result jar packet.
The embodiment provides a specific method for modifying the path of the basic jar packet. The paths of each basic jar packet in the middle jar packet are modified in sequence according to the dependency relationship, namely the modification of the paths is performed according to a certain sequence, and the method has logic property, can ensure the correctness of the modification of the paths, and avoids omission. For example, a first jar packet depends on a second jar packet in the middle jar packet, and when the path is modified, the path can be modified from front to back according to the dependency relationship, for example, the path of the first jar packet is modified first, and then the path of the second jar packet is modified.
Further, the result jar packet obtaining unit 230 is adapted to modify a path of a dependent base jar packet when the base jar packet depends on another base jar packet.
For example, a.jar and b.jar in the base jar package, a.jar depends on b.jar. When the path is modified, the path of the dependent B.jar is modified to be qiho.B.jar, and then the path of the A.jar is modified to be qiho.A.jar in sequence. Meanwhile, the dependency relationship in the a.jar also needs to be modified, that is, the dependency b.jar in the a.jar is modified to be the dependency qi.
When there are more than three basic jar packages, such as a.jar, b.jar, and c.jar, a.jar depends on b.jar, b.jar depends on c.jar. Then the path of c.jar is modified first, then the path of b.jar is modified, and finally the path of a.jar is modified. It should be noted that, when there are multiple basic jar packages with dependency relationships, the method may also be used to modify the path of each basic jar package, which is not described herein again.
All the dependency relations among the basic jar packages form a dependency tree, the path of the dependent basic jar packages is modified firstly, namely the paths of the dependent basic jar packages are modified step by step from the treetop of the dependency tree along the dependent transmission path of the dependency tree, the path modification of the basic jar packages is guaranteed to be orderly, and omission is avoided.
In an embodiment of the present invention, as shown in fig. 2, in the apparatus, the intermediate jar packet forming unit 220 is further adapted to decompress the plurality of basic jar packets based on jar commands, respectively, and to synthesize an intermediate jar packet according to the decompressed contents.
The jar command is one of cmd commands, and can execute corresponding operations on jar packages and class files. For example, a jar packet is decompressed or composed by entering a corresponding jar command in the cmd. In this embodiment, first, a decompression jar command in jar commands is adopted to decompress a plurality of basic jar packets, and class files in each basic jar packet after decompression are stored in a corresponding basic jar packet folder. And then, acquiring class files in each basic jar package folder by adopting a compressed jar command in jar commands, and synthesizing the class files into an intermediate jar package.
In an embodiment of the present invention, in the apparatus shown in fig. 2, the result jar packet obtaining unit 230 is further adapted to modify a path of each basic jar packet in the intermediate jar packet based on the jar command to obtain the result jar packet.
The jar command also comprises a command for modifying the path, and the path modification of the basic jar packet is realized by adopting the modified jar command. For example, the a.jar in the base jar package is modified to qihoo.a.jar. The jar command is adopted to execute the modification operation, so that the method is simple and convenient, and the working efficiency can be improved.
In summary, in the technical scheme of the present invention, a plurality of basic jar packages with dependency relationships are obtained, wherein at least one basic jar package conflicts with a target jar package; decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents; and modifying the path of each basic jar packet in the middle jar packet to obtain a result jar packet. According to the technical scheme, a plurality of basic jar packets are decompressed to form an intermediate jar packet, so that the basic jar packets have different dependent paths. And modifying the path of each basic jar packet in the middle jar packet, and further distinguishing the path from the conflicting target jar packets to ensure that the paths are different. When an application program is developed, because the path of the basic jar package and the dependent path are changed, the result jar package is directly referred, so that the reference error can not occur, and the conflict of the jar package is effectively avoided. It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of a jar packet conflict resolution apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, fig. 3 shows a schematic structural diagram of an electronic device according to an embodiment of the invention. The electronic device comprises a processor 310 and a memory 320 arranged to store computer executable instructions (computer readable program code). The memory 320 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. The memory 320 has a storage space 330 storing computer readable program code 331 for performing any of the method steps described above. For example, the storage space 330 for storing the computer readable program code may comprise respective computer readable program codes 331 for respectively implementing various steps in the above method. The computer readable program code 331 may be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. Such a computer program product is typically a computer readable storage medium such as described in fig. 4. Fig. 4 shows a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention. The computer readable storage medium 400 has stored thereon a computer readable program code 331 for performing the steps of the method according to the invention, readable by a processor 310 of the electronic device 300, which computer readable program code 331, when executed by the electronic device 300, causes the electronic device 300 to perform the steps of the method described above, in particular the computer readable program code 331 stored on the computer readable storage medium may perform the method shown in any of the embodiments described above. The computer readable program code 331 may be compressed in a suitable form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses an A1 and jar packet conflict resolution method, which comprises the following steps:
obtaining a plurality of basic jar packages with dependency relationship, wherein at least one basic jar package conflicts with a target jar package;
decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents;
and modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet.
A2, the method as in A1, wherein the modifying the path of each basic jar packet in the intermediate jar packets to obtain the result jar packets comprises:
and sequentially modifying the path of each basic jar packet in the intermediate jar packet according to the dependency relationship to finally obtain the result jar packet.
A3, the method as in a2, wherein the sequentially modifying the path of each basic jar packet in the intermediate jar packets according to the dependency relationship, and finally obtaining the result jar packet includes:
when one base jar packet depends on another base jar packet, the path of the dependent base jar packet is modified.
A4, the method as in a1, wherein the decompressing the base jar packets respectively, and the synthesizing an intermediate jar packet according to the decompressed contents comprises:
and respectively decompressing the plurality of basic jar packets based on jar commands, and synthesizing an intermediate jar packet according to decompressed contents.
A5, the method as in A1, wherein the modifying the path of each basic jar packet in the intermediate jar packets to obtain the result jar packets comprises:
and modifying the path of each basic jar packet in the intermediate jar packet based on the jar command to obtain a result jar packet.
The invention also discloses B6 and a jar packet conflict resolution device, comprising:
the device comprises a basic jar packet obtaining unit, a target jar packet obtaining unit and a base jar packet obtaining unit, wherein the basic jar packet obtaining unit is suitable for obtaining a plurality of basic jar packets with dependency relations, and at least one basic jar packet conflicts with a target jar packet;
the intermediate jar packet forming unit is suitable for respectively decompressing the plurality of basic jar packets and synthesizing an intermediate jar packet according to decompressed contents;
and the result jar packet obtaining unit is suitable for modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet.
B7, the device of B6, wherein,
the result jar packet obtaining unit is further adapted to modify the path of each basic jar packet in the intermediate jar packet in sequence according to the dependency relationship, and finally obtain the result jar packet.
B8, the device of B7, wherein,
the result jar packet obtaining unit is further adapted to modify the path of the dependent base jar packet when one base jar packet depends on another base jar packet.
B9, the device of B6, wherein,
the intermediate jar packet forming unit is further suitable for respectively decompressing the plurality of basic jar packets based on jar commands and synthesizing an intermediate jar packet according to decompressed contents.
B10, the device of B6, wherein,
the result jar packet obtaining unit is further suitable for modifying the path of each basic jar packet in the middle jar packet based on jar commands to obtain a result jar packet.
The invention also discloses C11 and an electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any one of a1-a 5.
The invention also discloses D12, a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method as described in any of a1-a 5.
Claims (10)
1. A jar packet conflict resolution method comprises the following steps:
obtaining a plurality of basic jar packages with dependency relationship, wherein at least one basic jar package conflicts with a target jar package;
decompressing the plurality of basic jar packets respectively, and synthesizing an intermediate jar packet according to decompressed contents;
and modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet.
2. The method of claim 1, wherein the modifying the path of each base jar packet in the intermediate jar packets to obtain a result jar packet comprises:
and sequentially modifying the path of each basic jar packet in the intermediate jar packet according to the dependency relationship to finally obtain the result jar packet.
3. The method of claim 2, wherein the modifying the path of each basic jar packet in the intermediate jar packets in sequence according to the dependency relationship to obtain the final result jar packet comprises:
when one base jar packet depends on another base jar packet, the path of the dependent base jar packet is modified.
4. The method of claim 1, wherein the decompressing the base jar packets, respectively, and the synthesizing an intermediate jar packet based on the decompressed content comprises:
and respectively decompressing the plurality of basic jar packets based on jar commands, and synthesizing an intermediate jar packet according to decompressed contents.
5. The method of claim 1, wherein the modifying the path of each base jar packet in the intermediate jar packets to obtain a result jar packet comprises:
and modifying the path of each basic jar packet in the intermediate jar packet based on the jar command to obtain a result jar packet.
6. A jar packet conflict resolution apparatus, comprising:
the device comprises a basic jar packet obtaining unit, a target jar packet obtaining unit and a base jar packet obtaining unit, wherein the basic jar packet obtaining unit is suitable for obtaining a plurality of basic jar packets with dependency relations, and at least one basic jar packet conflicts with a target jar packet;
the intermediate jar packet forming unit is suitable for respectively decompressing the plurality of basic jar packets and synthesizing an intermediate jar packet according to decompressed contents;
and the result jar packet obtaining unit is suitable for modifying the path of each basic jar packet in the intermediate jar packet to obtain a result jar packet.
7. The apparatus of claim 6, wherein,
the result jar packet obtaining unit is further adapted to modify the path of each basic jar packet in the intermediate jar packet in sequence according to the dependency relationship, and finally obtain the result jar packet.
8. The apparatus of claim 7, wherein,
the result jar packet obtaining unit is further adapted to modify the path of the dependent base jar packet when one base jar packet depends on another base jar packet.
9. An electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer-executable instructions that, when executed, cause the processor to perform the method of any one of claims 1-5.
10. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811368303.3A CN111198708A (en) | 2018-11-16 | 2018-11-16 | Method and device for solving conflict of jar packets |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811368303.3A CN111198708A (en) | 2018-11-16 | 2018-11-16 | Method and device for solving conflict of jar packets |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111198708A true CN111198708A (en) | 2020-05-26 |
Family
ID=70745682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811368303.3A Pending CN111198708A (en) | 2018-11-16 | 2018-11-16 | Method and device for solving conflict of jar packets |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111198708A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111736848A (en) * | 2020-06-15 | 2020-10-02 | 北京奇艺世纪科技有限公司 | Packet conflict positioning method and device, electronic equipment and readable storage medium |
CN112506560A (en) * | 2020-12-15 | 2021-03-16 | 上海银基信息安全技术股份有限公司 | Microservice JAR packet management method and device and computer equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012063432A1 (en) * | 2010-11-11 | 2012-05-18 | 信越化学工業株式会社 | Bell jar cleaning method |
CN106126205A (en) * | 2016-06-14 | 2016-11-16 | 武汉斗鱼网络科技有限公司 | The rapid batch of a kind of Android program installation kit generates method and system |
CN106874060A (en) * | 2017-01-16 | 2017-06-20 | 上海斐讯数据通信技术有限公司 | It is a kind of to judge the method and apparatus whether JAR bags are cited |
CN106980516A (en) * | 2016-01-15 | 2017-07-25 | 佳能株式会社 | Information processor and method for managing resource |
-
2018
- 2018-11-16 CN CN201811368303.3A patent/CN111198708A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012063432A1 (en) * | 2010-11-11 | 2012-05-18 | 信越化学工業株式会社 | Bell jar cleaning method |
CN106980516A (en) * | 2016-01-15 | 2017-07-25 | 佳能株式会社 | Information processor and method for managing resource |
CN106126205A (en) * | 2016-06-14 | 2016-11-16 | 武汉斗鱼网络科技有限公司 | The rapid batch of a kind of Android program installation kit generates method and system |
CN106874060A (en) * | 2017-01-16 | 2017-06-20 | 上海斐讯数据通信技术有限公司 | It is a kind of to judge the method and apparatus whether JAR bags are cited |
Non-Patent Citations (2)
Title |
---|
ADAM BURLEY: "Java - How do I change the package name of classes inside a JAR", pages 1 - 2, Retrieved from the Internet <URL:https://stackoverflow.com/questions/29987427/how-do-i-change-the-package-name-of-classes-inside-a-jar> * |
GMF_: "把多个jar合并成为一个jar方式", pages 1 - 2, Retrieved from the Internet <URL:https://www.jianshu.com/p/1abbe20eb019> * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111736848A (en) * | 2020-06-15 | 2020-10-02 | 北京奇艺世纪科技有限公司 | Packet conflict positioning method and device, electronic equipment and readable storage medium |
CN111736848B (en) * | 2020-06-15 | 2023-08-22 | 北京奇艺世纪科技有限公司 | Packet conflict positioning method, device, electronic equipment and readable storage medium |
CN112506560A (en) * | 2020-12-15 | 2021-03-16 | 上海银基信息安全技术股份有限公司 | Microservice JAR packet management method and device and computer equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109976761B (en) | Software development kit generation method and device and terminal equipment | |
CN110134386B (en) | Program editing method and device | |
US8595693B2 (en) | Model driven deployment of composite applications | |
CN108304175B (en) | Code file isolation packaging method and device | |
US10599413B2 (en) | Method and device for identifying file | |
CN105589805B (en) | Method and device for generating code coverage rate report | |
CN109766099B (en) | Front-end source code compiling method and device, storage medium and computer equipment | |
CN108984317B (en) | Method and device for realizing IPC (inter-process communication) | |
CN110069259B (en) | ID L file-based parsing method and device, electronic equipment and storage medium | |
CN111026455B (en) | Plug-in generation method, electronic device and storage medium | |
CN111198708A (en) | Method and device for solving conflict of jar packets | |
EP3207453B1 (en) | Api versioning independent of product releases | |
CN110990001A (en) | IVR (Interactive Voice response) process execution method and device | |
CN113885935A (en) | Resource packaging method and device, electronic equipment and computer readable storage medium | |
CN108932123B (en) | Parameter processing method and device | |
CN111523067A (en) | Page style processing method and device, storage medium and computer equipment | |
CN109190367B (en) | Method and device for running application program installation package by utilizing sandbox | |
CN110020370B (en) | Method and device for realizing animation in client application and framework of animation script | |
KR102141749B1 (en) | APP program execution method and device | |
CN114461227B (en) | Method and device for running software and machine-readable storage medium | |
CN107124446A (en) | Application program method for down loading, server and terminal | |
CN108460276B (en) | Processing method and device for SO file of dynamic link library of android installation package | |
CN110333993A (en) | Generation method, device, electronic equipment and the storage medium of memory image | |
CN111198690A (en) | Modification method and device for installation package | |
CN113157274B (en) | Software development method and device based on micro front end, electronic equipment and storage medium |
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 |