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. the time to read or check out the content or internet sites we have linked to beneath the

  2. Hi, I do believe this is a great site. I stumbledupon it ;) I’m going to come back yet again since i have saved as a favorite it. Money and freedom is the greatest way to change, may you be rich and continue to help other people.

  3. I’а†ve read a few just right stuff here. Definitely price bookmarking for revisiting. I wonder how much effort you place to make such a great informative website.

  4. Every as soon as inside a even though we pick out blogs that we read. Listed below are the newest internet sites that we pick

  5. We not only look at how many games are available and how varied the selection is, but also whether the software developers that the site is utilising are of high quality as well.
    playing casino online Whether you love slots, table games, or other options, you can play for free or for real money responsibly, wherever you are, whenever you feel like it.

  6. 35d411 generic viagra sold in us

    buy viagraviagra treatment iugr

    online viagraquick cash loans hattiesburg ms

    no fax payday loans

  7. Combining the speed of slots with the skill elements of poker, video poker is a great way to put yourself to the test, have fun and, potentially, win some money.
    casino online free bonus Casino, which occupies the second place in our ranking for online casinos, takes pride in offering a wide selection of games, coupled with a trendy design and a flawless mobile experience.

  8. cialis for sale https://1onlinecilkrd.com/ – cialis 20 mg how to take cialis sildenafil vs cialis cialis free trial

  9. Wonderful story, reckoned we could combine some unrelated data, nevertheless seriously worth taking a appear, whoa did one discover about Mid East has got more problerms too

  10. Withdrawal requests are normally processed within 24 to 48 hours and the money should be in your bank account 1 to 3 business days after they have been approved.
    live casino online If you find shooters are too aggressive, arcades too challenging, racing games too fast-paced for relaxation and puzzles too demanding, take a look at our amazing selection of free casino slots machines.

  11. 922211 best us cialis price

    cialis onlineovernight cialis usa

    buy generic cialisgenericviagra org choice

    generic viagra onlineventa de pastillas cialis

    generic cialis online

  12. we prefer to honor lots of other online web-sites around the net, even though they arent linked to us, by linking to them. Under are some webpages worth checking out

  13. 922211 costo pillole cialis

    buy cialiscosto cialis 10 mg farmacia

    generic cialis onlineprescrition viagra

    generic viagrabuy generic cialis black

    cheap cialis online

  14. We choose the best of the best secure online casinos that will boost your participation levels with live games, and make you feel as if you entered some of the best land-based casinos in the world.
    casino online roulette So that you do not simply withdraw your bonus money and walk away, you will need to play through the bonus a specified number of times to convert it to real cash that can be withdrawn.

  15. we like to honor quite a few other web internet sites on the web, even if they arent linked to us, by linking to them. Under are some webpages worth checking out

  16. Some people create their strategies, combine various established theories and search for an ideal option, others take advantage of the most popular ones and do not bother.
    online casino slot Well, it means that you can play without using up valuable storage space on your device, and you can sample our entire collection of games without having to install each one individually.

  17. generic cialis cost https://1cialishwzbm.com/ – cialis side effects how does cialis work cialis commercial cialis for sale

  18. A difference when playing roulette online is that you will instead have more privacy which gives you more room to think about each bet you make and being relieved from any peer pressure.
    mobile casino online Instead of depending on a software to determine the outcome of the roulette spin, dice throw or deal of a card, these games depend on real-time results.

  19. Nice Page , guys! Rewarding Infos aswell. Bookmarked

  20. However, the types of no deposit casino bonuses available do tend to fall into a few notable types, with distinctive differences that offer a unique experience.
    play live casino online On this site, we will provide information regarding the best mobile casinos right now, how you can get the most favourable mobile bonuses and how the game experience can be maximized for a mobile casino.

  21. Thanks-a-mundo for the article.Really thank you! Really Great.

  22. If you wish to see what different options you may have, however, simply use our search engine to check out the premium emblem design software program that might add numerous design leeway to the undertaking.
    paper writer My teacher essay in english for class 1 descriptive essay carnival rides essay on healthy food how to start an cooking essay, structure descriptive essay another word for secondly in an essay.

  23. what you are stating and the way in which you say it.

  24. You can spin the reels at the slot machines, hit and stand at the blackjack tables, roll the dice in the craps pit, and engage in many other kinds of casino gaming.
    games casino online While some are similar in theme and some even share the same jackpot, they are still all different and every online slot player has his or her favorite.

  25. pretty useful stuff, overall I think this is really worth a bookmark, thanks

  26. To show you how a medical writer translates technical information from a scholarly context to readers in the general public, we have included in this resource an original publication and its corresponding journalistic article.
    custom paper This is because writing a literature review only means that you are already near the end of your final requirement in your student life, which is either a thesis or even a dissertation.

  27. 894011 cost of viagra pill in canada

    cheap viagracash loans sparks nv

    payday advance loan

Leave a Reply to CBD near me 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