Spring Roo addon 개발환경 구성하기 - 5. Spring Roo addon 디버깅





지금까지 Spring Roo 를 디버깅하기 위해 오랬동안 돌아왔습니다.

이제 그 결실을 맞보러~





Spring Roo addon 디버깅




1. 새로운 roo 프로젝트 생성


> roo-dev




Listening for transport dt_socket at address: 6889



____ ____ ____



/ __ \/ __ \/ __ \



/ /_/ / / / / / / /



/ _, _/ /_/ / /_/ /



/_/ |_|\____/\____/ 1.1.5.RELEASE [rev d3a68c3]





Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.



roo>




dt_socket 6889 번 포트로 리스닝 중이라는 멘트와 함께 Roo Shell 이 실행되었습니다.


아래의 roo script 를 이용하여 프로젝트를 구성합니다.



project --topLevelPackage kr.co.vicki.roo.sample.rentshop

persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY

entity --class ~.domain.Car --testAutomatically

field string --fieldName modelName --notNull

field number --fieldName displacement --type java.lang.Integer --notNull 0

entity --class ~.domain.Customer --testAutomatically

field string --fieldName name --notNull

entity --class ~.domain.Rent --testAutomatically

field reference --fieldName car --type ~.domain.Car --notNull

field number --fieldName period --type java.lang.Integer --notNull 0





2. STS 디버깅 환경 설정


이전 포스트에서 설정한 포트를 이용하여 Remote Java Application 설정을 구성합니다.










3. Web MVC Controller Add-on 디버깅


프로젝트도 만들었고 디버깅할 수 있는 환경도 구성되었습니다.


org.springframework.roo.addon.web.mvc.controller 프로젝트의 아래 소스코드를 열어서 중단점을 설정합니다.

/org.springframework.roo.addon.web.mvc.controller/src/main/java/org/springframework/roo/addon/web/mvc/controller/ControllerOperationsImpl.java







위에서 구성하였던 Remote Java Application 를 실행합니다.



아래와 같이 roo 명령을 실행하면 STS 에서 디버깅이 가능합니다.




____ ____ ____



/ __ \/ __ \/ __ \



/ /_/ / / / / / / /



/ _, _/ /_/ / /_/ /



/_/ |_|\____/\____/ 1.1.5.RELEASE [rev d3a68c3]





Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.



roo>


controller all --package ~.web







처음 디버깅 할 경우 source 에 대한 경로 설정이 되어 있지 않기 때문에 아래의 캡쳐 이미지를 참조하여 source 를 설정합니다.




STS 디버깅 소스 설정





이제~ Spring Roo Add-on 소스 중단 점을 디버깅 할 수 있게 되었습니다.








실제로 addon 을 개발하고 디버깅하는 것은 아니였지만, 제공되는 addon 을 디버깅 함으로써 flow 를 파악할 수 있게되었습니다.

후훗~






댓글

가장 많이 본 글