티스토리 뷰

intellij에서 spring프로젝트 gradle로 생성하기 - 제3편 jdbc, spring library import하기



좌측 project explorer에서 build.gradle를 더블클릭하고 아래와 같이 넣어준다.


소스코드는 아래와 같다.

group 'spring'
version '0.1'

apply plugin: 'java'
apply plugin: 'idea'

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile 'mysql:mysql-connector-java:5.1.6'
compile 'org.springframework:spring-webmvc:4.1.6.RELEASE'
compile 'org.springframework:spring-jdbc:4.1.6.RELEASE'
compile 'org.springframework:spring-test:4.1.6.RELEASE'

}



우측에 Gradle를 클릭하면 우측에 gradle build하는 메뉴가 열린다.


gradle메뉴에서 좌측 상단쯤에 +, - 버튼 왼쪽에 새로고침 버튼이 있다. 이걸 누른다.


누르면 jdbc, spring library가 받아진다.


잘 안받아지는 경우가 일반적이라서 여러번 시도해보고, intellij를 껐다가도 켜보고

build도 해보고 하다보면 받아진다.

한번도 한번에 받아진적이 없으나 여러번 시도해서 안된적도 없으니 이건 여러번 해보는 수밖에 없다.




위와 같이 External library에 mysql-jdbc랑 spring library가 들어오면 된다.



end.




공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함