Windows下搭建开发环境
- 下载
首先官网下载IDEA,tomcat,maven,IDEA自带JDK11,但是大部分企业和很多开源项目都用的JDK8,为了兼容性问题,再下载一个JDK8。 - 配置JAVA开发环境
这里值得一提的是,安装JDK8时如果出现两次安装的提示,其实第一次安装的是JDK,后一次选择安装JRE的目录,查看bin目录下是否有javac程序就知道哪个是JDK了,然后直接把另外一个没用的JRE文件夹删了就行了。
检验一下。
- 简单配置一下IDEA
不改的话IDEA默认是集成了Maven3的,但我想改成自己的便于管理,所以改掉了IDEA默认集成的Maven。
-Dmaven.multiModuleProjectDirectory=$MAVEN_HOME
- 简单配置一下Maven
http://maven.aliyun.com/nexus/content/groups/public/
注释里面都写了样例配置,直接复制粘贴下来改就行了,唯一注意的就是不要写在注释里面去了。
<?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>
-->