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. 불편한 걸 두고 보지 못하는 게으른(?) 성품이 지금의 형을 만든게 아닐까 싶네요 :) 스크립트로 작성된 MOJO도 몇개 있는 것 같던데, archetype 생성기도 MOJO로 만들 수 있나?? 그리고, Copyright가 2002인 이유가 궁금해졌어욤.

  2. 물개/ copyright부분을 ruby api 소스코드에서 배꼈더니 ㅋㅋ
    Plugin으로도 만들까 하다가 머.. 걍 내가 귀찮아서 쓰는 유틸리티라서 거기까지는 아직.

  3. [...] Codehaus Mojo 프로젝트 안에서 JRuby plugin을 발견했다. 이를 이용하면 Ruby코드를 이용해서 간단히 plugin을 만들 수 있다고 한다. 이를 이용하면 ArchetypeXmlWriter를 간단히 plugin으로 만들어서 archetype 프로젝트 빌드과정에 포함시킬 수도 있겠다. [...]

  4. What you said made a lot of sense. But, what about this? what if you wrote a catchier title? I ain’t suggesting your information is not good., however suppose you added something to maybe get a person’s attention? I mean Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby's Epril is a little vanilla. You could glance at Yahoo’s front page and see how they create post titles to grab people interested. You might add a video or a picture or two to grab readers interested about what you’ve got to say. In my opinion, it would bring your website a little bit more interesting.

  5. I almost never leave remarks, but after reading a few of the comments on this page Maven archetype 설정파일 자동생성기 &. I actually do have a few questions for you if it’s okay. Could it be simply me or does it seem like a few of the comments look as if they are left by brain dead individuals? :-P And, if you are posting at additional social sites, I would like to keep up with anything new you have to post. Could you make a list of the complete urls of all your social pages like your twitter feed, Facebook page or linkedin profile?

  6. I think everything said made a great deal of sense. However, what about this? what if you added a little content? I ain’t saying your content is not good., however what if you added a post title that makes people want more? I mean Maven archetype 설정파일 자동생성기 & is kinda plain. You might glance at Yahoo’s home page and note how they write post titles to grab viewers to open the links. You might add a related video or a related picture or two to get people excited about what you’ve got to say. Just my opinion, it would bring your posts a little bit more interesting.

  7. 今日は~^^またブログ覗かせていただきました。よろしくお願いします。

  8. I am glad for commenting to make you know what a notable experience my princess experienced browsing your site. She even learned numerous things, which include what it’s like to possess an amazing teaching mood to make certain people without difficulty thoroughly grasp a variety of complicated matters. You actually exceeded my expected results. Many thanks for presenting those important, trustworthy, educational and as well as easy tips on that topic to Jane.

  9. I really wanted to jot down a simple comment to be able to appreciate you for all of the stunning pointers you are posting on this website. My time consuming internet search has now been rewarded with pleasant knowledge to talk about with my company. I ‘d express that most of us visitors actually are extremely lucky to exist in a perfect community with so many outstanding individuals with good tips. I feel really grateful to have come across your entire site and look forward to plenty of more amazing times reading here. Thanks once more for all the details.

  10. There is noticeably a bundle to know about this. I assume you made certain nice factors in features also.

  11. Your house is valueble for me. Thanks!…

  12. Thanks a lot for providing individuals with an extremely breathtaking chance to read in detail from this website. It’s always very enjoyable and also stuffed with a great time for me and my office fellow workers to search the blog particularly three times in one week to study the new stuff you have got. And lastly, I’m so certainly astounded concerning the attractive opinions you serve. Selected 1 points in this article are without a doubt the very best we have ever had.

  13. オークリー メガネ…

    Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby’s Epril…

  14. very nice publish, i actually love this web site, carry on it.

  15. It’s best to participate in a contest for one of the best blogs on the web. I’ll advocate this site!

  16. プラダ アウトレット…

    Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby’s Epril…

  17. Took me time for you to read all of the reviews, but I in reality enjoyed the piece. It proved to be very useful to me and I’m certain to all the commenters here! It’s always great when you are able to not only be informed, but also engaged! I’m certain you had enjoyable writing this write-up.

  18. gucci short sleeve shirts Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby’s Epril

  19. gucci sport xl watch black Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby’s Epril

  20. running shoes online discount Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby’s Epril

  21. mbt shoe foot measure chart Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby’s Epril

  22. circa shoes online Maven archetype 설정파일 자동생성기 – ArchetypeXmlWriter » Toby’s Epril

  23. Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. Seo Plugin

  24. 弊社は各ランクのブランド商品満載し、ブランド通販店で一番信用のある店なので!。
    品質はこちらが間違いなく保証します。
    https://www.ginzaoff.com/watch/product-19178.html

    ■取扱ブランド ロレックス時計コピー、カルティエ時計コピー、IWC時計コピー、
    ブライトリング時計コピー、パネライ時計コピー.
    ◆ スタイルが多い、品質がよい、価格が低い、実物写真!
    ◆ ご入金頂いてから最速4日、遅くとも7日程度でご指定場所へ発送出来る予定でございます
    ◆ 商品送料を無料にいたします
    https://www.ginzaoff.com/watch/product-16286.html

    ◆信用第一、良い品質、低価格は 私達の勝ち残りの切り札です。
    ◆ 当社の商品は絶対の自信が御座います。
    ◇ N品質 シリアル付きも有り 付属品完備!
    https://www.ginzaoff.com/watch/product-16817.html

    ◆ 必ずご満足頂ける品質の商品のみ販売しております。
    ◇ 品質を最大限本物と同等とする為に相応の材質にて製作している為です。
    ◆ 絶対に満足して頂ける品のみ皆様にお届け致します。
    興味あれば、是非一度サイトをご覧になって下さい。
    今後ともよろしくご愛顧くださいますよう、お願い申し上げます
    https://www.ginzaoff.com/watch/product-4669.html

    お取り引きを開始させていただきたく思います。
    詳細に関してはどうぞお気軽にご連絡ください。

  25. ブランド商店-賢者の買物

    弊社は各ランクのブランド商品満載し、ブランド通販店で一番信用のある店なので!。
    品質はこちらが間違いなく保証します。
    相互信頼を旨(むね)として貿易関係を結びたいのですが。
    今後ともよろしくご愛顧くださいますよう、お願い申し上げます
    URL:
    https://www.88kopi.com/product/product-8201.html

    ■取扱ブランド ルイ.ヴィトン、シャネル、クリスチャン ディオール、グッチ、コーチ、ROEXL 、S品、A品、超A品
    ■主要取扱商品 バッグ、財布、腕時計、靴、服、ベルト、ネクタイ、ライタ!
    お取り引きを開始させていただきたく思います。
    詳細に関してはどうぞお気軽にご連絡ください。
    https://www.88kopi.com/product/product-7623.html

  26. 商品の到着が早く驚きました
    またいいものがあれば購入させていただきたいと思います。
    ありがとうございました。
    ブランド通販,時計コピー https://www.kopioff.com/tokei/jl/master/b54450830e9727b9.html

  27. priligy kaufen
    If you are studying complicated details you are aware of practically nothing about, try and link it to your matter that you will be very knowledgeable about. It will be easy to recall the unfamiliar materials much better if you are able to associate it with an issue that is easy to know.
    dapoxetine nederland
    In the event you key in a store with plenty of vouchers, be considerate towards the cashiers as well as the executives. Your enormous quantity of discount coupons will likely be a headaches directly to them plus the customers right behind you in collection. You will need these folks to become working for you to produce the event an optimistic one.
    cialis switzerland
    In conclusion, this article has displayed you that some reasons for panic and anxiety attacks are preventable, while some usually are not. With a little luck, you possess noticed that this little facts you because of, can help you to avoid possible reasons behind attacks. These details will be useful for you or perhaps for someone you care about, that has to undergo this horrible experience.Diabetes mellitus: What You Need To Know To Deal With It
    levitra svizzera

  28. vardenafil kaufen
    A lot of parents would love to homeschool, but are way too hesitant to get started. Using what you’ve go through in this article, you need to have adequate information to beat this anxiety and instead move ahead with bettering your child’s education and learning. With some bravery and push, you’ll become a homeschooling expert right away!Wise College or university Tips That Will Help You!
    viagra original
    With a little luck, this information has presented you some really useful ideas on turning off of the traditional, resource-depleting and exceedingly-pollutant sources of energy in your house and changing to better eco-friendly energy. Green energy will decrease the costs at home, in addition to, decrease your carbon dioxide footprint on the planet, so why not start off nowadays?Teach Your Pooch By Simply Following These Tips.
    viagra belgique
    Once you scrub your face with the hands and wrists and gentle soap, scrub both hands and dried out them extensively. Most of us touch our facial looks inadvertently, so guaranteeing you possess no left over essential oil or germs on your own hands, will assist to be sure that you’re not placing that things, back again on your face, both.
    viagra gĂĽnstig

  29. kamagra kopen
    Become a member of older groups, chapel teams local authorities teams or hobby night clubs. Create a family model, regardless of whether your blood flow family members are not close to you. It’s significant to experience a system of men and women close to you when you era. Your friends and relations can cheer you up throughout hard periods and be your sounding board or first forewarning signal in the course of bad times. In case your loved ones are far, look to your local community.
    priligy kosten
    When you have at any time went very far when plucking your eye brows to that you can’t watch you possessed any, you will discover a solution. You are going to initial wish to choose an eyebrow pencil that integrates with the brow colour. Be sure you load the entire brow with all the pencil and not merely the hairless locations while using load, resolve, feather technique.
    viagra precio
    Convert your master bedroom into an get away from from all of the the noise and interruptions of your life. Malignancy treatments frequently trigger individuals to have sleep problems, so taking out clocks, televisions and radios out of your master bedroom can help you sleep far better. Also try to get the space as dim as possible to help rest.
    cialis 20 mg ireland

  30. viagra online uk
    As was reported in the beginning on this post, living with bronchial asthma daily can be hugely irritating. When simple day-to-day jobs make you gasping for oxygen, daily life can, sometimes, look like it is rather minimal. Ideally, this article has offered you some really good ideas for and helps to manage your asthma attack, and doing your best with every day.Vino And What You Must Understand About It
    kamagra jelly
    If dandruff has you flaked out, try out an aspirin! Smash up an aspirin, combine it effectively into your normal shampoo or conditioner and use as usual to get a more affordable and more efficient remedy than expensive dandruff remedies! The beneficial properties in painkilling substances really try to relax your free of moisture scalp and ultimately offer you relief from frustrating and unsightly dandruff!
    Levitra original
    In case you have issues together with your pores and skin, you’re not by yourself. A lot of people are afflicted by unhealthy and damaged pores and skin because they don’t understand the correct types of caring for their skin. If you’re among the many people with epidermis difficulties, please read on and try these pointers to see if they guide you.
    viagra wirkung

  31. levitra hinta
    You might find on your own producing lame excuses when your family request you regarding your smoking habit. You think you are way too old to stop, or else you happen to be smoking for days on end to create a variation. Justifications do nothing but demotivate you, and therefore are frequently based on beliefs. Examine your lame excuses on the doorway and stop smoking cigarettes these days following the advice under.
    cialis pris
    It is recommended for women that are pregnant to protect yourself from consuming specific seafood, like shark, swordfish, and tilefish. These fish consist of great amounts of mercury, which could lead to health issues for your personal child. There are many sea food that is secure for expecting mothers to consume which include processed tuna, pollack, salmon, catfish, and shrimp.
    propecia generico
    If you are going camping out along with your household pets or children, you must take a number of more safeguards. Attempt to train the kids the basics of camping outdoors basic safety. They should know where to start when they go missing and should every single have got a modest surviving package. Make sure you have leashes for just about any domestic pets and make sure they are recent with all vaccinations.
    viagra kopen

  32. ブランド財布コピー、ブランドコピーバッグ、ブランドコピー時計
    ブランドコピーブランド時計、財布、バッグコピー商品販売!
    ルイヴィトン、シャネル、グッチ、エルメス、ロレックス、オメガ全品無料配送!
    弊社は「信用第一」をモットーにお客様にご満足頂けるよう、
    発送前には厳しい検査を通じて製品の品質を保証してあげますとともに、
    配送の費用も無料とし、品質による返送、交換、さらに返金までも実際 にさせていただきます。
    また、従業員一同、親切、丁寧、迅速に対応 させて頂き、ご安心になってお買い物を楽しんでくださるよう精一杯力 を尽くしていくつもりです。
    是非ご覧ください!
    営業時間:年中無休
    ホームページ上でのご注文は24時間受け付けております

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