본문 바로가기

카테고리 없음

SpringBoot Jar 파일 만들기

/*build.gradle*/
dependencies {
	여러가지 등록된 라이브러리들
}


bootJar {
    jar.enabled = true
}


jar{
    manifest{
        attributes 'Title' : '프로젝트이름', 'Version': '0.0.1-SNAPSHOT' , 'Main-Class': 'com.example.패키지.클래스이름'   // main 함수가 있는 클래스이름
    }
    archiveName '프로젝트이름.jar'
    dependsOn configurations.runtime
    from {
        configurations.compile.collect {it.isDirectory()? it: zipTree(it)}
    }
}

 

 

 

gradle > clean 

gradle > jar 

gradle > build 

순서대로 해주면

 

프로젝트 경로의 build>libs 에 jar 파일이 생긴것을 볼 수 있따.