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. Zithromax Identification http://buycialisuss.com – Cialis Propecia Abgelaufen cialis 5mg Free Shipping Levaquin Medicine Online Overseas

  2. that will be the end of this write-up. Here youll come across some web sites that we feel youll appreciate, just click the links over

  3. Oh my goodness! Incredible article dude! Thank you, However I am encountering problems with your RSS. I don’t understand the reason why I cannot subscribe to it. Is there anyone else getting similar RSS issues? Anyone that knows the answer can you kindly respond? Thanx!

  4. There as definately a lot to learn about this topic. I really like all the points you made.

  5. You ought to take part in a contest for one of the finest blogs on the net. I’m going to recommend this web site!

  6. This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your wonderful post. Also, I have shared your site in my social networks!

  7. I’m amazed, I must say. Seldom do I come across a blog that’s equally educative and entertaining, and let me tell you, you have hit the nail on the head. The problem is an issue that not enough people are speaking intelligently about. I am very happy that I came across this during my hunt for something regarding this.

  8. I used to be able to find good advice from your blog posts.

  9. below you will find the link to some web sites that we assume you’ll want to visit

  10. I blog quite often and I truly thank you for your content. This article has really peaked my interest. I’m going to book mark your site and keep checking for new details about once per week. I opted in for your Feed too.

  11. Wow, wonderful blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is magnificent, let alone the content!

  12. pretty useful material, overall I feel this is well worth a bookmark, thanks

  13. buying research papers online http://researchpapershrd.com/ – can i pay someone to write my research paper custom research paper writing help to write research paper best site to buy research papers

  14. This is one awesome article post.Thanks Again. Really Great.

  15. short training method quite a lot to me and also also near our position technicians. Thanks; on or after all people of us.

  16. your placement in google and could damage your high-quality score if advertising and marketing with Adwords.

  17. It’s hard to come by knowledgeable people about this subject, however, you seem like you know what you’re talking about! Thanks

  18. Yes, you are correct friend, on a regular basis updating weblog is really essential in favor of SEO. Nice discussion keeps it up.

  19. Way cool! Some very valid points! I appreciate you writing this post plus the rest of the site is really good.

  20. Pretty! This was an incredibly wonderful article. Thanks for providing this info.

  21. You are my inhalation, I have few blogs and infrequently run out from brand . Actions lie louder than words. by Carolyn Wells.

  22. This blog is obviously awesome as well as informative. I have picked a bunch of handy advices out of this source. I ad love to return over and over again. Thanks a lot!

  23. understands what they are discussing on the net.

  24. This is very interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your wonderful post. Also, I have shared your web site in my social networks!

  25. This awesome blog is definitely cool and informative. I have found a bunch of helpful tips out of it. I ad love to visit it again soon. Thanks!

  26. Wow! This could be one particular of the most useful blogs We ave ever arrive across on this subject. Actually Fantastic. I am also an expert in this topic so I can understand your hard work.

  27. The info talked about inside the article are a number of the ideal offered

  28. Every when in a even though we decide on blogs that we read. Listed below would be the most up-to-date internet sites that we opt for

  29. Nice Post. It as really a very good article. I noticed all your important points. Thanks.

  30. very handful of websites that happen to become in depth below, from our point of view are undoubtedly nicely worth checking out

  31. Wow! This could be one particular of the most beneficial blogs We ave ever arrive across on this subject. Actually Fantastic. I am also a specialist in this topic so I can understand your hard work.

  32. It as not that I want to replicate your internet site, but I really like the style and design. Could you tell me which theme are you using? Or was it especially designed?

  33. check below, are some totally unrelated internet websites to ours, on the other hand, they’re most trustworthy sources that we use

  34. Thanks for sharing, this is a fantastic blog article.Really looking forward to read more. Really Cool.

  35. Spot on with this write-up, I absolutely believe that this site needs a lot more attention. I’ll probably be back again to read through more, thanks for the information.

  36. I could not resist commenting. Perfectly written!

  37. An outstanding share! I’ve just forwarded this onto a colleague who has been doing a little research on this. And he actually ordered me lunch due to the fact that I discovered it for him… lol. So allow me to reword this…. Thanks for the meal!! But yeah, thanx for spending time to discuss this subject here on your internet site.

  38. Your style is so unique in comparison to other people I’ve read stuff from. Many thanks for posting when you’ve got the opportunity, Guess I will just bookmark this site.

  39. Sites of interest we have a link to

  40. the time to read or go to the content material or web sites we have linked to beneath the

  41. lwkskm buy viagra online canada pharmacy buy cialis online canada pharmacy
    canadian pharmacy for viagra cialis globalpharmacycanada.com

  42. An outstanding share! I’ve just forwarded this onto a co-worker who has been conducting a little homework on this. And he actually ordered me lunch simply because I stumbled upon it for him… lol. So allow me to reword this…. Thanks for the meal!! But yeah, thanx for spending the time to talk about this topic here on your blog.

Leave a Reply to sling tv Cancel 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