Maven archetype을 만들 때 가장 귀찮은 작업중의 하나는 META-INF/archetype.xml을 만드는 것이다. archetype-resources 밑에 표준 폴더 구조와 클래스, 파일들을 만드는 것은 힘들지 않지만 그 파일 정보를 일일히 archetype.xml에 source,resource,testSource등으로 구분해서 넣어주어야 한다.

Archetype이 단순하면야 뭐 어렵지 않겠지만 파일이 많고 폴더가 복잡한 경우 xml 편집만 해도 상당한 스트레스이다. 문제는 이 xml을 검증하는게 deploy하고 나중에 archetype기반으로 create할 때에 검증이 된다는 것이다. 기껏 올리고선 에러가 나서 살펴보면 xml 오타나 파일 추가한 것을 잊고 xml에 안올렸다거나 하는 것들이 많다.

결국 귀찮은 나머지 archetype-resources 폴더 아래의 모든 파일목록을 읽어서 분류한 후 자동으로 archetype.xml을 만들어 주는 간단한 유틸리티 코드를 만들기로 했다.

자바로 할까 하다가 Ruby 연습도 할 겸 TDD방식으로 해서 Ruby로 작성했다. 두개의 클래스를 만들었는데 만들고 나니 코드가 너무 간결해서 하나의 클래스로 해도 충분했을 듯 싶다.  Ruby의 각 클래스와 메소드에 익숙하지 않고 최적화된 코드가 뭔지 매번 생각하고 레퍼런스를 뒤져보는 것이 좀 불편한 점. 주변에 Ruby에 대해서 도와줄 사람이 없으니 혼자 이것 저것 뒤져가며 공부를 하면서 해야 하는 것이 제법 만만치 않다. 거기다 Eclipse/RDT plugin을 사용했지만 자동완성 기능이나 type browsing기능이 없는 것이 불편했고. 테스트 수행시 단순한 오타로 인한 fail이 30%쯤 되는 것 같다. RI view의 도움을 받아가며 겨우 겨우 작업해서 완성. 아직 넣지 않은 것은 siteResources인데.. 이건 site 만들 때 추가하면 될테고.

이제 archetype.xml 노가다 작업은 걱정하지 않아도 되겠다.

Ruby로 테스트코드 만들면서 가장 인상에 남았던 것은 mock만들기가 아주 아주 쉽다는 것이다. 자주 들은 이야기지만 실제 적용해보니 그 단순함에 감동을 했다.

파일은 src/main/ruby와 src/test/ruby에 있으면 되고. 실행할 때는 프로젝트 루트폴더가 current directory여야 한다. Eclipse에서 돌리면 디폴트 조건이다.

archetype_xml_writer.zip

그런데 혹시 Maven에 archetype.xml을 자동 생성해주는 기능이 이미 있는 것은 아닐까? 그렇다면 대략난감…

Related posts:

  1. 스프링 컨테이너에는 설정파일이 없다
  2. Maven 의존관계 수렁에 빠지다
  3. Maven POM에 attribute 사용하기 (2)
  4. Spring 3.0 (59) 프로퍼티 파일 이용하기 – placeholder vs SpEL
  5. Ruby on Maven
  6. Maven POM에 attribute 사용하기 (1)
  7. 톰캣 앞에 아파치 웹 서버(Httpd)를 두어야 할까?
  8. Maven 재도전기 (1)
  9. 파이썬 완벽 가이드 전자책
  10. Maven settings.xml의 비밀번호 암호화
  11. Ruby를 공부하면서…
  12. Maven 다중 리포지토리와 버전 범위를 사용할 때의 주의점
  13. Nexus Maven Repository 1.0 출시
  14. Maven 3.0과 버전 포맷 문제
  15. Spring 3.0 (34) R-941 스프링의 Maven 지원정책은?

Facebook comments:

to “Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter”

  1. I wanted to thank you for this excellent read!! I absolutely enjoyed every bit of it. I have got you saved as a favorite to look at new things you post…

  2. Excellent! I appreciate your input to this matter. It has been insightful. my blog: half marathon training schedule

  3. Keflex H1n1 Buy Cialis Keflex Sun Viagra A Lausanne Cialise

  4. Cialis 5mg Price With Coupon Comprar Priligy Online Contrareembolso Buy Cialis What Does Keflex Reaction Look Like Kamagra Generique Canada

  5. If you are ready to watch comical videos online then I suggest you to pay a visit this web page, it includes in fact so humorous not only movies but also additional data.

  6. Im grateful for the article post.Really looking forward to read more. Keep writing.

  7. Howdy! This post could not be written much better! Going through this article reminds me of my previous roommate! He continually kept preaching about this. I most certainly will forward this information to him. Fairly certain he’s going to have a very good read. Thank you for sharing!

  8. the time to read or take a look at the content material or websites we ave linked to below the

  9. What as up mates, how is all, and what you wish for to say concerning this article, in my view its genuinely amazing designed for me.

  10. check beneath, are some totally unrelated sites to ours, on the other hand, they’re most trustworthy sources that we use

  11. Good article. I absolutely appreciate this website. Thanks!

  12. Really appreciate you sharing this blog.Really looking forward to read more. Awesome.

  13. Thank you ever so for you article post.Thanks Again. Cool.

  14. The Search Engine Optimization services they provide are tailored to meet

  15. Sites we like the time to read or visit the content or sites we have linked to below the

  16. very nice submit, i definitely love this website, keep on it

  17. fast loans with bad credit http://loanpaydaythz.com/ – cash advance loans bad credit personal loan pay day advance easy cash loans

  18. I went over this web site and I conceive you have a lot of great information, saved to bookmarks (:.

  19. When I originally commented I appear to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I get 4 emails with the same comment. There has to be a way you can remove me from that service? Cheers.

  20. Major thankies for the blog article.Really looking forward to read more. Fantastic.

  21. I truly appreciate this blog.Thanks Again. Awesome.

  22. Really appreciate you sharing this article post. Great.

  23. Everything is very open with a precise explanation of the issues. It was truly informative. Your site is extremely helpful. Many thanks for sharing.

  24. Some really prime posts on this web site , saved to bookmarks.

  25. It as not that I want to copy your web page, but I really like the style. Could you let me know which theme are you using? Or was it especially designed?

  26. please visit the internet sites we stick to, which includes this 1, as it represents our picks from the web

  27. The next time I read a blog, I hope that it does not fail me just as much as this particular one. After all, I know it was my choice to read, nonetheless I actually thought you would probably have something interesting to say. All I hear is a bunch of moaning about something that you could fix if you were not too busy searching for attention.

  28. Merely wanna comment that you have a very decent web site, I enjoy the design it really stands out.

  29. longchamp le pliage ??????30????????????????5??????????????? | ????????

  30. MANIC STREET PREACHERS I Think Ive Found It Shalala.ru

  31. Every when inside a whilst we pick blogs that we read. Listed beneath would be the newest sites that we choose

  32. When I initially left a comment I seem to have clicked the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I recieve four emails with the exact same comment. Perhaps there is a means you can remove me from that service? Thank you.

  33. cash online http://paydaylenderstyu.com/ – instant loans for bad credit loans pay day quick loans for bad credit direct payday lender

  34. one of our visitors not long ago proposed the following website

  35. Ahaa, its good discussion concerning this post at this place at this web site, I have read all
    that, so at this time me also commenting here.

  36. Buy Roche Propecia Online Uk http://cialibuy.com – Buy Cialis buy accutane mastercard Cialis Cheapest Generic Viagra

  37. Link exchange is nothing else but it is only placing the other person as webpage link on your page at suitable place and other person will also do similar in support of you.

  38. I truly appreciate this blog article.Much thanks again. Much obliged.

  39. I was recommended this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my trouble. You are incredible! Thanks!

  40. Excellent post! We are linking to this particularly great article on our site. Keep up the great writing.

  41. Much like a few of the different hacks on our website, like
    our AppNana Hack as an example, our roblox hack routinely makes use of a brand new proxy
    connection when new instances are made.

  42. Its hard to find good help I am constantnly saying that its difficult to procure good help, but here is

  43. Just Browsing While I was browsing yesterday I saw a great article concerning

  44. I really liked your article post.Much thanks again. Cool.

  45. instant loans online http://cashfastlot.com/ – instant loan direct payday lender payday america direct payday lender

  46. My programmer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the costs.
    But he’s tryiong none the less. I’ve been using Movable-type on a variety
    of websites for about a year and am worried about switching to another platform.
    I have heard fantastic things about blogengine.net.

    Is there a way I can import all my wordpress posts into it?
    Any help would be really appreciated!

  47. loan today http://cashonlinesbj.com/ – cashnet usa loans for poor credit pay day loan online national cash advance

  48. Please pay a visit to the sites we adhere to, including this 1, because it represents our picks in the web.

  49. Amoxicillin Maximum Adult Dose http://cialibuy.com – Cialis Viagra Levitra Cialis Online Buy Cialis Cheap Cialis From Canada

  50. Keflex A Form Of Amoxicillin http://cialibuy.com – Buy Cialis Levitra Dosage Pharmacie online pharmacy How Do Guys Last Longer

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2017 Toby's Epril Suffusion theme by Sayontan Sinha