System optimization (i) MAVEN packages have different versions of the same jar: Version + timestamp (solution idea)

Source: Internet
Author: User

Workaround: There are many identical jars in the ear of the MAVEN repository (only different: Version + timestamp)

description of the problem: there are many identical jars in the ear, just contain different: Version + timestamp as shown:

(Example: Itoo-basic-api has a lot of the same jar, just contains different: Version + timestamp)

Solution Ideas

Test with the Itoo-authority-usergroup-ear module for permissions

1. Suspicion is: Maven coordinates, timestamp issue

Key words:

Maven Snapshot

There are many different versions of the same jar in the Maven war

Maven local repositories have many different versions of the same jar

Maven has been updated with many versions of the jar from the Nexus

....

2. The suspicion is: Nexus issues

The version of the ear on the nexus is suspected to be not up to date.

Therefore, in Eclipse's ear pom.xml, right-click Run as---Maven build----input "deploy" to the nexus.

Build (omit) on the jinkens.

later: Does the jar in D:\itoo-maven-3.2.3\repository\com\tgb\***\0.0.1-snapshot contain many of the same jars, just a different: version + timestamp?

(Answer: A lot of the same jar, just contain different: Version + timestamp)

3. Suspect: Configuration issues in Jinkens

4. Suspect: Maven Local warehouse problem

First, delete the Tgb folder in the local Maven repository.

After delete: Jenkins9 in tmp_authority in the Itoo-authority-usergroup-ear.ear


Build (omit) on the jinkens.

Post-view: D:\itoo-maven-3.2.3\repository\com\tgb\***\0.0.1-snapshot: Many of the same jars, just contain different: version + timestamp?

(Answer: Yes.) There are many identical jars in the ear, just a different: Version + timestamp)

5. Suspect: The jar pack dependency conflict problem in Maven

(refer to this figure)

Exclude jar Package Conflicts first

After submitting the SVN code

Build (omit) on the jinkens.

After viewing: Does the jar in D:\itoo-maven-3.2.3\repository\com\tgb\***\0.0.1-snapshot contain: Many of the same jars, just contain different: version + timestamp?


(Answer: Yes.) Ear: Many of the same jars, just contain different: Version + timestamp)

6. Suspect: The problem with the MAVEN plugin configuration in the ear's pom file

A) first add the code in the Pom.xml of the ear

b) After submitting the SVN code

c) There are two ways of building this:

I. First type: In the ear directory, cmd command, enter: mvn clean install.

1. After viewing: Does the jar in D:\itoo-maven-3.2.3\repository\com\tgb\***\0.0.1-snapshot contain: Many of the same jars, just contain different: version + timestamp?

2.

3. (Answer: There is only one function jar!) And no: Version + timestamp)


ii. Second Type: Re-constructed by Jinkens (omitted).

1. After viewing: Does the jar in D:\itoo-maven-3.2.3\repository\com\tgb\***\0.0.1-snapshot contain: Many of the same jars, just contain different: version + timestamp?

2.

3. (Answer: The number of jar packages is reduced but still contains: Version + timestamp)

4. Almost all jars are two parts: one is ***-0.0.1-snapshot.jar and ***-0.0.1-20150602.091811-14.jar

5. Guess: This configuration is effective, but may be affected by the ear of the upper level!

6. Test Itoo-tool (see below)

Final Scenario: Modify the Maven plugin configuration in Pom.xml in Itoo-root

1) Download itoo-root from SVN with eclipse

2) After the Pom.xml file in the Itoo-root to do two changes:

A) Step one: Delete the original configuration about the Maven plugin

b

c) Step Two: Add the configuration of the new MAVEN plugin

D

3) After the modified Pom.xml file is submitted to SVN

4) in Itoo-root Pom.xml, right-click RunAs---enter "deploy" in Maven build.

5) After the itoo-root of the Itoo module in Jinkens, right-click to automatically build

6)

7) Build after: Core--web--ear

8)

9) After the Jinkens server, check the jar in the Itoo-authority-usergroup-ear

10)

11)

12) perfect!  


Summary

In the final analysis, it is because of MAVEN's plugin configuration problem.

Many times, the use of tools is limited to preliminary use. This time in the optimization period, the harvest is quite a lot!


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

System optimization (i) MAVEN packages have different versions of the same jar: Version + timestamp (solution idea)

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.