Maven related

Maven
1.
Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made.

  1. find the dependency
    First, we need to know what the groupId, artifactId, and version are for log4j. We can browse ibiblio and look for it, or use Google to help by searching for “site:www.ibiblio.org maven2 log4j”. The search shows a directory called /maven2/log4j/log4j (or /pub/packages/maven2/log4j/log4j). In that directory is a file called maven-metadata.xml.

  2. lifecycle and phase( goal )
    list the goal which attached the related phase
    $ mvn help:describe -Dcmd=clean
    [INFO] ‘clean’ is a lifecycle with the following phases:

    • pre-clean: Not defined
    • clean: org.apache.maven.plugins:maven-clean-plugin:2.5:clean
    • post-clean: Not defined

$ mvn help:describe -Dcmd=deploy
[INFO] ‘deploy’ is a phase corresponding to this plugin:
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy

It is a part of the lifecycle for the POM packaging ‘jar’. This lifecycle includes the following phases:
* validate: Not defined
* initialize: Not defined
* generate-sources: Not defined
* process-sources: Not defined
* generate-resources: Not defined
* process-resources: org.apache.maven.plugins:maven-resources-plugin:2.6:resources
* compile: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
* process-classes: Not defined
* generate-test-sources: Not defined
* process-test-sources: Not defined
* generate-test-resources: Not defined
* process-test-resources: org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
* test-compile: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
* process-test-classes: Not defined
* test: org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
* prepare-package: Not defined
* package: org.apache.maven.plugins:maven-jar-plugin:2.4:jar
* pre-integration-test: Not defined
* integration-test: Not defined
* post-integration-test: Not defined
* verify: Not defined
* install: org.apache.maven.plugins:maven-install-plugin:2.4:install
* deploy: org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy

http://www.codetab.org/apache-maven-tutorial/maven-lifecycle-and-goals/#


  1. Easiest way to know the available parameters for a goal is to run plugin help goal.

$ mvn compiler:help -Dgoal=compile -Ddetail

It will list the available parameters for compile goal of compiler.
But it will not show the default value of the parameters and to know the available parameters and also, the default value for each parameter, run help:describe goal of Maven Help plugin (maven-help-plugin).

$ mvn help:describe -Dplugin=compiler -Dmojo=compile -Ddetail

Note that maven-help-plugins uses -Dmojo for goal, instead of -Dgoal,

  1. maven plugins
    http://maven.apache.org/plugins/index.html

  2. config plugins
    https://maven.apache.org/guides/mini/guide-configuring-plugins.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值