github作为maven仓库使用自定义jar

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014218318/article/details/82560015

maven使用自己github的类库

1.安装git及上传项目至git(这里不再描述具体步骤)

2.配置本地maven项目的pom文件

    <url>http://maven.apache.org</url>
    <repositories>
        <repository>
            <id>shopManager</id>   //对应仓库项目的 artifactId
            <name>shopManager Maven Webapp</name> //对应仓库中的 name
            <url>https://github.com/helloworld/shop_manage.git</url> //对应仓库项目的url
        </repository>
    </repositories>

3.直接引入git中的包

        <dependency>
            <artifactId>shopManager</artifactId>
            <groupId>com</groupId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>

4.在本地项目中就可以直接使用git上的资源了

package com;

import com.shopManager.util.FileUtil;

public class DemoTest {

    public static void main(String[] args) {
        FileUtil fu = new FileUtil();
        fu.uploadFiles(request, toFtpPath);
        System.out.println(123);
    }

}

5. 来自一个程序员的笔记, 纸上得来终觉浅。帮助别人就是帮助自己, 分享快乐。

猜你喜欢

转载自blog.csdn.net/u014218318/article/details/82560015