Maven 知识点总结

Q1: What’s maven?
Maven is one project management system which is actually a plugin execution framework where every task is done by its’ plugins

Q2: How many standard life circles does maven usually have?
Maven has 3 standard life circles:

  1. clean
  2. default(or build)
  3. site

Q3: Based Q2, for each life circle, what phases does it have?
each life circle has several phases.
1.clean lifecycle
It has three phases: pre-clean, clean and post-clean
2. default (or build) lifecycle
It has 21 phases which are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy
3. site lifecycle
It has four phases: pre-site, site, post-site, site-deploy

Q4: which command can be used to see dependency tree?
mvn dependency:tree

Q5:What are dependencyManagement和pluginManagement used for?
dependencyManagement is used for managing dependencies across parent and its’ children especially for managing version across parent and its’ children
pluginManagement is used for defining build information across parent and its’ children

Q6. What is the difference between dependencyManagement and dependencies?
dependencyManagement focuses on lowering the conflicts caused by using different version/scope for a specific jar across parent and its’ children. In other words, child will apply version/scope declared in its’ parent’s POM only if the child doesn’t specify the version/scope. And dependencyManagement is just a declaration which means child doesn’t download a dependency if it is not declared in children’s POM.
dependencies focuses on addressing 3-party dependencies.
all of dependencies delared in parent wil be definitly downloaded

Q7. How to check the goal for a plugin?
mvn help:describe -Dplugin=groupId:artifactId

Q8. what types does maven repository have? what’s the search order?
local, central, remote( developer’s own custom repository )
search order: local -> central -> remote

Q9. What’s maven profile used for?
It is used to define a set of configuration values which can be used to set/overwrite default values in maven build

Q10. How to check super POM:
mvn help:effective-pom

Q11. what are the scope for a dependency?
compile、provided、runtime、system、test、import

Q12. How to deal with external dependency?
< scope >system</ scope >
< systemPath>xxx</ systemPath>
xxx is the dir where we put the external jars

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值