Maven工作记录

快速安装

wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
vi /etc/profile
export M2_HOME=/usr/local/maven36
export PATH=$PATH:$M2_HOME/bin
source /etc/profile
验证 : mvn -v

仓库jar手动安装

oracle jdbc 驱动为例

mvn install:install-file -DgroupId=com.oracle "-DartifactId=ojdbc14" "-Dversion=10.2.0.2.0" "-Dpackaging=jar" "-Dfile=D:\ojdbc14.jar"

阿里云镜像

setting.xml文件设置

<mirrors>
    <mirror>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
</mirrors>

工程pom.xml文件设置

<repositories>
    <repository>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

批量更新maven工程版本号

mvn versions:set ‐DnewVersion=1.0.1‐SNAPSHOT
posted @ 2021-01-07 22:38  天蓝隐湘  阅读(92)  评论(0编辑  收藏  举报