zoukankan      html  css  js  c++  java
  • Maven

    1.配置多仓库

    <repositories>
        <repository>
            <!-- 仓库id -->
            <id>public-repository</id>
            <!-- 仓库名 -->
            <name>public repository</name>
            <!-- 仓库的url地址 -->
            <url>http://nexus.intra.xxxx.com/content/groups/public</url>
        </repository>
        <repository>
            <!-- 仓库id -->
            <id>private-repository</id>
            <!-- 仓库名 -->
            <name>private repository</name>
            <!-- 仓库的url地址 -->
            <url>http://nexus.intra.xxxx.com/content/groups/private</url>
        </repository>
    </repositories>

    2.排除不需要的JAR包

    例如:spring-core会自动引入commons-logging-1.2。当我们添加其他依赖的时候,有可能也会自动引入commons-logging,而且版本有可能不是1.2,这个时候这两个commons-logging就会互相冲突,需要使用 <exclusions> 排除那个不想要的JAR包。

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>4.3.6.RELEASE</version>
        <exclusions>
            <exclusion>
                <artifactId>commons-logging</artifactId>
                <groupId>commons-logging</groupId>
            </exclusion>
        </exclusions>
    </dependency> 

    3.项目启动报Attempted to load applicationConfig: [classpath:/application.yml] but snakeyaml was not found on the classpath

    试图加载applicationconfig:[classpath:/application.yml] 但在类路径上找不到snakeyaml。在pom文件中手动加入对snakeyaml的依赖即可。

    <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
    </dependency>
  • 相关阅读:
    在ubuntu系统使用SSR
    Pandas库
    Numpy
    06-Python之标准库
    do{}while(0)
    inet_XX族函数
    大端小端
    c++ 强制类型转换
    auto类型推导
    const浅析
  • 原文地址:https://www.cnblogs.com/helios-fz/p/11077150.html
Copyright © 2011-2022 走看看