1: Generate an archetype locally
Open the CMD window, navigate to the root directory of the project, and execute the command: mvn archetype:create-from-project will generate generated-sources in the target directory, then enter the generated-sources\archetype directory, and execute the command: mvn install . This generates an archetype locally.
2: Create a project from the local archetype
Open the CMD window and execute the command: mvn archetype:generate -DarchetypeCatalog=local , it will list all the local archetypes and select the serial number to create the corresponding project. Proceed as follows:
- Select the template corresponding to the serial number
- groupId such as com.project
- artifactId, like demo
- version, 如1.0.0-SNAPSHOT
- package, Nyo com.project.demo
3: Book in addition to the local archetype
Delete the corresponding byte segment in the archetype-catalog.xml file under the /.m2 directory, and delete the files under the corresponding groupId and artifactId in the local warehouse.