[spring boot] 01 环境搭建 - 配置java和mvn环境

主要内容:

    一、IntelliJ IDEA 安装

    二、maven 安装

    三、设置IDEA和mvn的关系

 

一、IntelliJ IDEA 安装

 1.1. 下载编辑器:前往下载 (Ultimate和Community都是可以的,我一般下载前一个)

 

 1.2. 注册码记得搜索

 

 

二、maven 安装

 2.1. 下载mvn:前往下载 (windows用 Binary zip archive 就可以了)

 

 2.2. mvn是不用安装的,直接解压就可以用了

 2.3. 新建本地仓库目录(repository)

  

2.4. 修改mvn配置,打开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 athttp://www.apache.org/licenses/LICENSE-2.0Unless 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://apache-maven-3.6.0/conf/repository</localRepository><!-- interactiveModex| 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>nexus-aliyun</id><mirrorOf>*</mirrorOf><name>Nexus aliyun</name><url>http://maven.aliyun.com/nexus/content/groups/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| 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>
View Code

 

 2.4.1. 修改mvn的本地仓库路径(搜索localRepository)

 

 

  2.4.2. 修改本地仓库下载源的镜像路径(搜索mirror)

  

 2.5. 设置mvn和java的环境变量 

  2.5.1. 添加java和mvn的安装地址的环境变量

 

 

  2.5.2. 在path中添加java和mvn的bin环境变量

 

 

  2.5.3. 设置java的CLASSPATH,内容为:

.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

 

 

 2.6. 查看java和mvn是否安装成功:java -version 和 mvn -v

 

 

三、设置IDEA和mvn的关系

 3.1. 设置idea的maven的本地地址

 

 

转载于:https://www.cnblogs.com/allbetter/p/10127456.html

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

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

相关文章

https网络编程——HTTPS简介以及SSL协议详解

参考;HTTPS简介以及SSL协议详解 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108209248?spm1001.2014.3001.5502 目录1.HTTPS简介2.SSL协议介绍2.1、SSL协议的功能2.2、SSL协议在协议栈的位置2.3、SSL协议组成2.3.1、纪录协议的功能2.3.2、SSL记录协议的示…

D3---01基础的柱状图制作(转)

---文章转自 http://d3.decembercafe.org/index.html &#xff0c;Created by 十二月咖啡馆。 一个完整的柱形图包含三部分&#xff1a;矩形、文字、坐标轴。 首先要布置一个大小合适的 SVG 画布&#xff1a; 添加 SVG 画布 //画布大小 var width 400; var height 400;//在…

https网络编程——对称加密、非对称加密、单项加密的简单介绍

参考&#xff1a;对称加密、非对称加密、单项加密的简单介绍 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108213426?spm1001.2014.3001.5502 目录1、对称加密1.1、什么是对称加密&#xff1f;1.2、对称加密的优缺点是什么&#xff1f;1.3、常见的对称加密…

dnn中个性化服务的使用

1.什么是profiles(个性化服务)Profiles是系统面向用户提供的灵活性的个体信息的容器&#xff0c;一个用户的Profile可以使以下一种或多种的集合&#xff1a; &#xff08;1&#xff09; 简单的字符串或其他基础类型 &#xff08;2&#xff09; 一个序列化的实体 &#xff08;3&…

洛谷P1073 Tarjan + 拓扑排序 // 构造分层图

https://www.luogu.org/problemnew/show/P1073 C国有 n n个大城市和 mm 条道路&#xff0c;每条道路连接这 nn个城市中的某两个城市。任意两个城市之间最多只有一条道路直接相连。这 mm 条道路中有一部分为单向通行的道路&#xff0c;一部分为双向通行的道路&#xff0c;双向通…

https网络编程——SSL的加密和解密过程

参考&#xff1a;SSL的加密和解密过程 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108214105?spm1001.2014.3001.5502 目录现在的加密/解密技术主要有三种&#xff1a;对称加密&#xff0c;非对称加密&#xff0c;和单向加密加密解密的流程图现在的加密/解…

IIS网站的权限设置问题

2019独角兽企业重金招聘Python工程师标准>>> IIS中的权限与NTFS权限设置的区别&#xff1a; 当浏览器访问被IIS禁止的页面时&#xff0c;返回404错误页面 但浏览器访问被NTFS禁止的文件时&#xff0c;提示用户登录界面 转载于:https://my.oschina.net/changeme/blog…

关于.Net2.0下配置架构的使用

上次用到配置文件,就花了一些时间研究了一下.Net2.0下的配置文件架构,当时感觉确实很强大,完善,但看的有些头晕.迷迷糊糊把实现了要求,就没有再深入研究.最近,想在配置文件里实现一个复杂的配置,多层次嵌套的配置文件,再把.Net中的配置文档研究了一下&#xff0c;经过这两次的研…

煲仔

湖南的煲仔似乎在我毕业工作的那年侵占了大街小巷&#xff0c;满街的煲仔店向外热滋滋的喷着香味&#xff0c;便宜又好味。那几年在外的觅食&#xff0c;除了常德津市牛肉米饭外&#xff0c;煲仔似乎是我唯一的选择。将米放入煲内&#xff0c;加水在火上煮至半熟&#xff0c;再…

https网络编程——中继(负载均衡)工作原理

参考&#xff1a;中继&#xff08;负载均衡&#xff09;工作原理 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108217055?spm1001.2014.3001.5502 中继&#xff08;负载均衡&#xff09;工作原理 在我们当前社会&#xff0c;比如我们上某宝&#xff0c;某…

全套支付宝系统架构(内部架构图)【收藏】

据说这是对支付宝系统体系最全最强解析&#xff0c;推荐收藏学习&#xff01; 转载于:https://www.cnblogs.com/SH-xuliang/p/10340745.html

iOS学习之iOS沙盒(sandbox)机制和文件操作之NSFileManager

2019独角兽企业重金招聘Python工程师标准>>> 1、在Documents里创建目录 创建一个叫test的目录,先找到Documents的目录&#xff0c; [cpp] view plain copy NSArray *paths NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); …

https网络编程——使用openssl库自建根证书

参考&#xff1a;如何自建根证书&#xff1f;使用openssl库自建根证书带图详解 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108217572?spm1001.2014.3001.5502 目录根证书的普通用途自建根证书步骤1、创建一个目录&#xff0c;存放所有证书有关资料2、进入…

angular接口传参

1、service文件 创建xxx.service.ts文件 import { Injectable, Inject } from angular/core;import { Observable } from rxjs;import { map } from rxjs/operators;import { HttpClient } from angular/common/http;Injectable({ providedIn: root})export class ErrorCond…

https网络编程——如何建立利用根证书(凭证)签发建立中继证书(凭证)详解

参考&#xff1a;如何建立利用根证书&#xff08;凭证&#xff09;签发建立中继证书&#xff08;凭证&#xff09;详解 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108221568?spm1001.2014.3001.5502 目录在建立中继之前需要自建根证书建立根证书的具体步…

NURBS曲线与曲面

B样条方法在表示与设计自由型曲线曲面形状时显示了强大的威力&#xff0c;然而在表示与设计初等曲线曲面时时却遇到了麻烦。因为B样条曲线包括其特例的Bezier曲线都不能精确表示出抛物线外的二次曲线&#xff0c;B样条曲面包括其特例的Bezier曲面都不能精确表示出抛物面外的二次…

https网络编程——如何利用中继证书(凭证)建立服务器证书

参考&#xff1a;如何利用中继证书&#xff08;凭证&#xff09;建立服务器证书 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108225569?spm1001.2014.3001.5502 目录建立服务器证书的前提是要建立中继证书建立服务器证书的具体步骤1、建立一个目录&#x…

上传图片

2019独角兽企业重金招聘Python工程师标准>>> private File imageFile;// 上传文件名称private String imageFileFileName;// 上传文件类型private String imageFileContextType; InputStream is new FileInputStream(imageFile);String suffixName imageFileFileN…

https网络编程——如何利用中继证书(凭证)建立客户端证书

参考&#xff1a;如何利用中继证书&#xff08;凭证&#xff09;建立客户端证书 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108226592?spm1001.2014.3001.5502 目录建立客户端证书的前提是要建立中继证书建立客户端证书的具体步骤1、建立一个目录&#x…

2019.2.4 nfs原理和安装实验

NFS 访问一个本地文件还是NFS共享文件对于客户端而言都是透明的&#xff0c;当文件打开的瞬间&#xff0c;内核会作出一个决定&#xff0c;如果是本地文件内核会将本地NFS共享文件内核会将NFS共享文件的所有引用传递给——》NFS客户端枢中 NFS客户端是通过TCP/IP协议及模块向NF…