Gradually unify the project prototype/Skeleton Generation Tool-Maven Archetype

Source: Internet
Author: User

Many of them are functional project prototype/Skeleton Generation tools, but in the end, Maven archetypes with simple functions gradually have a unified hope.

Without it, you can easily clean up yourself and use it as an "official" younger brother of Maven, and then there are some other Jianghu bosses (appfuse, strust2, cxf) the example is the top-level tips.

Like many generation tools, Maven archetypes replaces variables from the velocity template and extends the directory structure of java files based on the package name.

Advanced usage describes a full Maven archetype cycle:

  1. MVN archetype: Create-from-project generates an archetype template from an existing project to target/generated-sources/archetype.
    This still requires the program to be a little clever. Find the package name and variable, convert the variable into a symbol, and shrink the directory structure.
  2. Go to the directory and install the archetype template in MVN install to the local Maven repository.
  3. In the new directory, MVN archetype: generate-darchetypecatalog = Local, interactive input project name, package name, and other variables are used to generate a project.

Here, the 2.0 alpha3 version is much better than the original 1.0 alpha7 version. First, there are commands for crawling out templates from existing projects, and second, there is interactive input when generating projects, third, improvement of control files (support for ant syntax batch definition ).

For the new control file, see META-INF/Maven/archetype-metadata.xml. The original version 1.0 file has been voided.

The control file can add its own variables to control whether the directory needs to replace the variables with velocity, and whether to extend the directory tree according to the package name.

For details, see how metadata on an archetype is stored in the FAQ?

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.