引用github自己發布的jar包依賴及引用


<?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.2.5.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.jkstack</groupId>
    <artifactId>jk-sso-core</artifactId>
    <packaging>jar</packaging>
    <version>1.0.2</version>
    <name>jk-sso-core</name>
    <description>sso-core</description>

    <properties>
        <java.version>1.8</java.version>
        <github.global.server>github</github.global.server> <repository.directory>C://Users//Administrator//Desktop/</repository.directory>
    </properties>

    <dependencies>
        <!-- servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <!-- slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <!-- jedis -->
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>

            <!--github上傳插件,用於修改后的發布,執行mvn clean deploy自動打包上傳到github--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> <configuration> <altDeploymentRepository>internal.repo::default::file://${repository.directory}/jk-sso-core</altDeploymentRepository> </configuration> </plugin> <!--源碼--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>com.github.github</groupId> <artifactId>site-maven-plugin</artifactId> <version>0.12</version> <configuration> <message>Maven artifacts for ${project.artifactId}-${project.version}</message> <noJekyll>true</noJekyll> <outputDirectory>${repository.directory}/jk-sso-core</outputDirectory> <branch>refs/heads/master</branch> <merge>true</merge> <includes> <include>**/*</include> </includes> <repositoryName>jk-sso-core</repositoryName> <repositoryOwner>deadzq</repositoryOwner> </configuration> <executions> <execution> <goals> <goal>site</goal> </goals> <phase>deploy</phase> </execution> </executions> </plugin>
        </plugins>
    </build>

</project>

springboot pom文件更改藍色字體

maven settings.xml文件需要加入github賬戶

 

上圖為github倉庫(public)

 

 

對方引用:

springboot pom文件加入

   <repositories>
        <repository>
            <id>github</id>
            <url>https://raw.github.com/deadzq/jk-sso-core/master</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

引用依賴:

        <dependency>
            <groupId>com.jkstack</groupId>
            <artifactId>jk-sso-core</artifactId>
            <version>1.0.2</version>
        </dependency>

注意引用時不需要對方更改maven的settings.xml

 

OK

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM