当前位置:   article > 正文

使用gitee创建远程maven仓库_gitee创建maven项目

gitee创建maven项目

1. 创建一个项目作为远程仓库

在这里插入图片描述

2. 打包项目发布到远程仓库

id随意,url是打包到哪个文件夹里面
在需要打包的项目的pom中添加

    <distributionManagement>
        <repository>
            <id>handsomehuang-maven</id>
            <url>file:D:/workspace/java/2023/repo/maven-repository/</url>
        </repository>
    </distributionManagement>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

3. 将打包的项目push到远程仓库

记得先关联起来…

git add .
git commit -m "commit"
git push -u origin "master"
  • 1
  • 2
  • 3

4. 使用远程仓库

    <dependencies>
     <!--   使用远程仓库的maven    -->
        <dependency>
            <groupId>com.huang.lightweight</groupId>
            <artifactId>lightweight-client-spring-boot-starter</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>
    
     <!--   配置一个远程仓库   -->
    <repositories>
        <repository>
            <!--   随意    -->
            <id>handsomehuang-maven</id>
                <!--   {仓库地址}/raw/分支    -->
            <url>https://gitee.com/huangjianguo2000/maven-repository/raw/master</url>
        </repository>
    </repositories>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号