zoukankan      html  css  js  c++  java
  • maven系列---【如何不用在idea中设置本地maven的setting,直接在pom.xml中配置repository?】

    1.使用场景:每次打开新项目都要设置maven的setting.xml比较繁琐,直接把仓库陪在pom.xml中统一且方便维护。

    2.常用pom.xml-------------心急的直接拉到最后,看代码库的配置。

    <?xml version="1.0" encoding="UTF-8"?>
    <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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.3.5.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>com.jiulong</groupId>
        <artifactId>jiulong</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <name>jiulong</name>
        <description>九龙项目</description>
    
        <properties>
            <java.version>1.8</java.version>
        </properties>
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>3.4.1</version>
            </dependency>
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <scope>runtime</scope>
            </dependency>
            <!-- 阿里巴巴连接池 -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid</artifactId>
                <version>1.2.3</version>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
    
            <!--数据校验springboot2.3.3之后去除了,需要手动添加-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-validation</artifactId>
            </dependency>
    
            <!--swagger文档依赖-->
            <dependency>
                <groupId>com.github.xiaoymin</groupId>
                <artifactId>knife4j-spring-boot-starter</artifactId>
                <version>3.0.1</version>
            </dependency>
            <!--SpringBoot的data-jpa,用于实体类自动生成表-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
            </dependency>
        </dependencies>
    
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    
        <!-- 代码库 -->
        <repositories>
            <repository>
                <id>maven-ali</id>
                <url>http://maven.aliyun.com/nexus/content/groups/public//</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                    <checksumPolicy>fail</checksumPolicy>
                </snapshots>
            </repository>
        </repositories>
    
    </project>
    愿你走出半生,归来仍是少年!
  • 相关阅读:
    使用ffmpeg向crtmpserver发布rtsp流
    crtmpserver流媒体服务器的介绍与搭建
    MySQL数据库权限体系介绍
    ES学习之分片路由
    I/O exception (java.net.SocketException) caught when processing request: Connect
    Jmeter测试报告生成
    JMeter:Dashboard Report自动生成测试报告的巧用和避坑
    MySQL备份工具之mysqldump使用
    mysql使用navicat和mysqldump导出数据
    mysql source命令超大文件导入方法总结
  • 原文地址:https://www.cnblogs.com/hujunwei/p/14186840.html
Copyright © 2011-2022 走看看