Maven的settings.xml文件结构详解
来源:互联网 发布:人工智能试题及答案 编辑:程序博客网 时间:2024/05/21 22:33
安装Maven后(可以只是解压缩下载的Maven发布包),在Maven安装目录下的conf/目录下有一个settings.xml文件。该文件事实上只是一个空模板,其中没有任何有效的设置。打开该文件,可以看到其引用的XML Schema如下:
http://maven.apache.org/xsd/settings-1.1.0.xsd
该文件的结构如下:
- <?xml version=“1.0” encoding=“UTF-8”?>
- <settings xsi:schemaLocation=“http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd” xmlns=“http://maven.apache.org/SETTINGS/1.1.0” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
- <localRepository/>
- <interactiveMode/>
- <usePluginRegistry/>
- <offline/>
- <servers/>
- <mirrors/>
- <proxies/>
- <profiles/>
- <activeProfiles/>
- <pluginGroups/>
- </settings>
<?xml version="1.0" encoding="UTF-8"?> <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <localRepository/> <interactiveMode/> <usePluginRegistry/> <offline/> <servers/> <mirrors/> <proxies/> <profiles/> <activeProfiles/> <pluginGroups/> </settings>说明:
1.localRepository,给出本地库的路径,默认值为${user.home}/.m2/repository。该路径在build服务器上非常重要,项目构建过程中可以直接引用本地库中的通用类库。
2. interactiveMode,Maven执行过程中是否需要接受用户输入,默认值为true。
3. usePluginRegistry,是否使用plugin-registry.xml文件管理Maven插件的版本,默认为false。该文件为用户提供了选择,即使用指定版本的Maven插件,而非最新版本的Maven插件。该文件是从Maven 2开始出现的,但是事实上更常用的是在POM中配置Maven插件的版本等参数,所以usePluginRegistry参数往往为false。另外,与settings.xml文件类似,plugin-registry.xml文件也有全局和用户之分。
4. offline,是否支持离线构建系统,默认值为false。如果build服务器由于网络或者安全等原因不能连接远程库,则该参数设置为true。
5. pluginGroups,给出Maven插件所在的groupId,一个可能的groupId使用一个<pluginGroup>给出。该参数只是为了简化执行Maven时的参数,如为了执行如下命令:
- mvn org.mortbay.jetty:jetty-maven-plugin:run
mvn org.mortbay.jetty:jetty-maven-plugin:run
如果在settings.xml文件中配置了如下<pluginGroup>:
- <pluginGroups>
- <pluginGroup>org.mortbay.jetty</pluginGroup>
- </pluginGroups>
<pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups>
则可以直接执行如下命令:
- mvn jetty:run
mvn jetty:run
6. servers,给出用以下载或部署类库的服务器信息,详见后续文章。
7. mirrors,给出指定类库的镜像服务器信息,详见后续文章。
8. proxies,给出代理服务器信息,详见后续文章。
9. profiles,给出可用的profile,这里的profile类似于POM中的profile,但是只包含activation, repositories, pluginRepositories和properties等与project无关的信息,详见后续文章。
10. activeProfiles,默认采用的profile,可以有多个profile。
- Maven的settings.xml文件结构详解
- Maven的settings.xml文件结构详解
- Maven的settings.xml文件结构之servers
- Maven的settings.xml文件结构之mirrors
- Maven的settings.xml文件结构之proxies
- Maven的settings.xml文件结构之profiles
- Maven的settings.xml文件结构之activeProfiles
- Maven的settings.xml文件结构之mirrors
- Maven的settings.xml文件结构之servers
- Maven的settings.xml文件结构之mirrors
- Maven的settings.xml文件结构之proxies
- Maven的settings.xml文件结构之activeProfiles
- Maven的pom.xml文件详解------Build Settings
- Maven的pom.xml文件详解------Environment Settings
- Maven的pom.xml文件详解------Build Settings
- Maven的pom.xml文件详解------Environment Settings
- Maven的pom.xml文件详解------Build Settings
- Maven的pom.xml文件详解------Build Settings
- 将python或R生成的模型存为PMML供java调用
- Filter的简介
- 推荐系统
- 初学Epicor二次开发地址
- Redis Cluster集群安装配置详解
- Maven的settings.xml文件结构详解
- barrier()函数
- Oracle中删除正在连接的用户
- set集合入门学习
- 利用SqlBulkCopy快速大批量导入数…
- oracle
- Ubuntu Server下设置CUPS打印服务
- 定义SQL查询结果中小数精度
- SQLite管理工具推荐