Maven的安装与配置

2023-05-16

一、安装本地Maven

tips: 官网为外网,下载速度较慢,这里提供3.6.3版本的三方链接下载Maven下载

  1. 无视下载速度以及需要其他版本的伙伴点此进入Maven官网下载

  2. 选择左侧Download
    在这里插入图片描述

  3. 点击箭头所指的链接进行下载
    在这里插入图片描述

  4. 下载完成后,选择一个路径进行解压

  5. 然后配置path环境变量,如图

  • 系统变量:MAVEN_HOME = F:\dev\apache-maven-3.6.1
  • 系统变量:path = %MAVEN_HOME%\bin
    MAVEN_HOME:
    在这里插入图片描述

在这里插入图片描述

path:
在这里插入图片描述

  1. 然后win+R 运行cmd 输入 mvn -version,如图所示则配置成功

在这里插入图片描述

二、配置settings文件

  1. 在F:\dev\apache-maven-3.6.1\conf下可以找到settings文件,打开(嫌麻烦的直接看最后一步)

  2. 找到第52行,这里是maven默认的仓库
    在这里插入图片描述

  3. 我们复制第53行

<span style="color:#000000"><code><localRepository>/path/to/local/repo</localRepository>
</code></span>
  • 1

将它拿到注释外并将中间的内容改成你需要的路径,如图

<span style="color:#000000"><code><localRepository>F:/repository</localRepository>
</code></span>
  • 1

这里的路径随便设置,注意这里是正斜杠
在这里插入图片描述

  1. 因为国外的服务器下载jar包很慢所以我们改为阿里云服务器(大约在150行左右),这两个仓库只用选一个(根据大家反馈建议使用第一个,第二个在有的版本可能会出现warning)
<span style="color:#000000"><code> <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
     或者
      <mirror>
		<id>nexus-aliyun</id>
		<mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
	 </mirror>

</code></span>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  1. 如图,要夹在两个mirrors标签之间
    在这里插入图片描述

  2. 在最后配置jdk,也要夹在两个profiles标签之间(我这里使用的为jdk8)

<span style="color:#000000"><code><!-- java版本 --> 
<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>
      </properties>
</profile>

</code></span>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

在这里插入图片描述

  1. 配置完成,在命令行输入mvn help:system测试,看到下载链接里面是ailiyun的链接表示配置成功

  2. 嫌麻烦的直接复制配置文件的内容即可,不过路径还是要改(参考第3步)

<span style="color:#000000"><code class="language-xml"><span style="color:#5c6370"><?xml version="1.0" encoding="UTF-8"?></span>

<span style="color:#5c6370"><!--
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.
--></span>

<span style="color:#5c6370"><!--
 | 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.
 |
 |--></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>settings</span> <span style="color:#d19a66">xmlns</span><span style="color:#669900"><span style="color:#999999">=</span><span style="color:#999999">"</span>http://maven.apache.org/SETTINGS/1.0.0<span style="color:#999999">"</span></span>
          <span style="color:#d19a66">xmlns:xsi</span><span style="color:#669900"><span style="color:#999999">=</span><span style="color:#999999">"</span>http://www.w3.org/2001/XMLSchema-instance<span style="color:#999999">"</span></span>
          <span style="color:#d19a66">xsi:schemaLocation</span><span style="color:#669900"><span style="color:#999999">=</span><span style="color:#999999">"</span>http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd<span style="color:#999999">"</span></span><span style="color:#999999">></span></span>
  <span style="color:#5c6370"><!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  --></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>localRepository</span><span style="color:#999999">></span></span>F:/repository<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>localRepository</span><span style="color:#999999">></span></span>
  <span style="color:#5c6370"><!-- 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>
  --></span>

  <span style="color:#5c6370"><!-- 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>
  --></span>

  <span style="color:#5c6370"><!-- 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.
   |--></span>
  <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>pluginGroups</span><span style="color:#999999">></span></span>
    <span style="color:#5c6370"><!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    --></span>
  <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>pluginGroups</span><span style="color:#999999">></span></span>

  <span style="color:#5c6370"><!-- 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.
   |--></span>
  <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>proxies</span><span style="color:#999999">></span></span>
    <span style="color:#5c6370"><!-- 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>
    --></span>
  <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>proxies</span><span style="color:#999999">></span></span>

  <span style="color:#5c6370"><!-- 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.
   |--></span>
  <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>servers</span><span style="color:#999999">></span></span>
    <span style="color:#5c6370"><!-- 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>
    --></span>

    <span style="color:#5c6370"><!-- 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>
    --></span>
  <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>servers</span><span style="color:#999999">></span></span>

  <span style="color:#5c6370"><!-- 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.
   |--></span>
  
    <span style="color:#5c6370"><!-- mirror
	<mirrors>
     | 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>
	 </mirrors>
     --></span>
     <span style="color:#5c6370"><!-- 阿里云仓库 --></span>
 <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>mirrors</span><span style="color:#999999">></span></span>
	 <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>mirror</span><span style="color:#999999">></span></span>
			<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>id</span><span style="color:#999999">></span></span>nexus-aliyun<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>id</span><span style="color:#999999">></span></span>
			<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>mirrorOf</span><span style="color:#999999">></span></span>*<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>mirrorOf</span><span style="color:#999999">></span></span>
			<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>name</span><span style="color:#999999">></span></span>Nexus aliyun<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>name</span><span style="color:#999999">></span></span>
			<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>url</span><span style="color:#999999">></span></span>http://maven.aliyun.com/nexus/content/groups/public<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>url</span><span style="color:#999999">></span></span>
	<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>mirror</span><span style="color:#999999">></span></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>mirrors</span><span style="color:#999999">></span></span>
  <span style="color:#5c6370"><!-- 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.
   |
   |--></span>
    <span style="color:#5c6370"><!-- profile
	<profiles>
     | 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>
    --></span>

    <span style="color:#5c6370"><!--
     | 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>
	  
    --></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>profiles</span><span style="color:#999999">></span></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>profile</span><span style="color:#999999">></span></span>
      <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>id</span><span style="color:#999999">></span></span>jdk-1.8<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>id</span><span style="color:#999999">></span></span>
      <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>activation</span><span style="color:#999999">></span></span>
	    <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>activeByDefault</span><span style="color:#999999">></span></span>true<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>activeByDefault</span><span style="color:#999999">></span></span>
        <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>jdk</span><span style="color:#999999">></span></span>1.8<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>jdk</span><span style="color:#999999">></span></span>
      <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>activation</span><span style="color:#999999">></span></span>

      <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>properties</span><span style="color:#999999">></span></span>
        <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>maven.compiler.source</span><span style="color:#999999">></span></span>1.8<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>maven.compiler.source</span><span style="color:#999999">></span></span>
		<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>maven.compiler.target</span><span style="color:#999999">></span></span>1.8<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>maven.compiler.target</span><span style="color:#999999">></span></span>
		<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"><</span>maven.compiler.compilerVersion</span><span style="color:#999999">></span></span>1.8<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>maven.compiler.compilerVersion</span><span style="color:#999999">></span></span>
      <span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>properties</span><span style="color:#999999">></span></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>profile</span><span style="color:#999999">></span></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>profiles</span><span style="color:#999999">></span></span>



  <span style="color:#5c6370"><!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
  --></span>
<span style="color:#e06c75"><span style="color:#e06c75"><span style="color:#999999"></</span>settings</span><span style="color:#999999">></span></span>

</code></span>

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Maven的安装与配置 的相关文章

  • Redis 有哪些特性?

    1 速度快 xff1a 使用标准 C 写 xff0c 所有数据都在内存中完成 xff0c 读写速度分别达到 10 万 20 万 2 持久化 xff1a 对数据的更新采用 Copy on write 技术 xff0c 可以异步地保存到磁盘上
  • 在树莓派4b上安装kali linux 2019.4并启用vnc服务

    安装 x11vnc 工具 root 64 kali apt install y x11vnc 设置密码 root 64 kali x11vnc storepasswd 设置服务 新建 lib systemd system x11vnc se
  • springboot整合⾕歌开源缓存框架Guava Cache使用

    Guava Cache使用 Guava Cache xff1a 歌开源缓存框架Guava Cache使用使用压测 具Jmeter5 x进行接口压力测试 xff1a 压测 具本地快速安装Jmeter5 x新增聚合报告 xff1a 线程组 gt
  • Android Studio之opencv极简环境配置(2022-1-30亲测有效)

    Android Studio之opencv环境配置 一 基础创建项目步骤二 OpenCv环境配置三 opencv体验 一 基础创建项目步骤 1 先创建一个app项目 2 选择Basic Activity 3 完成基础项目创建 4 运行一下看
  • VR游戏交互开发的一些体验

    VR游戏交互开发的一些体验 本文主要写Unity开发手游过程中VR交互输入控制的一些浅薄的经验交互方面 xff0c 头控和视线按钮依然较为主流 xff0c 可以获得传感器数据来获得输入除了实体按钮输入之外还可以探索其他交互方式 xff0c
  • python 实现批量post json数据测试

    服务器之前经常出现发消息就会宕机 xff0c 今天修改了部分之后 xff0c 就用python实现了一个批量post数据测试 直接上代码 url 是测试版 xff0c 你看到这份代码的时候 xff0c 应该已经不能用了 xff0c 童鞋需要
  • 函数

    xff08 1 xff09 模块是函数的集合 xff0c 类似于Java类 xff08 2 xff09 函数的作用 xff1a 提高代码复用性 xff08 3 xff09 函数的定义 xff1a def 函数名 代码 函数名符合命名规则 x
  • 元组

    xff08 1 xff09 tuple与列表类似 xff0c 不同之处在于元组不能修改 xff08 2 xff09 定于元组 xff0c 使用小括号 xff08 xff09 xff0c 数据之间用 xff0c 隔开 xff08 3 xff0
  • 字典

    xff08 1 xff09 描述物体的相关信息 xff08 2 xff09 字典是无序的对象集合 xff0c 列表是有序的对象集合 xff08 3 xff09 字典使用 定义 xff0c 使用键值对存储数据 xff0c 键值对之间用 xff
  • 字符串

    xff08 1 xff09 使用双引号定义字符串 xff08 2 xff09 使用单引号的情况 xff1a str 61 39 我的 强国号 xff08 3 xff09 字符串可以使用索引 xff0c 从 0 开始 str xff08 4
  • 大数据概述

    1 什么是大数据 xff1a 海量 xff0c 高增长率 xff0c 多样化 xff0c 分布式存储 43 分布式计算 43 弹性伸缩 2 大数据特征 xff1a Volume xff0c Variety xff0c Value xff0c
  • 大数据分析概述

    xff08 1 xff09 应用领域 xff1a 商业 制造业 媒体 趋势预测 决策支持 xff08 2 xff09 采集 ETL 实时数据采集 xff08 3 xff09 数据集成 xff1a 合并整理 xff0c 形成统一的数据视图 数
  • SQL概述

    xff08 1 xff09 方便各平台的数据库移植 xff0c 统一采用小写来定义数据库名和表名
  • 数据采集

    xff08 1 xff09 数据分类 xff1a 业务数据 xff0c 行业数据 xff0c 内容数据 xff0c 线上行为数据 xff0c 线下行为数据 xff08 2 xff09 数据来源 xff1a 企业系统 xff0c 机器系统 x
  • mybatis多表操作

    xff08 1 xff09 多表查询 用户和账户 xff0c 要求 xff1a 一个用户可以有多个账户 xff0c 一个账户只能属于一个用户 xff08 多个账户也可以属于同一个用户 xff09 步骤 xff1a 1 建立两张表 xff1a
  • centos .sh文件无法执行

    到sh文件目录下执行 sed i s r sh
  • Maven学习笔记

    xff08 1 xff09 标准目录结构 src main java目录 xff1a 核心代码部分 src main resources xff1a 配置文件部分 src test java xff1a 测试代码部分 src test re
  • JSTL学习笔记

    xff08 1 xff09 概念 xff1a JavaServer Pages Tag Library jsp标准标签库 xff08 2 xff09 作用 xff1a 用于简化和替换jsp页面上的Java代码 xff08 3 xff09 使
  • idea 开启 tomcat 热部署 的 具体流程 和 使用方式

    idea 开启 tomcat 热部署 的 具体流程 和 使用方式 https www cnblogs com c2g5201314 p 12275243 html https blog csdn net qq 41288095 articl
  • java 判断字符串是否为空

    四种判断为空表示方式 xff1a 1 str 61 61 null 2 34 34 equals str 3 str length 61 61 0 4 str isEmpty 1234 代码中的四种不为空的运用 xff1a if str 6

随机推荐

  • springmvc返回值

    xff08 1 xff09 返回字符串 xff08 2 xff09 void xff08 3 xff09 返回ModelAndView 把user对象存储到mv对象中 xff0c 也会把user对象存入到request对象 mv addOb
  • springmvc上传下载

    xff08 1 xff09 form表单的enctype取值是 xff1a multipart form data xff0c method取值是 xff1a post xff0c 提供一个文件选择域 xff08 2 xff09 sprin
  • 数据库多表和范式

    xff08 1 xff09 一对多的关系 xff1a 一个部门可以有多个员工 xff0c 一个员工只能属于一个部门 在多的一方建立外键 xff0c 指向1的一方的主键 xff08 2 xff09 多对多关系 课程 学生 中间表 xff0c
  • springjdbc学习笔记

    xff08 1 xff09 导包 xff08 2 xff09 创建jdbcTemplate xff0c 依赖数据源DataSource 实例化的时候需要传入DataSource jdbcTemplate 61 new JdbcTemplat
  • MySQL多表操作

    xff08 1 xff09 笛卡尔积 xff1a 两个集合的所有组合 xff1a select from 表1 xff0c 表2 xff08 2 xff09 内连接查询 xff1a 隐式内连接 xff1a select from 表1 xf
  • MySQL事务

    xff08 1 xff09 概念 xff1a 一个包含多个步骤业务操作 xff0c 被事务管理 xff0c 这些操作具有统一性 xff08 要么成功 xff0c 要么失败 xff09 操作开启事务 xff08 start transacti
  • 软件产品化

    1 产品化定义 xff1a 软件产品化是指客户无需为软件添加或调整代码和语句即能完成软件的安装配置 应用初始化 系统管理 用户使用的全过程 xff0c 并且软件至少能满足80 以上的用户某一组应用需求 微软Office或杀毒软件就是产品化软
  • MySQL忘记root密码

    1 cmd gt net stop mysql 停止mysql服务 需要管理员运行该cmd 2 使用无验证方式启动mysql服务 xff1a mysqld skip grant tables 3 打开新的cmd窗口 直接输入mysql命令
  • 对象转型

    一 对象转型介绍 对象转型分为两种 xff1a 一种叫向上转型 父类对象的引用或者叫基类对象的引用指向子类对象 xff0c 这就是向上转型 xff0c 另一种叫向下转型 转型的意思是 xff1a 如把float类型转成int类型 xff0c
  • 获取文件的真实(服务器)路径

  • jQuery选择器

    1 基本选择器 标签选择器 xff08 元素选择器 xff09 xff0c 语法 xff1a 34 html标签名 34 id选择器 xff0c 语法 xff1a 34 id的属性值 34 类选择器 xff0c 语法 xff1a 34 cl
  • MySQL8:Unknown initial character set index ‘255‘ received from server. Initial client character 解决方法

    Unknown initial character set index 39 255 39 received from server Initial client character set can be forced via the 39
  • mybatis延迟加载

    1 什么是延迟加载 在使用时候才加载数据 xff0c 不用的时候不加载 2 关联对象是1时 xff0c 采用立即加载 xff1b 关联对象是多是 xff0c 采用延迟加载 3 一对一 xff08 一对多 xff09 延迟加载步骤及配置 xf
  • springmvc拦截器

    一 springmvc拦截器只有springmvc有 xff0c Servlet的拦截器可以适用任何web项目 二 步骤 1 编写拦截器类 xff0c 实现 HandlerInterceptor 接口 xff1b 配置拦截器 2 案例 pu
  • SSM整合

    一 spring整合springmvc mybatis 二 配置文件 43 注解 1 创建相应的类 xff1a dao controller domain service service impl 2 首先配置spring xff0c 使用
  • Maven 骨架创建 Java Web 项目

    Maven 骨架创建 Java Web 项目 1 File gt New gt Project 2 如下图 3 xff09 如下图 GroupId和ArtifactId lt 项目名 gt 还有Version xff0c 这三个属性目的是标
  • IntelliJ IDEA集成maven

    一 idea中maven的配置 1 maven配置 首先需要在idea中对maven进行集成 xff0c 目录为File Setting Build Execution Deployment Build Tools maven xff0c
  • 批量替换tab为空格

    利用find 找出需要替换的文件 xff0c 然后使用sed命令执行替换 如将src 路径下的所有cpp 文件的tab 替换为空格的命令如下 sed span class hljs attribute i span span class h
  • idea工具集成配置maven最详细的

    IDEA 全称 IntelliJ IDEA xff0c 是java语言开发的集成环境 xff0c IntelliJ在业界被公认为最好的Java开发工具之一 IDEA是JetBrains公司的产品 现在有逐步取代老牌Java开发工具Eclip
  • Maven的安装与配置

    一 安装本地Maven tips 官网为外网 xff0c 下载速度较慢 xff0c 这里提供3 6 3版本的三方链接下载Maven下载 无视下载速度以及需要其他版本的伙伴点此进入Maven官网下载 选择左侧Download 点击箭头所指的链