maven

Background

There are three built-in build lifecycles: default, clean and site. a build lifecycles is made up of phases. clean lifecycle's phases: pre-clean clean post-clean. default lifecycle's phases: validate initialize generate-sources process-sources generate-resources process-resources compile process-classes generate-test-sources process-test-sources generate-test-resources process-test-resources test-compile process-test-classes test prepare-package package pre-integration-test integration-test post-integration-test verify install deploy. site lifecycle's phases: pre-site site post-site site-deploy. a build phase is made up of plugin goals. Each <packaging> contains a list of goals to bind to a particular phase. you can use <executions> tag to configure a mojo. (override default configuration).

Example

archiva-parent/archiva/archiva-modules/archiva-base/archiva-configuration/pom.xml

<plugin>
        <groupId>org.codehaus.modello</groupId>
        <artifactId>modello-maven-plugin</artifactId><!--Modello is a framework for code generation from a simple model-->
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
          <execution>
            <id>archiva-registry-reader</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorId>registry-reader</generatorId>
            </configuration>
          </execution>
          <execution>
            <id>archiva-registry-writer</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generatorId>registry-writer</generatorId>
            </configuration>
          </execution>
          <execution>
            <id>site-docs</id>
            <phase>pre-site</phase>
            <goals>
              <goal>xdoc</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <version>1.4.1</version>
          <models>
            <model>src/main/mdo/configuration.mdo</model>
          </models>
        </configuration>
      </plugin>

run generate-sources,

[INFO] --- modello-maven-plugin:1.7:java (default) @ archiva-configuration ---
[INFO] outputDirectory: C:\Users\l1s0n\Downloads\apache-archiva-2.2.1-src\archiva-modules\archiva-base\archiva-configuration\target\generated-sources\modello
[INFO] Working on model: src/main/mdo/configuration.mdo
[INFO] Generating current version: 1.4.1
[INFO] 
[INFO] --- modello-maven-plugin:1.7:generate (archiva-registry-reader) @ archiva-configuration ---
[INFO] [modello:generate {generator: registry-reader}]
[INFO] outputDirectory: C:\Users\l1s0n\Downloads\apache-archiva-2.2.1-src\archiva-modules\archiva-base\archiva-configuration\target\generated-sources\modello
[INFO] Working on model: src/main/mdo/configuration.mdo
[INFO] Generating current version: 1.4.1
[INFO] 
[INFO] --- modello-maven-plugin:1.7:generate (archiva-registry-writer) @ archiva-configuration ---
[INFO] [modello:generate {generator: registry-writer}]
[INFO] outputDirectory: C:\Users\l1s0n\Downloads\apache-archiva-2.2.1-src\archiva-modules\archiva-base\archiva-configuration\target\generated-sources\modello
[INFO] Working on model: src/main/mdo/configuration.mdo
[INFO] Generating current version: 1.4.1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值