zoukankan      html  css  js  c++  java
  • 二 MyBatis 从入门到进阶 2 Maven 入门

    1 Maven 的使用

    1.1 本地仓库与中央仓库

    本地仓库:Window Preferences Maven User Settings Local Repository

    中央仓库:

    • 代理服务器 / 私服 / 备份服务器
    • maven.aliyun.com,public Repository

    创建私服:pom.xml

    1 <repositories>
    2     <repository>
    3         <id> aliyun </id>
    4         <name> aliyun </name>
    5         <url> https://maven.aliyun.com/repository/public </url>
    6     </repository>
    7 </repositories>
    创建私服

    1.2 修改本地仓库地址

    1. apache-maven-3.6.0 conf settings.xml, <localRepository>  e:/maven-repo </localRepository>
    2. Window Preferences Maven Installations, Window Preferences Maven User Settings

    1.3 IDEA 操作 Maven

    1.3.1 IDEA Configure

    • Configure Settings Build, Execution, Deployment Build Tools Maven
    • Maven home directory / User settings file / Local repository

    1.3.2 Create New Project Maven

    • GroupId: com.imooc
    • ArtifactId: idea-maven
    • Version: 1.0.0-RELEASE

    1.3.3 标准 Maven 工程

    • src
    • main / test
    • main java, resources
    • test java

    2 Maven 常用命令

    2.1 junit 依赖

    1     <dependencies>
    2         <dependency>
    3             <groupId>junit</groupId>
    4             <artifactId>junit</artifactId>
    5             <version>4.12</version>
    6         </dependency>
    7     </dependencies>
    junit

     2.1.1 不再支持源选项 1.5。请使用 1.6 或更高版本。

    1     <properties>
    2         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    3         <maven.compiler.source>1.8</maven.compiler.source>
    4         <maven.compiler.target>1.8</maven.compiler.target>
    5     </properties>
    添加属性
  • 相关阅读:
    机器人对话小程序
    partial关键字的含义
    TreeView控件常用写法
    电话本管理程序(实现增删改查功能)
    三层架构
    c# RegistryKey 的相关简单操作
    VS2010程序打包操作(超详细的)
    一些中文.net讲座
    对象表单自动数据邦定
    AspNetForums 2.0中的全文检索
  • 原文地址:https://www.cnblogs.com/sketeton/p/11695880.html
Copyright © 2011-2022 走看看