使用maven过程中如果熟悉配置中各个标签的含义,能更好的应用maven.今天我们分享一下每个标签的含义:
1、文件存放位置
win环境 全局配置: ${M2_HOME}/conf/settings.xml
Linux和Mac环境 用户配置: ${user.home}/.m2/settings.xml
2、声明规范
3、localRepository
usr/local/maven
4、interactiveMode
true
5、offline
false
6、pluginGroups
org.codehaus.mojo
7、proxies
myproxy
true
http
proxy.somewhere.com
8080
proxyuser
somepassword
*.google.com|ibiblio.org
8、servers
server001
my_login
my_password
${usr.home}/.ssh/id_dsa
some_passphrase
664
775
或者策略这样写:参数含义都是一样的
deploymentRepo
repouser
repopwd
planetmirror.com
PlanetMirror Australia
http://downloads.planetmirror.com/pub/maven2
central
10、profiles
setting.xml文件中的profile是pom.xml中的profile的其中一部分,有以下部分组成:
(1)、Activation
false
1.5
Windows XP
Windows
x86
5.1.2600
mavenVersion
2.0.3
${basedir}/file2.properties
${basedir}/file1.properties
(2)、Properties
${user.home}/our-project
note:如果该profile被激活,则可以再POM中使用${user.install}。
(3)、Repositories
codehausSnapshots
Codehaus Snapshots
false
always
warn
http://snapshots.maven.codehaus.org/maven2
default
(4)、pluginRepositories
插件仓库, Maven plugins是一种特殊的依赖项,与普通的jar包依赖仓库分开定义,结构与repositories类似。
11、activeProfiles
env-test
12、到此常有标签分享完毕,多使用、都测试,定会熟练掌握。
关于加载顺序可参考:https://www.cnblogs.com/ctxsdhy/p/8482725.html