Custom multi-module maven bobbin (FIG lot)

1. Why do you want to generate your own maven scaffolding (maven skeleton)?

Question BACKGROUND: The company does not use a unified template works were done for each line of business to create a new project based on their previous projects. This approach, what harm?

1.1 Each business project depends maven jar and structure may be very inconsistent. If the project is spring boot, startup class not on the company's unified directory, it could lead frame package can not scan provided by the company. For example: the company agreed com.test business code are placed in the package, put a new project if a class will start com.test. Myproject directory is (to put a new layer, spring will not scan at com.test package)

1.2 re-build their own is also very time consuming and error. (Time off work as a programmer, must be high efficiency and high quality to complete the task)

So we must use a uniform template project , which is the goal of this article.

 

2, what to do --- "how to build our maven scaffolding it? (Carefully, step by step follow operation)

2.1 Selected own template project

Generate skeletons added 2.2 plugin

2.3 generate skeleton using maven command (Note: There is a hole. If you use maven window on the IDEA, need to pay attention, maven uses its own download the maven maven or IDEA )

2.4 adjust the contents of the skeleton inside (take some time to debug)

Here, keep in mind a few points, you can.

2.4.1 Dynamic file names need to __A-api __ (two pairs underscore)

2.4.2 content within dynamically replace documents, use $ {archetype}

groupId 2.4.3 user input, replaces $ {package} inside the package. For example: groupId is com.ving, the import com.ving ***.

archetypeId 2.4.4 user input, replaces $ {archetype} and $ {rootarchetype}

version 2.4.5 user input, replaces $ {version}

2.4.6 archetype-metadata.xml

Guess you like

Origin www.cnblogs.com/vingLiu/p/12153885.html