IntelliJ IDEA的maven配置

news2024/11/15 4:57:39

前言

在 IntelliJ IDEA 中,Maven 的默认配置文件是 settings.xml,它通常位于以下路径:

配置文件位置

  1. 全局配置文件

    • Windows: %USER_HOME%\.m2\settings.xml
    • macOS/Linux: ~/.m2/settings.xml

    这个文件是 Maven 的全局配置文件。如果你没有修改过,这个文件可能不存在,你可以手动创建一个。

  2. IDEA内置的Maven配置

    • 如果你在 IntelliJ IDEA 中设置了 Maven 的本地仓库或其他配置,IDEA 会使用其自带的 Maven 配置,这个配置文件位于 IDEA 的配置目录中:
      • Windows: %IDEA_HOME%\plugins\maven\lib\maven3\conf\settings.xml
      • macOS: /Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/conf/settings.xml
      • Linux: ~/.local/share/JetBrains/IntelliJIdea<VERSION>/plugins/maven/lib/maven3/conf/settings.xml

    <VERSION> 代表你使用的 IntelliJ IDEA 版本号。

你可以通过 File > Settings > Build, Execution, Deployment > Build Tools > Maven 来查看和配置 IDEA 中的 Maven 设置,包括选择自定义的 settings.xml 文件路径。

说明

不管配置文件"settings.xml"在哪里,只要IDEA配置对就好

image-20240823212541193

完整maven配置文件内容

可以直接复制为“settings.xml”文件内容使用

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<!--
 | This is the configuration file for Maven. It can be specified at two levels:
 |
 |  1. User Level. This settings.xml file provides configuration for a single user,
 |                 and is normally provided in ${user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.conf}/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->
<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 https://maven.apache.org/xsd/settings-1.2.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->

  <!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->

  <!-- offline
   | Determines whether maven should attempt to connect to the network when executing a build.
   | This will have an effect on artifact downloads, artifact deployment, and others.
   |
   | Default: false
  <offline>false</offline>
  -->

  <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
  </pluginGroups>

  <!-- TODO Since when can proxies be selected as depicted? -->
  <!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>

  <!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
  </servers>

  <!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
	 <mirror>
		<id>alimaven</id>
		<mirrorOf>central</mirrorOf>
		<name>aliyun maven</name>
		<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
	</mirror>
  </mirrors>

  <!-- profiles
   | This is a list of profiles which can be activated in a variety of ways, and which can modify
   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
   | specific paths and repository locations which allow the build to work in the local environment.
   |
   | For example, if you have an integration testing plugin - like cactus - that needs to know where
   | your Tomcat instance is installed, you can provide a variable here such that the variable is
   | dereferenced during the build process to configure the cactus plugin.
   |
   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
   | section of this document (settings.xml) - will be discussed later. Another way essentially
   | relies on the detection of a property, either matching a particular value for the property,
   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
   | Finally, the list of active profiles can be specified directly from the command line.
   |
   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
   |       repositories, plugin repositories, and free-form properties to be used as configuration
   |       variables for plugins in the POM.
   |
   |-->
  <profiles>
    <!-- profile
     | Specifies a set of introductions to the build process, to be activated using one or more of the
     | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
     | or the command line, profiles have to have an ID that is unique.
     |
     | An encouraged best practice for profile identification is to use a consistent naming convention
     | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
     | This will make it more intuitive to understand what the set of introduced profiles is attempting
     | to accomplish, particularly when you only have a list of profile id's for debug.
     |
     | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
    <profile>
      <id>jdk-1.4</id>

      <activation>
        <jdk>1.4</jdk>
      </activation>

      <repositories>
        <repository>
          <id>jdk14</id>
          <name>Repository for JDK 1.4 builds</name>
          <url>http://www.myhost.com/maven/jdk14</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>
    -->

    <!--
     | Here is another profile, activated by the property 'target-env' with a value of 'dev', which
     | provides a specific path to the Tomcat instance. To use this, your plugin configuration might
     | hypothetically look like:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile>
      <id>env-dev</id>

      <activation>
        <property>
          <name>target-env</name>
          <value>dev</value>
        </property>
      </activation>

      <properties>
        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
      </properties>
    </profile>
    -->
  </profiles>

  <!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
  -->
</settings>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2068001.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

闲鱼IP属地地址:去外地会自动变化吗?解析实时更新机制

在数字化时代&#xff0c;网络交易平台如闲鱼已成为我们日常生活中不可或缺的一部分。在进行二手交易时&#xff0c;了解对方的地理位置信息成为许多买家和卖家的关切点。那么&#xff0c;去外地闲鱼IP会变吗&#xff1f;闲鱼IP属地地址是实时更新吗&#xff1f;本文将深入探讨…

C#开发基础之I/O 异步和多线程异步:本质上的区别与使用场景

前言 在桌面软件开发中&#xff0c;异步编程是一种至关重要的技巧&#xff0c;尤其是在需要提高应用程序响应性和并发处理能力时。常见的异步编程模式主要包括 I/O 异步和多线程异步&#xff0c;这两者虽然都实现了非阻塞操作&#xff0c;但在本质上有着显著的区别。理解它们的…

USB分析仪USB3.2日志分析

1.简介 USB2.0总线采用轮询模式&#xff0c;即总线事务开始时&#xff0c;都要先发送IN或者OUT令牌包&#xff0c;以通知端点或者查询端点是否准备好。而USB3.2采用了异步通知模式&#xff0c;若端点没有准备好&#xff0c;则主机无需轮询&#xff0c;端点准备好后会通知主机&…

进程创建:fork函数

fork函数 在Linux系统中&#xff0c;fork函数是用于创建一个新的进程的函数。调用fork函数会创建一个新的进程。 fork函数的原型如下&#xff1a; #include <unistd.h>pid_t fork(void);fork函数没有参数&#xff0c;返回值是一个pid_t类型的值。在成功创建新的进程后…

Python酷库之旅-第三方库Pandas(094)

目录 一、用法精讲 401、pandas.Series.to_string方法 401-1、语法 401-2、参数 401-3、功能 401-4、返回值 401-5、说明 401-6、用法 401-6-1、数据准备 401-6-2、代码示例 401-6-3、结果输出 402、pandas.Series.to_clipboard方法 402-1、语法 402-2、参数 40…

【精选】基于python的影片数据爬取与数据分析

博主介绍&#xff1a; ✌我是阿龙&#xff0c;一名专注于Java技术领域的程序员&#xff0c;全网拥有10W粉丝。作为CSDN特邀作者、博客专家、新星计划导师&#xff0c;我在计算机毕业设计开发方面积累了丰富的经验。同时&#xff0c;我也是掘金、华为云、阿里云、InfoQ等平台…

推荐4款2024年PDF转图片的神器武器!

平时很多人都会经常遇到需要将 PDF 文件转换为图片的情况&#xff1b;不管是因为方便分享、展示内容&#xff0c;还是其他特殊需求&#xff0c;PDF 转图片工具都能起到很大的帮助。今天&#xff0c;就来跟大家分享4个特别好用的PDF转图片的工具。 1、365PDF转换软件 直通车&am…

live chart 仪表盘和饼图 示例

先上图&#xff1a; 下面是代码&#xff1a; <!--第一个卡片--><GroupBox Header"各生产线人数"><Grid><Grid.RowDefinitions><RowDefinition Height"45"/><RowDefinition/><RowDefinition Height"auto"…

RK3588编译CH343驱动

文章目录 1. 概述。2. ko编译3.环境构建3.1 集成ch343驱动3.2 修改内核配置3.3 编译内核模块3.4 部署安装 最近在RK3588的开发板上要接一个外部的小板&#xff0c;需要使用的ch343驱动&#xff0c;但是rk3588的板子上没有自带的ch343的驱动&#xff0c;就需要自己手动编译一个c…

Java基础学习篇:switch条件语句进阶(最详细版)

&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d;&#x1f51d; &#x1f947;博主昵称&#xff1a;小菜元 &#x1f35f;博客主页…

【KivyMD 应用程序 1.1.1】Icons在应用设计中的魅力

图标,这些小小的视觉元素,拥有不可思议的力量,能够跨越语言和文化的障碍,传达丰富的信息。在数字时代,图标的设计和应用已经成为界面设计不可或缺的一部分,而Material Design Icons则是这个领域的佼佼者。 Material Design Icons源自Google的Material Design语言,旨在创…

剑指offer 30. 包含min函数的栈

目录 原题链接 题目描述 解决方案 思路分析 核心思路 流程图解 操作细节 代码实现 Python 语言实现 C 语言实现 Java 语言实现 复杂度分析 总结 其他相似题目 原题链接 剑指offer_在线编程_牛客网 (nowcoder.com) 题目描述 定义一个栈的数据结构&#xff0c;并…

20240823给飞凌OK3588-C的核心板刷Ubuntu22.04并成功启动

20240823给飞凌OK3588-C的核心板刷Ubuntu22.04并成功启动 2024/8/23 20:37 给飞凌OK3588-C的核心板刷Ubuntu22.04&#xff0c;不管是预编译的&#xff0c;还是你自己直接编译的IMG固件。 放心&#xff0c;都会卡死在这里的&#xff01;^_ [BEGIN] 2024/8/23 20:10:55 DDR V1.12…

使用pyevtk导出结构化VTK网格以供后处理

pyevtk简介 在计算流体力学CFD中&#xff0c;通常需要处理三维网格数据&#xff0c;为了可视化&#xff0c;需要将其输出。本文介绍使用python的pyevtk库输出结构化网格&#xff0c;以供paraview进一步后处理。 代码 # ***************************************************…

LeetCode.209.长度最小的子数组

题目描述&#xff1a; 给定一个含有 n 个正整数的数组和一个正整数 target 。 找出该数组中满足其总和大于等于 target 的长度最小的 子数组 [numsl, numsl1, ..., numsr-1, numsr] &#xff0c;并返回其长度。如果不存在符合条件的子数组&#xff0c;返回 0 输入输出实例…

【问题记录】mysql报错 ,mysql2 和 mysql 5.

错误2 和 错误5 都是由于注册表有问题&#xff1a; 由于我之前安装过MySQL&#xff0c;导致之前的配置没有删除。 解决&#xff1a; 搜索打开注册表编辑器&#xff1a; 注册表中找到MySQL: 修改路径&#xff1a; "D:\develop\mysql-8.0.39-winx64\bin\mysqld&quo…

基于Prometheus的HPA自动伸缩

基于Prometheus的HPA自动伸缩 背景 Kubernetes集群规模大、动态变化快&#xff0c;而且容器化应用部署和服务治理机制的普及&#xff0c;传统的基础设施监控方式已经无法满足Kubernetes集群的监控需求 需要使用专门针对Kubernetes集群设计的监控工具来监控集群的状态和服务质量…

python脚本:输入基因名,通过爬虫的方式获取染色体上的location。

本团队提供生物医学领域专业的AI&#xff08;机器学习、深度学习&#xff09;技术支持服务。如果您有需求&#xff0c;请扫描文末二维码关注我们。 python脚本&#xff1a;输入基因名&#xff0c;通过爬虫的方式获取染色体上的location。 def get_gene_location(gene_symbol):…

HDR以及CIS各厂家HDR方案

一.序言 为拥有更高动态范围,研究同仁们想出各种办法和策略,硬件和软件上都在快速更新迭代。 今天我们走进HDR ,明白什么是HDR,以及各种各样的HDR方案。 二.什么是HDR 讲一堆描述不如直接看公式 从公式可知传感器的满阱容量与暂态噪声的比值决定DR, 也可以认为TN为传…

进阶-4.视图、存储过程、存储函数、触发器

视图、存储过程、存储函数、触发器 1.视图1.1 介绍1.2 语法1.3 视图的检查选项1.4 视图的更新1.5 视图作用1.6 案例 2.存储过程21. 介绍2.2 特点2.3 语法2.4 变量2.4.1 系统变量2.4.2用户自定义变量2.4.3 局部变量 2.5参数2.6条件语句2.6.1 if 语法2.6.2 case 2.7循环结构2.7.1…