Git基础和Maven基础

本文介绍了Maven的基础知识,包括标准化的项目结构、构建流程、依赖管理以及如何使用Maven仓库。同时,讲解了Git的基本概念、版本控制系统、安装步骤、常用命令,以及初始化本地库的操作流程。
摘要由CSDN通过智能技术生成

目录

一.Maven

1.什么是Maven?

1.1 标准化的项目结构:

 1.2 标准化的构建流程:

1.3 依赖管理:

1.4依赖包资源网站

2.仓库

2.1仓库分类:

3.操作步骤 

二.Git

1.什么是Git

2.版本控制

3.版本控制系统

4.Git基本概念

5.Git工作流程

6.Git安装

7.Git常用命令 

8. 初始化本地库

 9.操作步骤


一.Maven

1.什么是Maven?

Maven是专门用于管理和构建 Java项目的工具 ,它的主要功能有:
提供了一套标准化的项目结构
提供了一套标准化的构建流程(编译,测试,打包,发布……)
  提供了一套依赖管理机制

1.1 标准化的项目结构:

项目结构我们都知道,每一个开发工具(
IDE)都有自己不同的项目结构,它们互相之
间不通用。我再eclipse中创建的目录,无法在idea中进行使用,这就造成了很大的不方
便,如下图:前两个是以后开发经常使用的开发工具

 1.2 标准化的构建流程:

1.3 依赖管理:

依赖管理其实就是管理你项目所依赖的第三方资源(
jar包、插件)。如之前我们项目中
需要使用JDBC和Druid的话,就需要去网上下载对应的依赖包

1.4依赖包资源网站

https://mvnrepository.com/artifact/com.mchange/c3p0/0.9.5.5

2.仓库

依赖jar包是存储在我们的本地仓库中。而项 目运行时从本地仓库中拿需要的依赖jar包。

2.1仓库分类:

  本地仓库:自己计算机上的一个目录
  中央仓库:由Maven团队维护的全球唯一的仓库
  地址: https://repo1.maven.org/maven2/
远程仓库(私服):一般由公司团队搭建的私有仓库

 

3.操作步骤 

1.

 2.

3.

 

 如果引入依赖包后爆红色字体可以点击上图的刷新下载依赖包

<dependency>
    <groupId>mysql-java</groupId>
    <artifactId>mysql-java</artifactId>
    <version>5.1.21</version>

</dependency>

如果需要找其他包可以参考这个网站1.4

https://mvnrepository.com/artifact/com.mchange/c3p0/0.9.5.5

4.鼠标右键点击pom.xml空白处然后找到Maven打开settings.xml

 5.在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 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.2.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值