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. Really appreciate you sharing this article post.Much thanks again. Really Cool.

  2. Hi, I do think this is an excellent website. I stumbledupon it ;) I may return once again since I book marked it. Money and freedom is the best way to change, may you be rich and continue to help other people.

  3. Just wanna tell that this is very helpful, Thanks for taking your time to write this.

  4. You’re so interesting! I don’t believe I’ve truly read anything like this before. So great to find somebody with some unique thoughts on this subject matter. Seriously.. many thanks for starting this up. This web site is one thing that is needed on the web, someone with a little originality.

  5. very handful of internet sites that come about to become comprehensive below, from our point of view are undoubtedly effectively really worth checking out

  6. This web site definitely has all of the info I needed about this subject and didn at know who to ask.

  7. very handful of websites that happen to be comprehensive below, from our point of view are undoubtedly effectively really worth checking out

  8. Spot on with this write-up, I truly believe this website needs far more attention. I’ll probably be returning to read more, thanks for the information!

  9. Oh my goodness! Impressive article dude! Thank you, However I am encountering troubles with your RSS. I don’t know why I am unable to subscribe to it. Is there anyone else getting identical RSS problems? Anybody who knows the solution will you kindly respond? Thanx!

  10. 3ir6N7 Magnificent website. Lots of helpful info here. I’а†m sending it to a few friends ans also sharing in delicious. And certainly, thanks on your sweat!

  11. Wonderful story, reckoned we could combine a few unrelated data, nonetheless really really worth taking a search, whoa did 1 understand about Mid East has got much more problerms too

  12. Here is a superb Weblog You might Obtain Fascinating that we Encourage You

  13. I precisely wished to appreciate you once more. I am not sure the things that I would have carried out without the entire aspects shared by you regarding that subject. It was actually an absolute alarming circumstance in my opinion, nevertheless taking note of a new professional fashion you dealt with that took me to jump for happiness. Now i am happier for the support and in addition wish you find out what a great job that you’re accomplishing teaching many people using your website. I am certain you’ve never got to know any of us.

  14. Informative article, exactly what I needed.

  15. Having read this I believed it was very informative. I appreciate you spending some time and energy to put this informative article together. I once again find myself personally spending a significant amount of time both reading and leaving comments. But so what, it was still worth it!

  16. Good article. I definitely love this site. Continue the good work!

  17. what is vardenafil used for https://vardenafilaxrg.com/ – slevotra vardenafil vardenafil tablets what is vardenafil used for vardenafil cost

  18. I really love your site.. Very nice colors & theme. Did you create this website yourself? Please reply back as I’m planning to create my own personal website and would love to learn where you got this from or just what the theme is called. Thanks.

  19. A motivating discussion is worth comment. There’s no doubt that that you ought to write more about this subject, it may not be a taboo matter but usually people don’t discuss such subjects. To the next! Best wishes!

  20. Usually I do not learn post on blogs, but I wish to say that this write-up very forced me to check out and do so! Your writing taste has been surprised me. Thank you, quite nice article.

  21. Regardless, I am definitely delighted I discovered it and I all be bookmarking it and

  22. Wonderful story, reckoned we could combine a number of unrelated data, nevertheless really really worth taking a look, whoa did one study about Mid East has got much more problerms at the same time

  23. check beneath, are some absolutely unrelated internet websites to ours, even so, they are most trustworthy sources that we use

  24. You’ve made some good points there. I looked on the net for more information about the issue and found most individuals will go along with your views on this website.

  25. Pretty nice post. I just stumbled upon your blog and wanted to say that I ave truly enjoyed browsing your blog posts. After all I will be subscribing to your feed and I hope you write again very soon!

  26. This website was… how do I say it? Relevant!! Finally I have found something which helped me. Many thanks.

  27. Everything is very open with a really clear clarification of the issues. It was definitely informative. Your website is extremely helpful. Many thanks for sharing!

  28. 6e4721 en lnea cialis coste menor

    cialis

    viagra for men over 50

    viagra cheap

    viagra et impuissanc

    viagra online pharmacy

  29. Every after in a although we decide on blogs that we study. Listed beneath would be the most recent web-sites that we choose

  30. Wow, awesome blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your website is fantastic, as well as the content!. Thanks For Your article about &.

  31. 3fa821 buy viagra in poland

    buy viagra

    cialis verkaufte aus kanada

    generic cialis

  32. 21f221 donde comprar cialis preci

    online cialis

    viagra for sale in cyprus

    buy viagra

  33. Hi, I do think this is a great web site. I stumbledupon it ;) I am going to return once again since I book marked it. Money and freedom is the best way to change, may you be rich and continue to guide other people.

  34. viagra or cialis https://buycialensf.com/ – cialis patent expiration generic cialis cialis pills cialis free trial once per year

  35. check below, are some absolutely unrelated web sites to ours, on the other hand, they’re most trustworthy sources that we use

  36. You need to be a part of a contest for one of the highest quality blogs on the net. I most certainly will recommend this website!

  37. Pretty! This was an incredibly wonderful post. Thank you for providing these details.

  38. d48321 canada tadalafil cialis

    cheap cialis online

    prix viagra cialis levitra

    viagra

    price of viagra pills

    canadian viagra

  39. This is the perfect web site for anyone who wishes to understand this topic. You understand a whole lot its almost hard to argue with you (not that I really will need to…HaHa). You definitely put a brand new spin on a subject that’s been discussed for ages. Great stuff, just wonderful.

  40. This is a topic which is near to my heart… Thank you! Exactly where can I find the contact details for questions?

  41. I really like reading through a post that can make men and women think. Also, many thanks for allowing for me to comment.

  42. please go to the web sites we comply with, including this 1, because it represents our picks in the web

  43. I’d like to thank you for the efforts you have put in penning this site. I’m hoping to see the same high-grade blog posts from you later on as well. In fact, your creative writing abilities has inspired me to get my very own website now ;)

  44. Every once in a when we choose blogs that we study. Listed beneath are the most up-to-date websites that we choose

  45. Thanks for the blog post.Thanks Again. click here

  46. This unique blog is obviously cool and also diverting. I have found a bunch of useful things out of this amazing blog. I ad love to go back over and over again. Cheers!

  47. I truly appreciate this blog post.Really thank you! Cool.

  48. Really enjoyed this blog post.Much thanks again. Really Great.

  49. Wonderful story, reckoned we could combine a few unrelated information, nevertheless actually worth taking a look, whoa did a single master about Mid East has got more problerms too

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