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. Wonderful story, reckoned we could combine a handful of unrelated data, nonetheless actually really worth taking a look, whoa did 1 master about Mid East has got much more problerms as well

  2. we came across a cool web-site which you could appreciate. Take a appear when you want

  3. Purchase Amoxycillin 25o Mg Cialis Canadiancialissources cialis online without prescription Vendita Cialis

  4. just beneath, are several completely not connected websites to ours, however, they’re certainly worth going over

  5. usually posts some extremely intriguing stuff like this. If youre new to this site

  6. I truly like your weblog submit. Keep putting up far more useful info, we value it!

  7. check beneath, are some entirely unrelated internet websites to ours, however, they may be most trustworthy sources that we use

  8. although internet sites we backlink to beneath are considerably not associated to ours, we feel they are truly worth a go by way of, so have a look

  9. ojvufj sindilfil viagra 100mg Sildenafil aeuedt do you agree where can i buy sildenafil look what i found

  10. please check out the web sites we adhere to, which includes this 1, as it represents our picks through the web

  11. Good post. I’m dealing with many of these issues as well..

  12. Thanks-a-mundo for the post.Really thank you! Great.

  13. Spot on with this write-up, I honestly believe that this amazing site needs a great deal more attention. I’ll probably be back again to see more, thanks for the info.

  14. levitra for sale online https://levitrakgsy.com/ – levitra pills levitra vardenafil buy levitra online cheap levitra dosage how long does it last

  15. Here is a superb Blog You may Come across Interesting that we Encourage You

  16. viagra price https://usaerectionrx.com/ – otc viagra viagra over the counter viagra samples what is viagra

  17. Good post! We are linking to this particularly great post on our site. Keep up the great writing.

  18. I really love your website.. Very nice colors & theme. Did you build this website yourself? Please reply back as I’m hoping to create my own site and would like to find out where you got this from or what the theme is called. Many thanks!

  19. Thanks so much for the blog post.Really looking forward to read more. Fantastic.

  20. we came across a cool site that you might take pleasure in. Take a look in the event you want

  21. Good day! I could have sworn I’ve been to this website before but after browsing through some of the articles I realized it’s new to me. Regardless, I’m definitely pleased I found it and I’ll be bookmarking it and checking back frequently.

  22. Here are some of the web-sites we recommend for our visitors

  23. I blog often and I really thank you for your content. Your article has truly peaked my interest. I am going to book mark your site and keep checking for new information about once a week. I opted in for your RSS feed as well.

  24. You are my aspiration , I have few web logs and sometimes run out from to post.

  25. bookmarked!!, I really like your website.

  26. Howdy! This article couldn’t be written much better! Looking at this article reminds me of my previous roommate! He constantly kept preaching about this. I will send this article to him. Pretty sure he’ll have a good read. I appreciate you for sharing!

  27. Thanks a lot for the post.Thanks Again. Great.

  28. Really enjoyed this blog post.Thanks Again. Really Cool.

  29. There’s certainly a great deal to know about this issue. I really like all of the points you have made.

  30. Hello there, I do believe your web site could possibly be having web browser compatibility problems. Whenever I take a look at your site in Safari, it looks fine but when opening in I.E., it has some overlapping issues. I merely wanted to provide you with a quick heads up! Aside from that, great blog!

  31. we like to honor numerous other net web sites on the web, even though they arent linked to us, by linking to them. Below are some webpages really worth checking out

  32. very good blog! Also visit my webpage healthy Diet

  33. This particular blog is obviously interesting as well as amusing. I have chosen a lot of interesting things out of this amazing blog. I ad love to return over and over again. Thanks!

  34. In addition to this, you will typically have to fulfil certain wagering requirements before you are deemed to have completed the conditions of the promotion.
    play live casino online With a single player account, you can play casino games, bet on sports, buy lottery tickets, and indulge in various other real money gambling activities.

  35. Thank you for all your valuable work on this blog. My daughter delights in getting into investigations and it’s easy to understand why. Most people know all concerning the powerful means you offer reliable solutions on the web blog and as well invigorate participation from people about this point and our own simple princess is without a doubt learning a lot. Take advantage of the remaining portion of the new year. You are conducting a brilliant job.

  36. usually posts some very exciting stuff like this. If you are new to this site

  37. We are constantly scouring the gambling industry for new online casinos on the market, and put an emphasis on reviewing them fairly, and updating our reviews after the casinos have been operating for a while.
    online casino slot You should also consider that mobile apps, unlike web-based games, will always take up space on your device, while the software updates will not necessarily occur automatically.

  38. Can I simply say what a relief to find somebody that really knows what they’re discussing on the net. You actually realize how to bring a problem to light and make it important. More people need to look at this and understand this side of your story. I was surprised you are not more popular given that you surely possess the gift.

  39. Spot on with this write-up, I seriously feel this web site needs a great deal more attention. I’ll probably be returning to read through more, thanks for the advice.

  40. very couple of sites that come about to be detailed below, from our point of view are undoubtedly properly worth checking out

  41. This can be anything from wagering 20x to 50x the value of your bonus and is something to look out for when both selecting and taking advantage of your bonus.
    online casino slot If you are playing roulette online, or any other casino game or sports betting for that matter, avoiding all of the scams is a must if you intend on getting the most out of it.

  42. We spend a great deal of time and energy crafting the most interesting daily, weekly and monthly cashback rewards and free spins promotions so our players can get maximum value and payback in return for their loyalty.
    play online casino slots Casino enthusiasts can play just about any type of game at these mobile casinos including progressive jackpot games, slots, video poker, card and table games.

  43. Having an online casino at your party can avoid using up valuable space for installing any gaming equipment, as most mobile casinos have leading games and slots to keep your guests entertained.
    super casino online Swedish firm was founded in 1996 and has grown to be one of the largest companies in the industry, winning multiple awards for its games and innovations.

  44. Here is an excellent Weblog You may Discover Intriguing that we Encourage You

  45. The next time I read a blog, Hopefully it won’t disappoint me as much as this one. After all, Yes, it was my choice to read, however I genuinely thought you’d have something helpful to talk about. All I hear is a bunch of whining about something you could possibly fix if you were not too busy searching for attention.

  46. Since we live in an era of technological progress, it is no wonder why the online casinos are on the verge of becoming more popular than their land-based counterparts.
    online casino slot Let bij het selecteren van een casino minder op de hoogte van het bonusbedrag en meer gunstige voorwaarden, zo vergroot je je kansen op het succesvol vrijspelen van het bonusgeld.

  47. natural viagra https://1onlineviagenfox.com/ – viagra generic cost of viagra womens viagra buy viagra online

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