Maven implements version management for dependent framework jar packages

Source: Internet
Author: User
1. Unified Version Management

To achieve unified management of the jar version, you must set the jar version, that is, <version> </version>. The configuration is as follows:

<dependencies>.................<dependency><groupId>org.apache.shiro</groupId><artifactId>shiro-all</artifactId><version>${org.apache.shiro.version}</version></dependency><dependency><groupId>org.hibernate</groupId><artifactId>hibernate</artifactId><version>${org.hibernate.version}</version></dependency><dependency><groupId>org.hibernate</groupId><artifactId>hibernate-core</artifactId><version>${org.hibernate.version}</version></dependency><dependency><groupId>org.hibernate</groupId><artifactId>hibernate-ehcache</artifactId><version>${org.hibernate.version}</version></dependency><dependency><groupId>org.hibernate</groupId><artifactId>hibernate-annotations</artifactId><version>3.4.0.GA</version></dependency><dependency><groupId>org.hibernate</groupId><artifactId>hibernate-c3p0</artifactId><version>${org.hibernate.version}</version></dependency><dependency><groupId>org.hibernate</groupId><artifactId>hibernate-entitymanager</artifactId><version>${org.hibernate.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-core</artifactId><version>${org.springframework.version}</version></dependency>........................</dependencies>

2. Set version attributes

1. <version> </version> is configured with $ {*. version} configuration, so the configuration does not find the specific version, so it must be in the Pom. use attributes in XML to define the exact values of these versions. The configuration is as follows:

<! -- Configure the variable version (hibernate, spring, Shiro) --> <Properties> <javax. servlet. version> 3.1.0 </javax. servlet. version> <Org. apache. shiro. version> 1.2.3 </org. apache. shiro. version> <Org. hibernate. version> 3.6.10.final </org. hibernate. version> <Org. springframework. version> 3.0.2.release </org. springframework. version> <developer. organization> <! [CDATA [scengine]> </developer. Organization> </Properties>

Note: The key must be consistent with the referenced key.


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.