查看“Maven中settings.xml与pom配置冲突”的源代码
←
Maven中settings.xml与pom配置冲突
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看和复制此页面的源代码。
settings.xml 中的配置文件元素是 pom.xml 配置文件元素的截断版本。 它由 activation、repositories、pluginRepositories 和 properties 元素组成。 配置文件元素仅包括这四个元素,因为它们关注整个构建系统(这是 settings.xml 文件的作用),而不是单个项目对象模型设置。 如果配置文件在设置中处于活动状态,则其值将覆盖 POM 或 profiles.xml 文件中任何等效 ID 的配置文件。 https://maven.apache.org/settings.html#Profiles 比如: settings.xml<syntaxhighlight lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd"> …… <profiles> <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile> </profiles> …… </syntaxhighlight>就会覆盖项目中pom.xml的相关配置:<syntaxhighlight lang="xml"> …… <properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> </properties> …… </syntaxhighlight>
返回至
Maven中settings.xml与pom配置冲突
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
Spring Boot 2 零基础入门
Spring Cloud
Spring Boot
设计模式之禅
VUE
Vuex
Maven
算法
技能树
Wireshark
IntelliJ IDEA
ElasticSearch
VirtualBox
软考
正则表达式
程序员精讲
软件设计师精讲
初级程序员 历年真题
C
SQL
Java
FFmpeg
Redis
Kafka
MySQL
Spring
Docker
JMeter
Apache
Linux
Windows
Git
ZooKeeper
设计模式
Python
MyBatis
软件
数学
PHP
IntelliJ IDEA
CS基础知识
网络
项目
未分类
MediaWiki
镜像
问题
健身
国债
英语
烹饪
常见术语
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息