Java SSM1——Maven

1、下载

maven 官网:https://maven.apache.org/download.cgi

maven 百度云:https://pan.baidu.com/s/18XKbJp7P5x_BkKyc0VF0tw提取码:4zr9

2、安装

解压到想安装的目录下

添加环境变量

添加MAVEN_HOME变量

MAVEN_HOME
D:\apache-maven-3.6.3

在PATH中添加

%MAVEN_HOME%\bin

3、配置

本地仓库

<localRepository>D:\apache-maven-3.6.3\Repository</localRepository>

镜像

<mirror><id>nexus-aliyun</id>  <mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf>  <name>Nexus aliyun</name>  <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>

完整配置

<?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.3\Repository</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>nexus-aliyun</id>  <mirrorOf>*,!jeecg,!jeecg-snapshots</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>

4、pom.xml详解

<?xml version="1.0" encoding="UTF-8"?><!--Maven版本和头文件-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><!--这里就是我们刚才配置的GAV--><groupId>com.kuang</groupId><artifactId>javaweb-01-maven</artifactId><version>1.0-SNAPSHOT</version><!--Package:项目的打包方式jar:java应用war:JavaWeb应用--><packaging>war</packaging><!--配置--><properties><!--项目的默认构建编码--><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><!--编码版本--><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target></properties><!--项目依赖--><dependencies><!--具体依赖的jar包配置文件--><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.11</version></dependency></dependencies><!--项目构建用的东西--><build><finalName>javaweb-01-maven</finalName><pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --><plugins><plugin><artifactId>maven-clean-plugin</artifactId><version>3.1.0</version></plugin><!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --><plugin><artifactId>maven-resources-plugin</artifactId><version>3.0.2</version></plugin><plugin><artifactId>maven-compiler-plugin</artifactId><version>3.8.0</version></plugin><plugin><artifactId>maven-surefire-plugin</artifactId><version>2.22.1</version></plugin><plugin><artifactId>maven-war-plugin</artifactId><version>3.2.2</version></plugin><plugin><artifactId>maven-install-plugin</artifactId><version>2.5.2</version></plugin><plugin><artifactId>maven-deploy-plugin</artifactId><version>2.8.2</version></plugin></plugins></pluginManagement></build>
</project>

Java SSM1——Maven相关推荐

  1. java 创建ssh用户秘钥,安装Java、Maven、Git,以及生成、拷贝密钥

    安装Java.Maven.Git,以及生成.拷贝密钥. 整个过程可以用root用户操作,但为了使部署脚本对普通用户可用,需要注意调整文件的权限. 这里以10.56.69.165为部署服务器,10.56 ...

  2. YangTools从YANG生成Java类(Maven)

    1.说明 ODL提供了Yang Tools工具从YANG文件生成Java类, 本文介绍使用Maven插件的方式生成, 基于yang-maven-plugin这个插件. 2.创建Maven工程 Ecli ...

  3. Jsonschema2pojo从JSON生成Java类(Maven)

    1.说明 jsonschema2pojo工具可以从JSON Schema(或示例JSON文件)生成Java类型, 并且可以配置生成Jackson 1.x,Jackson 2.x, Moshi 1.x或 ...

  4. 数据库Java项目:在线租房出租房屋系统(java+springboot+maven+mysql)

    数据库Java项目:在线租房出租房屋系统(java+springboot+maven+mysql) 主要实现了客户在线租房及房东发布出租等基本操作流程的全部功能,系统分普通用户.房东.管理员等角色,除 ...

  5. Eclipse 基本 java lombok maven 示例

    在本指南中,我们将了解什么是 Lombok 项目,使用 Eclipse 或 STS 等 IDE设置Lombok ,一个简单的java Lombok maven 示例和Lombok项目的主要功能. 1. ...

  6. IntelliJ IDEA 创建 hello world Java web Maven项目从头到尾都有图有真相2017版本

    IntelliJ IDEA使用教程 (总目录篇) 学Java的大部分吧都是要整Java web开发项目的,那么最好用的编辑器估计就是这个 IntelliJ IDEA,然后现在maven管理项目是很流行 ...

  7. java调用maven接口实现java执行maven命令

    引入maven <!--java操控maven命令--><dependency><groupId>org.apache.maven.shared</group ...

  8. 学习spring boot 第一天:vscode配置Java以及maven环境

    配置系统环境 1.1 安装jdk1.8 "我的电脑"右键→属性→高级系统设置→环境变量 点击"新建",新建系统变量JAVA_HOME,值为JDK安装根目录 D: ...

  9. (精品)ssm Java mysql maven vue健康医疗预约系统(源码+系统+mysql数据库+lw文档)

    下载地址:https://download.csdn.net/download/m0_71595576/85519044 项目介绍: (精品)ssm Java mysql maven vue健康医疗预 ...

最新文章

  1. 1-2 用Python编写【房价预测】模型----paddle
  2. notepad宏的使用,定制各种操作,比如删除一整行、从当前位置到行末用某字符替换
  3. 通过程序获得SQL Server自增型字段的函数:GetKey
  4. SSDT Hook的妙用-对抗ring0 inline hook
  5. 区块链系列教程之:比特币中的共识
  6. 精悍的Python代码段-转
  7. oracle数据库查表_oracle数据库之多表查询二
  8. 国内三大常见核心期刊体系-CSSCI、CSCD与中文核心
  9. P3545 [POI2012]HUR-Warehouse Store
  10. Telephone--短信发送/接收流程
  11. 大学生WEB前端静态网页——旅游介绍35页 响应式,
  12. 《LeetCode刷题》—121. 买卖股票的最佳时机
  13. CreateProcess创建新的进程
  14. 小鸟云独享虚拟主机和共享虚拟主机区别对比
  15. 基于Java+SpringBoot+vue实现图书借阅和销售商城一体化系统
  16. 华为鲲鹏HCIA-Kunpeng Application Developer V1.5考试样题
  17. 模块电路选型(5)----电机驱动模块
  18. solr mysql 全文搜索_全文检索Solr集成HanLP中文分词
  19. 鸿蒙os2.0手机app开发,华为发布鸿蒙OS2.0手机开发者Beta版
  20. 为什么要学习 Python?这是我听过最实用的答案

热门文章

  1. Android ImageButton示例代码
  2. stringreader_Java StringReader skip()方法与示例
  3. Java RandomAccessFile readUTF()方法及示例
  4. linux14.04 Apache,Ubuntu 14.04编译安装Apache
  5. inventor扳手制作视频_弱电工程视频监控系统施工方案,可作施工组织设计
  6. java 字节数组作用_这段java代码中字节数组b起到了什么作用?
  7. 西安圈子聚会心得分享
  8. Win7搭建http文件共享
  9. php实现ftp上传,PHP_PHP实现ftp上传文件示例,FTP上传是PHP实现的一个常见且 - phpStudy...
  10. ntrip获取源列表_Ntrip协议简介(转)