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. reputable canadian pharmacy https://canadianpharmacyonlinejycx.com/ – online canadian pharmacy best canadian online pharmacy canadian pharmacy review canada online pharmacy

  2. online pet pharmacy https://onlinepharmacycanadasctu.com/ – best online non prescription pharmacy walmart online pharmacy best canadian online pharmacy pharmacy online

  3. costco online pharmacy https://onlinepharmacysrba.com/ – online canadian pharmacy cvs online pharmacy canadian online pharmacy modafinil online pharmacy

  4. canadian online pharmacy viagra https://canadianpharmacyonlinesrvh.com/ – is canadian pharmacy online legit best online canadian pharmacy review canadian online pharmacy viagra best canadian pharmacy online

  5. Just Browsing While I was surfing yesterday I saw a great post concerning

  6. Major thanks for the post.Thanks Again. Cool.

  7. Im grateful for the article.Really thank you! Fantastic.

  8. the time to read or pay a visit to the subject material or web-sites we have linked to below the

  9. Hi, I do think this is a great site. I stumbledupon it
    ;) I am going to come back yet again since i have book marked it.
    Money and freedom is the best way to change, may you
    be rich and continue to guide others.

  10. Really informative post.Thanks Again. Fantastic.

  11. pretty useful stuff, overall I imagine this is really worth a bookmark, thanks

  12. It is appropriate time to make some plans for the future and it’s
    time to be happy. I have read this post and if I could I want to suggest
    you some interesting things or advice. Maybe you could write next
    articles referring to this article. I wish to
    read more things about it!

  13. Admiring the hard work you put into your site and in depth information you present.
    It’s good to come across a blog every once in a while that isn’t the same
    out of date rehashed information. Great read! I’ve saved your site and I’m including your RSS
    feeds to my Google account.

  14. I enjoy looking through a post that will make men and women think. Also, thank you for allowing me to comment.

  15. propecia kaufen
    To reduce your probability of weak bones, be sure you ingest a good amount of calcium supplement. It’s frequently identified that whole milk as well as other dairy products include calcium supplement, but this nutrient may be found in a number of other foods. Bok Choy, broccoli, and kelp are all very high in calcium mineral. Sesame seeds are another excellent resource.
    cialis generiek
    There is absolutely no harm in admitting you can’t take action because of your arthritic condition. So, don’t be embarrassed to question loved ones to assist you. Getting sincere concerning your restrictions, and therefore receiving the necessary help, may actually increase your skill to work at the top level.
    priligy fass
    One suggestion to help sustain your memory is to ensure that you get a good amount of rest. Rest deprivation enables you to forgetful and struggling to comprehend issues also that will injured your ability to produce new thoughts. Make sure that you get no less than 7 time of sleeping every single night.
    levitra suisse

  16. Every as soon as inside a even though we choose blogs that we read. Listed beneath are the most up-to-date websites that we pick

  17. viagra precio
    Make sure you receive a actual physical contract coming from all credit history assortment firms. The agreement need to spell out just how much you owe, the transaction preparations, and should they be recharging any other charges. Be extremely wary in the event the clients are reluctant to give you a contract. You can find unethical businesses on the market who will take your cash with out really closing your money.
    acheter levitra
    In order to rent your flats or office buildings with a very good selling price, take into consideration employing an interior decorator. A great decorator will create a cozy surroundings which makes tenants sense at home even when they are booking a relatively small, and standard flat. This may boost value of your premises.
    Super Kamagra Auf Rechnung
    Like all those insurance policy advertisements say — existence arrives at you fast. Properly, it goes by even more quickly. Before you realize it, decades slip apart and you hardly identify yourself any further. Ageing can definitely come as being a distress to a few those who don’t know how you can approach growing older. Here are some tips that can help you out.
    viagra kaufen rezeptfrei

  18. Sites of interest we’ve a link to

  19. This is a topic which is near to my heart… Many thanks! Where are your contact details though?

  20. levitra acheter
    1 you understand you are in fiscal problems and have made a decision to apply for personal individual bankruptcy you must transfer quickly. Holding out on the last second to submit a bankruptcy proceeding may cause numerous concerns. You might face adverse consequences for example wage or banking account garnishment or foreclosure in your property. You can even not depart time ample for the comprehensive report on your finances, that can reduce your available alternatives.
    super kamagra kaufen
    Successfully marketing your home entails carrying out everything you could to seize the eye of your shopper while keeping it focused on your premises. Consumers typically have a look at a number of homes each day, along with your property needs to be noticeable if you wish to draw in a variety of affordable provides. This post will present you with all the details that you need to obtain a lower leg high on the competition.
    viagra kaufen rezeptfrei
    There are a few food products that are much more likely to lead you to are afflicted by hemorrhoids yet others which will probably help you. You should know which food items are excellent and that happen to be dangerous so that you are able to decrease your probability to produce this.
    cialis original

  21. please take a look at the web pages we comply with, including this one particular, as it represents our picks from the web

  22. Your style is so unique compared to other people I have read stuff from. I appreciate you for posting when you’ve got the opportunity, Guess I will just book mark this web site.

  23. Every after in a although we decide on blogs that we read. Listed beneath are the latest sites that we select

  24. RUSSIA JERSEY ??????30????????????????5??????????????? | ????????

  25. just beneath, are a lot of completely not associated sites to ours, even so, they are surely worth going over

  26. we like to honor several other net internet sites around the web, even though they aren

  27. used to be a amusement account it. Glance complex to more added agreeable

  28. Very good information. Lucky me I ran across your site by chance (stumbleupon). I ave saved it for later!

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

  30. we came across a cool web page that you simply might enjoy. Take a look for those who want

  31. Simply wanna remark on few general things, The website layout is perfect, the content is really superb. “The idea of God is the sole wrong for which I cannot forgive mankind.” by Marquis de Sade.

  32. read stuff from. Thanks for posting when you

  33. It as really a nice and useful piece of information. I am glad that you shared this useful information with us. Please keep us up to date like this. Thanks for sharing.

  34. I enjoy the efforts you have put in this, appreciate it for all the great articles.

  35. when will viagra become generic https://genericvigrarja.com/ – generic viagra names generic name for viagra is there generic viagra canadian pharmacy generic viagra

  36. Im no professional, but I consider you just made an excellent point. You clearly comprehend what youre talking about, and I can seriously get behind that. Thanks for being so upfront and so truthful.

  37. Thank you, I ave recently been searching for information about this topic for ages and yours is the greatest I ave discovered till now. But, what about the bottom line? Are you sure about the source?

  38. Perfect piece of work you have done, this web site is really cool with wonderful info.

  39. obviously like your web site but you need to check the spelling on quite a few of your posts. A number of them are rife with spelling problems and I to find it very troublesome to inform the reality on the other hand I’ll definitely come again again.

  40. Many thanks for sharing this very good article. Very inspiring! (as always, btw)

  41. Attractive section of content. I just stumbled upon your site and in accession capital to assert that I acquire in fact enjoyed account your blog posts. Anyway I will be subscribing to your augment and even I achievement you access consistently rapidly.

  42. If you are free to watch funny videos online then I suggest you to pay a visit this site, it includes really so comic not only movies but also extra information.

  43. 100 mg generic viagra https://vigramg.com/ – 100 mg viagra cost pfizer viagra 100mg price 100mg viagra cost viagra 25mg cost

  44. we like to honor a lot of other world wide web web sites around the net, even though they arent linked to us, by linking to them. Underneath are some webpages really worth checking out

  45. just beneath, are numerous entirely not related web pages to ours, having said that, they are surely worth going over

  46. It is truly a great and useful piece of information. I am glad that you simply shared this useful info with us. Please keep us up to date like this. Thank you for sharing.

  47. Im grateful for the blog post. Will read on

  48. just beneath, are many absolutely not connected web-sites to ours, even so, they’re surely really worth going over

  49. Real wonderful information can be found on web blog.

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