Maven multi-configuration Summary

Source: Internet
Author: User

1. Set a parent project. The role of the parent project should be as follows:

1. Manage the version of the jar package in a unified manner. In this way, many sub-projects only need to specify the dependent jar without specifying the version of the dependent jar.

(1) Specify the version constant in the <Properties> label, for example

<Properties>

<Spring. webflow. version> 2.3.2.release </spring. webflow. Version

</Properties>

(2) reference a constant provided by Maven, such as a project. version, reference method $ {project. version}. This method is used to define dependencies between sub-projects in a multi-project environment.

(3) The <dependencymanagement> label on the parent project provides an optional dependency library for the sub-project. The sub-project does not need to specify the version when using the jar.

(4) specify some necessary jar files through the <dependencies> strong behavior sub-project on the parent project

(5) When a sub-project inherits the parent project, no version is required. In this way, the project inherits the version of the Parent Project. In this way, combined with the above (2) settings, the parent project can upgrade the entire sub-project version by upgrading its own version without affecting dependencies between sub-projects.

2. use the <modules> label in the configuration of the Parent Project to aggregate and manage each sub-project. For example, to package the project, you only need to perform an MVN install operation on the parent project, the MVN install command is automatically executed for all the sub-projects specified on the <modules> tab.

2. Use private servers. For example, install nexus, but note that if the access to private servers is not limited to Lan, you need to set up to block access from anonymous users. After using the private server, different developers only need to access the projects they want to develop under the version server, and other projects can be obtained through Maven access to the private server.

III. various Maven plug-ins are used for specific project management, which is also a Maven feature. The Maven architecture is a microkernel architecture, and various functions are mainly implemented by plug-ins, to make good use of Maven, you must master the use of some commonly used plug-ins.

 

Maven multi-configuration Summary

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.