一次解决idea maven settings.xml文件不生效

  一直使用eclipse,在eclipse中可以手动指定global和user settings,并且settings的文件名称可以不是settings.xml,只要内容符合maven规范就行。如下:

  然而今天遇到个问题的背景是:我有个jar包需要发布到中央库,而在eclipse中需要切换settings配置,稍显麻烦,我就把需要传到中央库的这个应用导入到idea里面来,使用idea上传,配置了idea的maven路径,settings(我上传到中央库的名字是settings-org.xml)之后,始终不生效,各种查原因都无解,最后发现maven有个helper插件,执行这个命令:mvn help:effective-settings可以查看settings内容,于是我执行了一下,发现settings文件内容不是我指定的settings-org.xml而是settings.xml这个文件的内容,之后又执行:mvn install -X查看debug信息,发现:

这就意味着,idea的手动指定settings文件路径是没有效果的,他是根据名称来认定的,之后又把settings-org.xml名称改成settings.xml,于是就ok了。

可是:再执行mvn help:effective-settings输出的日志依然是之前的settings.xml文件的内容,但是使用又是新的settings内容。这里还没太搞明白。

结论:idea的手动指定settings文件似乎没有效果(当settings文件名称不叫settings.xml的时候)

原文地址:https://www.cnblogs.com/dreamroute/p/10903738.html

时间: 2024-07-30 04:28:16

一次解决idea maven settings.xml文件不生效的相关文章

[Maven]Settings.xml文件详解

概要 settings.xml有什么用? 如果在Eclipse中使用过Maven插件,想必会有这个经验:配置settings.xml文件的路径. l  settings.xml文件是干什么的,为什么要配置它呢? 从settings.xml的文件名就可以看出,它是用来设置Maven参数的配置文件.并且,settings.xml是Maven的全局配置文件.而pom.xml文件是所在项目的局部配置. Settings.xml中包含类似本地仓储位置.修改远程仓储服务器.认证信息等配置. settings

maven settings.xml 文件

指定jdk 的版本: <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入门2-pom.xml文件与settings.xml文件

Maven入门2-pom.xml文件与settings.xml文件 本文内容来源于官网文档部分章节,settings.xml文件:参考http://maven.apache.org/settings.html,pom.xml文件参考:http://maven.apache.org/guides/introduction/introduction-to-the-pom.html. http://maven.apache.org/pom.html:一个是POM的简单介绍,一个是详细介绍. 下面针对几

默认的Settings.xml文件(无修改过)-Maven

此为maven首次安装后的默认Settings.xml文件. 当什么都不作修改时,默认是从Maven中央仓库进行下载,http://repo1.maven.org/maven2/ <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agree

maven设置------settings.xml文件学习

https://blog.csdn.net/tomato__/article/details/13025187 快速预览 maven的配置文件为settings.xml,在下面路径中可以找到这个文件,分别为:    ------ $M2_HOME/conf/settings.xml:全局设置,在maven的安装目录下:    ------ ${user.home}/.m2/settings.xml:用户设置,需要用户手动添加,可以将安装目录下的settings.xml文件拷贝过来修改.    两

史上最全的maven pom.xml文件教程详解

<project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd >; <!-- 父项目的坐标.如果项目中没有规定某个元素的值,那么父项目中的对应值即为项目的默认值.

Maven pom.xml文件详细教程

--------------------------------------------------------------- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http

maven pom.xml文件教程详解

[xml] view plain copy print? <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xs

maven pom.xml 文件详解

参考资料: http://blog.csdn.net/uohzoaix/article/details/7035307 http://www.cnblogs.com/qq78292959/p/3711501.html skeleton <project> <modelVersion>4.0.0</modelVersion> <groupId>...</groupId> <artifactId>...</artifactId>