[Open Source Project] JitPack์— ๋‚ด๊ฐ€ ๋งŒ๋“  Library & Framework ์˜ฌ๋ฆฌ๊ธฐ

2022. 12. 10. 00:53ใ†๊ฐœ๋… ์ •๋ฆฌ ์ž‘์—…์‹ค/Java

728x90
๋ฐ˜์‘ํ˜•

 

 

 

 

 

ํ˜ผ์ž ๊ณต๋ถ€ํ•˜๋Š” ์ž๋ฐ”:JAVA 8 & 11 ์ง€์›/๋ฌด๋ฃŒ ๋™์˜์ƒ ๊ฐ•์˜ ์ œ๊ณต

COUPANG

www.coupang.com

 

 

Do it! ์ž๋ฐ” ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ž…๋ฌธ : ๊ฐœ๋ฐœ 10๋…„ ๊ฐ•์˜ 10๋…„ ๋ช…๊ฐ•์‚ฌ์˜ ๊ธฐ์ดˆํŠผํŠผ ์ฝ”๋”ฉ ๋ฐฅ์ƒ

COUPANG

www.coupang.com

 

 

Java์˜ ์ •์„:์ตœ์‹  Java 8.0 ํฌํ•จ

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 



๐Ÿ—‚ ๋ชฉ์ฐจ

โ—[Open Source Project] JitPack์— ๋‚ด๊ฐ€ ๋งŒ๋“  Library & Framework ์˜ฌ๋ฆฌ๊ธฐ 
โ—

 

 

๐Ÿš€ ๋‚˜๋งŒ์˜ Library & Framework ๊ณต์œ ํ•˜๊ธฐ

    ๐Ÿ”ฝ ๊ฐœ์š”

        ๐Ÿ“ฆ ์†Œ๊ฐœ

๊ฐœ๋ฐœ์ž์—๊ฒŒ ์žˆ์–ด ๋‚ด๊ฐ€ ๋งŒ๋“  ์ฝ”๋“œ๋ฅผ ๋ˆ„๊ตฐ๊ฐ€ ์‚ฌ์šฉํ•œ๋‹ค๋Š” ๊ฒƒ์€ ๊ต‰์žฅํžˆ ์„ค๋ ˆ๋Š” ์ผ์ด๊ณ , ๋ฟŒ๋“ฏํ•œ ์ผ์ด ๋  ๊ฒƒ์ด์—์š”.
Exception์„ ํ•ด๊ฒฐํ•ด์„œ ๊ตฌ๋™๋˜๋Š” ๋ชจ์Šต์„ ๋ณด์•„๋„ ๋„ˆ๋ฌด ํฅ๋ถ„๋˜๊ณ , ์ข‹์ง€๋งŒ ๋” ๋‚˜์•„๊ฐ€ ๋‚ด๊ฐ€ ๋งŒ๋“  ์ฝ”๋“œ๋ฅผ ๋ˆ„๊ตฐ๊ฐ€๊ฐ€ ์“ด๋‹ค๋Š” ๊ฒƒ์€ ๋”์šฑ ๊ธฐ๋ถ„ ์ข‹์€ ์ผ์ด ์•„๋‹๊นŒ ์ƒ๊ฐ๋˜์š”.

์ฃผ๋‹ˆํ•˜๋ž‘์€ ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค Side Project๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ ์šฐ๋ฆฌ๊ฐ€ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” Library๋‚˜, Framework๋ฅผ ๋งŒ๋“ค์–ด์„œ ๋ฐฐํฌํ•˜์ž๊ณ  ์ฃผ์žฅํ•˜์˜€์–ด์š”.

๊ทธ๋ ‡๊ฒŒํ•ด์„œ ๋ˆ„๊ตฐ๊ฐ€์™€ ์†Œํ†ตํ•˜๋ฉด์„œ ์ง€์†์ ์œผ๋กœ ์ข‹์€ ์ฝ”๋“œ๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค๋ฉด ๊ฒŒ์ž„๋ณด๋‹ค ๋” ์žฌ๋ฐŒ๋Š” ๊ฒŒ์ž„์ด ๋  ๊ฒƒ์ด๋ผ ์ƒ๊ฐํ•ด์š”.

์ด๋ฒˆ ๊ธ€์—์„œ๋Š” Jitpack์„ ํ†ตํ•ด Library๋ฅผ ๋งŒ๋“ค์–ด ์˜ฌ๋ฆฌ๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์ •๋ฆฌ๋ฅผ ํ•ด๋ณด๋ ค ํ•ฉ๋‹ˆ๋‹ค.

JAVA์™€ Gradle Build Tool์„ ์ด์šฉํ•˜๊ณ , Github์„ ํ†ตํ•ด์„œ Library๋ฅผ ๋ฐฐํฌํ•ด ๋ณด๋ คํ•ด์š”.

์ฐธ๊ณ ๋กœ maven central repository์— ์˜ฌ๋ฆฌ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ๋Š”๋ฐ, ๋„ˆ๋ฌด ๊นŒ๋‹ค๋กญ๊ณ  ์–ด๋ ค์›Œ์„œ ์ข€ ๋” ํŽธํ•˜๊ฒŒ JitPack์„ ์‚ฌ์šฉํ•ด ๋ณด๋ ค๊ณ  ํ•ด์š”.

 

 

 

        ๐Ÿ“ฆ Project ์ค€๋น„

์ตœ์ดˆ ์ฃผ๋‹ˆํ•˜๋ž‘์€ ์œ„์™€ ๊ฐ™์ด Project๋ฅผ ์ค€๋น„ํ•˜์—ฌ ์ฃผ์—ˆ์–ด์š”.
Web ๊ฐœ๋ฐœ Project๊ฐ€ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— ์œ„์™€ ๊ฐ™์ด Java๋ฅผ ์ด์šฉํ•˜์—ฌ ์ฃผ์—ˆ์–ด์š”.

์ฐธ๊ณ ๋กœ ์ฃผ๋‹ˆํ•˜๋ž‘์€ GrupID๋ฅผ github์„ ํ†ตํ•ด ๋ฐฐํฌํ•  ๊ฒƒ์ด๊ณ , ์กฐ์ง์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•ด ์ฃผ์—ˆ์–ด์š”.
io.github.{์กฐ์ง ํ˜น์€ ๊ณ„์ • ์ด๋ฆ„}


apply plugin: 'java'
apply plugin: 'maven-publish'

//plugins {
//    id 'java'
//}

group 'io.github.JunyHarang-Open-Source-project'
version '1.0-SNAPSHOT'

sourceCompatibility = 11
targetCompatibility = 11

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
    // https://mvnrepository.com/artifact/org.projectlombok/lombok
    compileOnly 'org.projectlombok:lombok:1.18.24'
    // https://mvnrepository.com/artifact/commons-codec/commons-codec
    implementation 'commons-codec:commons-codec:1.15'
    testImplementation 'org.assertj:assertj-core:3.21.0'
}

java {
    withSourcesJar()
    withJavadocJar()
}

publishing {
    publications {
        maven(MavenPublication) {
            from components.java
        }
    }
}

wrapper {
    gradleVersion = "7.5.1"
    distributionType = Wrapper.DistributionType.ALL
}

test {
    useJUnitPlatform()
}
728x90


Build.gradle ๊ฐ™์€ ๊ฒฝ์šฐ Jitpack ์˜ˆ์ œ์— ๋งž์ถฐ์„œ ์ผ๋ถ€ ๋ณ€ํ˜•์„ ํ•ด ์ฃผ์—ˆ์–ด์š”.

 

 

    ๐Ÿ”ฝ  JitPack

        ๐Ÿ“ฆ ์ค€๋น„ํ•˜๊ธฐ

JitPack์€ JVM Libary Deploy Platform์œผ๋กœ ๊นŒ๋‹ค๋กœ์šด ์ธ์ฆ, ์„ค์ •์—†์ด JitPack์— ์›ํ•˜๋Š” Build ๊ฒฐ๊ณผ๋ฌผ๋งŒ ๋‚ด๋†“์„ ์ˆ˜ ์žˆ๋Š” Project๋ผ๋ฉด Github ๋“ฑ Repository ์กด์žฌ๋งŒ์œผ๋กœ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๊ณ  ์žˆ์–ด์š”.

์ตœ์ดˆ ์ž‘์—…ํ•˜๊ธฐ์— ์•ž ์จ Project Directory ์ตœ์ƒ์œ„ ๊ฒฝ๋กœ์— jitpack.yml์ด๋ผ๋Š” Script๋ฅผ ๋งŒ๋“ค๊ณ , ๋‚ด๋ถ€์— JDK Version์„ ๋ช…์‹œํ•ด ์ฃผ์–ด์•ผ ํ•ด์š”.

jitpack.yml



JitPack์€ ๊ธฐ๋ณธ์ ์œผ๋กœ Build๋ฅผ jdk 1.8๋กœ ์ˆ˜ํ–‰ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ด์™€ ๋‹ค๋ฅธ Version์„ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ ๋ฐฐํฌ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ด๋ค„์ง€์ง€ ์•Š์„ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด์—์š”.

์ด์ œ Github์— Project๋ฅผ ์ค€๋น„ํ•ด ๋‘์–ด์•ผ ํ•ด์š”.

์ฃผ๋‹ˆํ•˜๋ž‘์˜ Project๋Š” ์ด ๊ณณ์—์„œ ๋งŒ๋‚˜๋ณผ ์ˆ˜ ์žˆ๋„๋ก ์ค€๋น„ํ•ด ๋‘˜๊ฒŒ์š”.


https://github.com/JunyHarang-Open-Source-project/Data-Aes-Secret
https://github.com/JunyHarang-Open-Source-project/Data-Aes-Secret



๊ทธ๋Ÿฐ ๋’ค ์œ„์™€ ๊ฐ™์ด Github Release๋ฅผ ์ˆ˜ํ–‰ํ•ด ์ค๋‹ˆ๋‹ค.




๋ฐ˜์‘ํ˜•


๊ทธ๋Ÿฐ ๋’ค JitPack(https://jitpack.io)๋กœ ์ด๋™ํ•˜์—ฌ ํ•ด๋‹น Project Repository ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜๊ณ , Look up์„ ๋ˆŒ๋Ÿฌ์ค„๊ฒŒ์š”.


๊ทธ๋Ÿผ ์œ„์™€ ๊ฐ™์ด Github์—์„œ ์ˆ˜ํ–‰ํ–ˆ๋˜ Realese Version์ด ๋‚˜์˜ค๋Š”๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.



์กฐ๊ธˆ ๊ธฐ๋‹ค๋ฆฐ ๋’ค Get it Button ์œ„์™€ ๊ฐ™์ด ์ดˆ๋ก์ƒ‰์œผ๋กœ ๋‚˜์˜ค๋ฉด ์ •์ƒ์ ์œผ๋กœ Build๊ฐ€ ์ˆ˜ํ–‰๋œ ๊ฒƒ์ด์—์š”.

๋งŒ์•ฝ ์‹คํŒจํ–ˆ๋‹ค๋ฉด Log ์•„๋ž˜ ๋ฌธ์„œ ๋ชจ์–‘ Button์ด ๋นจ๊ฐ„์ƒ‰์ด ๋˜๊ณ , Status๊ฐ€ Report๋กœ ๋ณ€ํ•˜๊ฒŒ ๋  ๊ฑฐ์—์š”.
ํ•ด๋‹น ์˜ˆ์ œ Log ๋‚ด์šฉ์€ ์ด ๊ณณ์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋„๋ก ์ค€๋น„ํ•ด ๋‘์—ˆ์–ด์š”.

 


์œ„ ๊ณผ์ •์„ ์ˆ˜ํ–‰ํ•œ ๋’ค ์•„๋ž˜์— ๋‚˜์™€์žˆ๋Š” ๋‚ด์šฉ๋“ค์— ๋Œ€ํ•ด build.gradle์— ์ž…๋ ฅ์„ ํ•ด์ฃผ๋ฉด ์™ธ๋ถ€ Project์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์š”.






 

 

    ๐Ÿ”ฝ  ํ™•์ธํ•˜๊ธฐ

        ๐Ÿ“ฆ ๋‹ค๋ฅธ Project์—์„œ ์˜์กด์„ฑ ์ถ”๊ฐ€ํ•ด ๋ณด๊ธฐ

build.gradle


์ตœ์ดˆ ์œ„์™€ ๊ฐ™์ด dependencies{} ์œ„์— allprojects{} ๋‚ด์šฉ์„ ๋„ฃ์–ด ์ฃผ์—ˆ์–ด์š”.

๊ทธ๋Ÿฐ ๋’ค dependencies์— ์‹ค์ œ ์ถ”๊ฐ€ํ•  ์˜์กด์„ฑ ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•ด ์ค๋‹ˆ๋‹ค.

dependencies {
		...
    // Data ์•”/๋ณตํ˜ธํ™” ์˜์กด์„ฑ ์ถ”๊ฐ€
    implementation 'com.github.JunyHarang-Open-Source-project:Data-Aes-Secret:1.0.0b'
    	...
}




ํ˜„์žฌ ์œ„์™€ ๊ฐ™์ด Data ์•”ํ˜ธํ™” Logic์— ๋Œ€ํ•œ Class๊ฐ€ ์—†๋Š”๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.


package com.giggalsspeople.itding.common.config.util;

import com.junyharang.datasecret.DataAesSecret;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import static org.springframework.test.util.AssertionErrors.assertEquals;

class DataSecretTest {

    @Test
    @DisplayName("์ฃผ์š” ๋ฐ์ดํ„ฐ AES ์•”/๋ณตํ˜ธํ™” ํ™•์ธ")
    void majorDataAES128Check() {
        String encryptionKeyValue = "์ข‹์€ ์„œ๋น„์Šค๋ฅผ ๋งŒ๋“ค์–ด์š”! ๐Ÿ˜€";
        String plainText = "์šฐ๋ฆฌ ๊ธฐ๊น”๋‚˜๋Š” ์‚ฌ๋žŒ๋“ค์€ ํ•  ์ˆ˜ ์žˆ๋‹ค!!";
        int[] algorithmLengthArray = {5, 128, 192, 256, 512 , 1024};

        String encryptionKey = DataAesSecret.base64Encoder(encryptionKeyValue);
        System.out.println("Base64 Encoding encryptionKeyValue : " + encryptionKey);

        for (int algorithmLength : algorithmLengthArray) {
            if (algorithmLength == 128) {
                System.out.println("AES-128 Mode๋กœ ์•”/๋ณตํ˜ธํ™” ์‹ค์‹œ");
            } else if (algorithmLength == 192) {
                System.out.println("AES-192 Mode๋กœ ์•”/๋ณตํ˜ธํ™” ์‹ค์‹œ");
            } else if (algorithmLength == 256) {
                System.out.println("AES-256 Mode๋กœ ์•”/๋ณตํ˜ธํ™” ์‹ค์‹œ");
            } else {
                System.out.println("AES-128 Mode๋กœ ์•”/๋ณตํ˜ธํ™” ์‹ค์‹œ");
            }

            String encryptionContent = DataAesSecret.aesSecret(algorithmLength, encryptionKey, plainText, 1);
            System.out.println("์•”ํ˜ธํ™”๋œ ๋‚ด์šฉ(Encrypted Value) : " + encryptionContent);

            String decryptionBoardContent = DataAesSecret.aesSecret(algorithmLength, encryptionKey, encryptionContent, 2);
            System.out.println("๋ณตํ˜ธํ™”๋œ ๋‚ด์šฉ(Decrypted Value) : " + decryptionBoardContent);
            assertEquals("์ •์ƒ ์ฒ˜๋ฆฌ ์™„๋ฃŒ", plainText, decryptionBoardContent);
        }
    }


์œ„์™€ ๊ฐ™์ด Test Code๋ฅผ ๋งŒ๋“ค๊ณ  ๋Œ๋ ค ๋ณด๋ฉด


์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰๋˜๋Š” ๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”.


์ฃผ๋‹ˆํ•˜๋ž‘์ด ๋งŒ๋“  ์ฃผ์š” Data AES ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ด์šฉํ•œ ์•”/๋ณตํ˜ธํ™” Library๊ฐ€ ํ•„์š”ํ•˜์‹œ๋‹ค๋ฉด ์˜์กด์„ฑ์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์„ธ์š” ๐Ÿ˜€







 

๐Ÿง ์ฐธ๊ณ  ์ž๋ฃŒ

 

jitpack, github๋ฅผ ์ด์šฉํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฐฐํฌํ•˜๊ธฐ

๋‚˜๋งŒ์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋งŒ๋“ค์–ด์„œ ๋ฐฐํฌํ•ด๋ด…์‹œ๋‹ค! Bearer ํ† ํฐ ์ถ”์ถœ์„ ์กฐ๊ธˆ ๋” ์‰ฝ๊ฒŒ ํ•  ์ˆ˜ ์—†์„๊นŒ ๋กœ๊ทธ์ธ, ์ธ์ฆ/์ธ๊ฐ€ ๊ณผ์ •์€ ์–ด๋Š ํ”„๋กœ์ ํŠธ๋ฅผ ํ•˜๋”๋ผ๋„ ์ถ”๊ฐ€ํ•˜๊ฒŒ ๋˜๊ธฐ ๋งˆ๋ จ์ธ๋ฐ์š”, ์ด ๊ณผ์ •์—์„œ Authoriza

creampuffy.tistory.com

 

 

ํ˜ผ์ž ๊ณต๋ถ€ํ•˜๋Š” ์ž๋ฐ”:JAVA 8 & 11 ์ง€์›/๋ฌด๋ฃŒ ๋™์˜์ƒ ๊ฐ•์˜ ์ œ๊ณต

COUPANG

www.coupang.com

 

 

Do it! ์ž๋ฐ” ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ž…๋ฌธ : ๊ฐœ๋ฐœ 10๋…„ ๊ฐ•์˜ 10๋…„ ๋ช…๊ฐ•์‚ฌ์˜ ๊ธฐ์ดˆํŠผํŠผ ์ฝ”๋”ฉ ๋ฐฅ์ƒ

COUPANG

www.coupang.com

 

 

Java์˜ ์ •์„:์ตœ์‹  Java 8.0 ํฌํ•จ

COUPANG

www.coupang.com

"์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค."

 

 

 

 

 

 

 

 

728x90
๋ฐ˜์‘ํ˜•