注:下载时如需要账号登陆,自行登录或注册后登录,然后下载
提取码:s6mg
Java系列8u311
Java_8u311_windows
注:有时候装完JDK后会跳出安装JRE的窗口,可以直接关闭或安装,JRE若自定义安装,则要将JRE安装到一个空目录下,不然会报错
系统间不同的配置方法:
重新配置Path, JAVA_HOME, CLASSPATH 的环境变量
(这三个环境,其中一个出错,都会产生上面的报错,不行就多复制粘贴几次)
变量设置参数如下:
变量名:JAVA_HOME
变量值:G:\code\path\java\ // 要根据自己的实际路径配置
变量名:CLASSPATH
变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; //记得前面有个"."
变量名:Path
变量值:%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
(注:在重新配置完这三个环境变量后,将前面窗口都点击确定,然后一定要等待10s左右后,再
重新打开dos窗口输入java, java -version, javac这三个命令,不然环境变量配置正确了,也可能报错)
(注: 在配置java环境时,我还遇到过一个比较少见的BUG。因为JDK中已经包含了JRE,在同时安装JDK和JRE时,配置环境变量时这两个JRE有可能会冲突,此时,将Path中有关JRE环境配置的删去,等待10s后去命令行验证即可。即:若在安装JDK时安装了JRE,则可以不在Path中配置JRE的环境变量,若冲突,则去掉JRE的环境变量)
已经设置完毕了jdk运行的环境,java、javac相关的命令已经是可用状态。
打开windows的命令行工具
打开Windows powerShell(管理员),切记是管理员权限的 Windows powerShell ,这一步很重要!
进入jdk安装目录
执行 :
cd "C:\Program Files\Java\jdk-17"
bin\jlink.exe --module-path jmods --add-modules java.desktop --output jre
有的小伙伴执行完:C:\Program Files\Java\jdk-17>bin\jlink.exe --module-path jmods --add-modules java.desktop --output jre
出现错误提示:错误: C:\Program Files\Java\jdk-17\jre
原因是:Windows powerShell 并没有使用管理员身份
打开。
Maven版本历史页:http://maven.apache.org/docs/history.html
Maven3的集合页:https://archive.apache.org/dist/maven/maven-3/
3.8.7版本
下载完成后,我们在某个盘(例如D盘)的根目录(随便什么目录都行,但要注意路径最好不要出现中文或者空格),新建一个名为maven的文件夹,然后把压缩包解压后的文件夹放在里面,我们还要新建一个maven本地仓库文件夹,名字随便但是一般叫做repository即可(代表仓库的意思)。以上文件夹绝对路径保持全是英文名,文件夹名称不要为中文
,例如E:\maven\repository。综上所述,目录结构可参考如下:
D:
├─maven
├─apache-maven-3.8.7
└─repository
这一步是配置maven中央仓库的位置,也就是要去哪里下载项目依赖的本地没有的jar包,我们需要改成阿里云的镜像,因为默认maven中央仓库的服务器在国外,下载依赖的速度会比较慢,改成阿里云镜像速度会很快。
首先在maven文件夹的conf目录下找到settings.xml,用vscode等编辑器打开,定位到159-165行左右(不同版本行数可能会有出入,以实际行数为准)
将红色框框的这一段代码:
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
替换为以下代码,保存即可,这里要注意❗标签有没有闭合,不要弄混mirrors和mirror标签
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
注:此段配置来源于阿里云官方指南 https://developer.aliyun.com/mvn/guide
修改后的代码:
本地仓库就是我们自己新建的一个文件夹,所有从中央仓库下载的jar包会放在这里面
在下方增加这段配置即可
<localRepository>D:\maven\repository</localRepository>
下载完成解压,改本地仓库和远程仓库即可
建议使用新阿里云仓库:
<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
这里分享一下个人的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.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.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>
-->
<localRepository>D:/Java/MavenRepository</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>
<!-- 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>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<!-- maven运营的中央仓库2 -->
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<!-- maven在UK架设的仓库(有时候速度会比官方2号仓库快) -->
<mirror>
<id>ui</id>
<name>Mirror from UK</name>
<url>http://uk.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- JBoss的仓库 -->
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<!-- maven运营的中央仓库1 -->
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>net-cn</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://maven.net.cn/content/groups/public/</url>
</mirror>
<mirror>
<id>aliyun-central</id>
<mirrorOf>*</mirrorOf>
<name>aliyun central</name>
<url>https://maven.aliyun.com/repository/central</url>
</mirror>
<mirror>
<id>aliyun-spring</id>
<mirrorOf>*</mirrorOf>
<name>aliyun spring</name>
<url>https://maven.aliyun.com/repository/spring</url>
</mirror>
<mirror>
<id>aliyun-spring-plugin</id>
<mirrorOf>*</mirrorOf>
<name>aliyun spring-plugin</name>
<url>https://maven.aliyun.com/repository/spring-plugin</url>
</mirror>
<mirror>
<id>aliyun-apache-snapshots</id>
<mirrorOf>*</mirrorOf>
<name>aliyun apache-snapshots</name>
<url>https://maven.aliyun.com/repository/apache-snapshots</url>
</mirror>
<mirror>
<id>aliyun-google</id>
<mirrorOf>*</mirrorOf>
<name>aliyun google</name>
<url>https://maven.aliyun.com/repository/google</url>
</mirror>
<mirror>
<id>aliyun-gradle-plugin</id>
<mirrorOf>*</mirrorOf>
<name>aliyun gradle-plugin</name>
<url>https://maven.aliyun.com/repository/gradle-plugin</url>
</mirror>
<mirror>
<id>aliyun-jcenter</id>
<mirrorOf>*</mirrorOf>
<name>aliyun jcenter</name>
<url>https://maven.aliyun.com/repository/jcenter</url>
</mirror>
<mirror>
<id>aliyun-releases</id>
<mirrorOf>*</mirrorOf>
<name>aliyun releases</name>
<url>https://maven.aliyun.com/repository/releases</url>
</mirror>
<mirror>
<id>aliyun-snapshots</id>
<mirrorOf>*</mirrorOf>
<name>aliyun snapshots</name>
<url>https://maven.aliyun.com/repository/snapshots</url>
</mirror>
<mirror>
<id>aliyun-grails-core</id>
<mirrorOf>*</mirrorOf>
<name>aliyun grails-core</name>
<url>https://maven.aliyun.com/repository/grails-core</url>
</mirror>
<mirror>
<id>aliyun-mapr-public</id>
<mirrorOf>*</mirrorOf>
<name>aliyun mapr-public</name>
<url>https://maven.aliyun.com/repository/mapr-public</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 system 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>
<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>
<encoding>UTF-8</encoding>
</properties>
</profile>
<!-- 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 system 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>
已安装了1.8版本的JDK, 对应的是Java 8, 所以下载tomcat 9即可
tomcat版本支持java版本
https://tomcat.apache.org/whichversion.html
下载地址:https://tomcat.apache.org/download-90.cgi
下载后,解压到指定目录。
“桌面” -> “此电脑” -> “高级系统设置” -> “环境变量”
变量值是解压解压安装包根目录,根目录文件夹里就是bin、lib、conf等文件
查看特定端口号占用进程
查询端口号占用的进程: 查询端口号:8080
netstat -ano | findstr 8080
查询进程: 查询进程id:12504
tasklist | findstr 12504
强制关闭进程:taskkill /pid 12504 /f
目录来到tomcat的bin目录
如果CMD未使用管理员身份运行,可能会出现异常闪退
启动:startup.bat
停止: shutdown.bat 或 关闭startup.bat运行的窗口
浏览器访问:http://localhost:8080/
、
至此Tomcat启动成功
打开tomcat根目录 -> conf -> logging.properties
java.util.logging.ConsoleHandler.encoding 的值 UTF-8
修改成 GBK
java.util.logging.ConsoleHandler.encoding = GBK
重启tomcat服务即可
IDEA官网中文版:IntelliJ IDEA
其他版本:https://www.jetbrains.com/zh-cn/idea/download/other.html
下载社区版,社区版是免费的,相比于收费版少了些功能,不过日常开发也够用了
注:版本、系统等根据自己喜好自行下载
修改完成后记得点击应用(Apply) 或者 确定(OK),不要直接右上角关闭了
然后还有一个问题,使用IDEA创建maven项目时,idea会根据maven archetype的配置,执行 mvn archetype:generate 命令,并且需要指定一个archetype-catalog.xml文件。
该命令的参数-DarchetypeCatalog,可选值为[remote, internal, local],用来指定archetype-catalog.xml文件从哪里获取。
默认为remote,即从 https://repo1.maven.org/maven2/archetype-catalog.xml 下载archetype-catalog.xml文件。体积约为10M,就会导致下载速度很慢,从而创建过程经常会被卡住。
这里解决的方法一般有三种,感兴趣的可以从其他博客了解,这里我只选择最方便快捷一劳永逸的一种,就是修改maven的VM Options参数配置。
-DarchetypeCatalog=internal
点击确定或应用,然后关闭IDEA
重新打开IDEA,查看刚刚的设置有没有生效❗
如果刚刚的设置又变回默认设置了,就再配一次,直到重启打开设置生效
IDEA高版本经常出现此类问题,如果不行重试几次即可。
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
idea和maven之间的适配(兼容)问题
注意:针对一些老项目 还是尽量采用 3.6.3版本,针对idea各个版本的兼容性就很兼容
0.IDEA 2022 兼容maven 3.8.1及之前的所用版本
1.IDEA 2021 兼容maven 3.8.1及之前的所用版本
2.IDEA 2020 兼容Maven 3.6.3及之前所有版本
3.IDEA 2018 兼容Maven3.6.1及之前所有版本
当我们使用idea部署web程序到tomcat服务器上,当我们运行tomcat时控制台出现服务器输出内容乱码的情况,这个问题可能是由于编码不一致引起的。在IDEA中,如果项目的编码方式与Tomcat服务器的编码方式不一致,就可能出现服务器输出内容乱码的情况。
这个问题可能会给开发和调试带来不便,因为输出的乱码很难读懂,无法直观地了解服务器的运行情况。同时,如果乱码问题未能及时处理,就可能会对系统的正常运行产生影响,从而增加开发和维护的难度。
我们可以通过修改idea 的相关配置来解决。
设置项目编码方式:在IDEA中,可以在项目的设置中设置编码方式,保证与Tomcat服务器的编码方式一致。
设置Tomcat编码方式:在Tomcat的配置文件中,也可以设置服务器的编码方式,保证与项目的编码方式一致。
修改IDEA控制台编码方式:如果以上两个方法无法解决问题,可以尝试修改IDEA控制台的编码方式,使其能够正确地显示服务器输出的内容。
修改输出内容编码方式:如果服务器输出的内容是乱码,可以尝试修改输出内容的编码方式,将其转换为正确的编码方式。
具体步骤 如下: 在 idea64.exe.vmoptions 下添加-Dfile.encoding=UTF-8
-Dfile.encoding=UTF-8
添加到tomcat服务器VM配置中
注意: 在以上所有步骤中 记得先点击 Apply(应用) ,然后点击 OK(确定) 保存你的配置
<localRepository>D:\Java\MavenRepository</localRepository>
设置好maven的本地仓库地址
把镜像地址也指向本地的maven仓库地址
修改好之后的setting.xml文件如下(主要配置是加上下面加粗字体部分):
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
<mirrors>
<mirror>
<id>central</id>
<name>central</name>
<url>file://E:\wokesoftware\maven-repository</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
备注 jar 包来源,拷贝同事的老项目jar 包 ,自定义 依赖 ,一直不能导入 jar包,研究了一早上,得到最终方案~~
免费送上一份 maven 3.8 setting 配置文件
<?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 http://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>
-->
<localRepository>D:\Java\MavenRepository</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>
<!-- 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>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
<mirror>
<id>central</id>
<name>central</name>
<url>file://D:\Java\MavenRepository</url>
<mirrorOf>*</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>*</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
<id>aliyun-central</id>
<mirrorOf>*</mirrorOf>
<name>aliyun central</name>
<url>https://maven.aliyun.com/repository/central</url>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</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 system 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>
<id>nexusProfile</id>
<repositories>
<repository>
<id>nccloud-snapshots</id>
<name>nccloud Snapshots Repository</name>
<url>http://maven.yonyou.com/nexus/content/repositories/nccloud-snapshots/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<!-- 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 system 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>
<activeProfile>nexusProfile</activeProfile>
</activeProfiles>
<!-- activeProfiles
| List of profiles that are active for all builds.
|
<activeProfiles>
<activeProfile>alwaysActiveProfile</activeProfile>
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
</activeProfiles>
-->
</settings>