[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记录协议的示…

linux开机和登陆欢迎信息

这篇文章看似没啥技术含量&#xff0c;但却是非常实用的一个小技巧&#xff0c;通常在面临下面几个问题时就可以显示其意义了&#xff1a;1&#xff09;当你维护的服务器数量较多&#xff08;例如&#xff1a;十几台或更多&#xff09;&#xff0c;希望知道每台服务器的信息时&…

BookSmart Self Publishing

美国Blurb网站推出针对博客用户的自助出书软件已经不是什么新闻 &#xff0c;接下来传出日本人兴“个人出书” 出版社“量体裁衣”,其实去年 “自助出版”就已经进军中国&#xff1b;现在有发现两个国内版的booksmart&#xff0c;一个是麦客&#xff0c;一个是印客,前者是杭州的…

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

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

常用UI控件之UIControl

1.UIControl概述UIControl继承于UIView,其子类 有:UIButton,UITextField,UISegmentedControl(分段控件),UISlider(滑块控件),UISwitch(开关控件),UIPageControl(分页控件)2.UISegmentedControl(分段控件)UIsegmentedControl中的每个segment都点击,相当于集成了多个UIButton,点击…

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;双向通…

昨日观看《龙虎门》

本来很想看《谍中谍3》的&#xff0c;想看看汤姆克鲁斯的风采。不过还是选择的《龙虎门》&#xff0c;早就看过介绍说《龙虎门》主要是给人视觉上的冲击&#xff0c;注重打斗。故事的情节比较简单&#xff0c;两兄弟碰面&#xff0c;大哥决定和自己的老大退出江湖引发上面帮派的…

zabbix2.2.3 VMware Vsphere exsi监控配置步骤

zabbix2.2.3 VMware Vsphere exsi监控配置步骤 zabbix2.2.3 VMware Vsphere exsi监控配置步骤,1,添加监控主机2,添加聚集macro;{$PASSWORD} yoodo.com{$URL} http://ip/sdk{$USERNAME} root3,关联监控模板模板用Template Virt VMware;posted on 2014-04-30 10:22 秦瑞It行程…

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

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

jQuery安装和语法

jQuery是一个JavaScript函数库&#xff0c;可实现HTML元素选取及操作、CSS 操作、HTML事件函数、JavaScript特效和动画、HTML DOM遍历和修改、AJAX等功能。 在html中引用jQuery&#xff0c;需要在head部分通过script并指定src引入 <script src"jquery路径及文件名"…

IIS网站的权限设置问题

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

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

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

https网络编程——openssl中后缀名文件说明以及常用的证书协议

参考&#xff1a;openssl中后缀名文件说明 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/108215177?spm1001.2014.3001.5502 参考&#xff1a;Openssl常用的证书协议有哪些&#xff1f; 地址&#xff1a;https://qingmu.blog.csdn.net/article/details/1082…

idea使用教程

https://www.jianshu.com/p/9c65b7613c30转载于:https://www.cnblogs.com/tnt-33/p/10333267.html

pgbench

参考: http://www.postgres.cn/docs/10/pgbench.html pgbench是pg自带的一个性能测试工具 你也能利用它做性能测试以外的事情 -- 创建测试库 create database pgbench;-- 使用pgbench命令, 初始化测试表 pgbench -i -U zhangtianxiao -p 6001 -d pgbench-- 使用默认表, 默认sq…

煲仔

湖南的煲仔似乎在我毕业工作的那年侵占了大街小巷&#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;某…

2014第18周六

刚睡觉起来&#xff0c;下午将近六点左右回来感觉有点困&#xff0c;就睡了一会儿直到现在刚起来感觉整个人还是很困。今天陪朋友和他妈妈一起去西湖玩了下&#xff0c;转的真有点累。五一假期就这样过完了&#xff0c;没看什么有意义的电视和书籍&#xff0c;也没有去据说很热…