System Optimization (1) different versions of the same jar package in Maven: version + timestamp (solution)

Source: Internet
Author: User

System Optimization (1) different versions of the same jar package in Maven: version + timestamp (solution)

Solution: the ear of the maven repository contains many identical jar files (only including different versions and timestamps)

Problem description: The ear contains many identical jar files, but contains different versions and timestamps, as shown in:

(For example, the itoo-basic-api has many identical jar files, but contains different versions and timestamps)

 

Solution

Test the permission using the itoo-authority-usergroup-ear module.

 

1. Suspected: maven coordinates and timestamps

Keywords:

Maven snapshot

Maven war has many different versions of the same jar.

Maven local repository the same jar has many different versions

Maven has updated many versions of jar from nexus.

....

 

2. Suspected nexus Problems

We suspect that the ear version on nexus is not the latest.

Therefore, in the pom. xml file of the eclipse ear, right-click Run As --- Maven build ---- and enter "deploy" to the nexus.

Later built on Jinkens (omitted ).

Check whether the jar in D: \ itoo-maven-3.2.3 \ repository \ com \ tgb \ *** \ 0.0.1-SNAPSHOT contains many identical jar, but contains different: version + timestamp?

(Answer: many identical jar files only contain different versions and timestamps)

 

3. The suspect is: configuration problems in Jinkens

 

 

4. Suspected maven local repository Problems

First, delete the tgb folder in the local maven repository.

 

Delete: itoo-authority-usergroup-ear.ear in tmp_authority in jenkins9


 

Later built on Jinkens (omitted ).

After viewing: D: \ itoo-maven-3.2.3 \ repository \ com \ tgb \ *** \ 0.0.1-SNAPSHOT whether there are: many identical jar, but contain different: version + timestamp?

(Answer: Yes. There are many identical jar files in the Ear, but they only contain different versions and timestamps)

5. Suspected: jar package dependency conflicts in maven

(Refer to this figure)

 

First, exclude jar package conflicts.

Then submit the SVN code

Later built on Jinkens (omitted ).

View: D: \ itoo-maven-3.2.3 \ repository \ com \ tgb \ *** \ 0.0.1-SNAPSHOT in the jar contains: many identical jar, but contains different: version + timestamp?

 

(Answer: Yes. There are many identical jar files in the Ear, but they only contain different versions and timestamps)

6. I suspect that the maven plug-in configuration in the pom file of the ear is incorrect.

A) First, add the code in the pom. xml file of the ear.

B) Submit the SVN code.

C) There are two ways to build the SDK:

I. First, enter mvn clean install in the cmd command under the ear directory.

1. view: D: \ itoo-maven-3.2.3 \ repository \ com \ tgb \ *** \ 0.0.1-SNAPSHOT in the jar contains: many identical jar, but contains different: version + timestamp?

2.

3. (answer: there is only one jar for a function! No: version + timestamp)

 

Ii. Second: rebuild (Omitted) through Jinkens ).

1. view: D: \ itoo-maven-3.2.3 \ repository \ com \ tgb \ *** \ 0.0.1-SNAPSHOT in the jar contains: many identical jar, but contains different: version + timestamp?

2.

3. (answer: Reduce the number of jar packages, but still contain: version + timestamp)

4. Almost all jar files are in two copies: ***-0.0.1-SNAPSHOT. jar and ***-0.0.1-20150602.091811-14.jar.

5. I guess this configuration is effective, but it may be affected by the upper level of the ear!

6. Test itoo-tool (see below)

Final Solution: Modify the maven plug-in configuration in pom. xml in itoo-root

1) Use eclipse to download itoo-root from SVN

2) modify the pom. xml file in itoo-root in two ways:

A) Step 1: Delete the original configuration of the maven plug-in.

B)

C) Step 2: add the configuration of the new maven plug-in

D)

3) Submit the modified pom. xml file to SVN.

4) Right-click the pom. xml file in itoo-root and enter "deploy" in RunAs --- Maven build.

5) Right-click the itoo-root of the itoo module in Jinkens to automatically build

6)

7) then build: core -- web -- ear

8)

9) then, on the Jinkens server, check the jar in itoo-authority-usergroup-ear.

10)

11)

12) Perfect!

Summary

In the final analysis, it is still because of maven plug-in configuration problems.

In many cases, the use of tools is limited to preliminary use. During the optimization period, there are still a lot of gains!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.