antrunでjunitタスクを使う

maven の antrun で junitタスクを使ったはいいが、junitへのクラスパスが通ってませんよというエラーが出たときの対処法。

http://www.mail-archive.com/users@maven.apache.org/msg51862.html

結局、dependencyにant-junitというのを追加して、で再定義という流れ。んなもんわかるかーーー!

ちなみにから他antスクリプト読んだときにもjunitでエラーがでます。
そっちはどうやって解決するんだ・・・?

ちなみに普通にjunitだけ指定したときのエラー内容はこちら

Embedded error: Could not create task or type of type: junit.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual 
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file: 
 - You have misspelt 'junit'.
   Fix: check your spelling.
 - The task needs an external JAR file to execute
     and this is not found at the right place in the classpath.
   Fix: check the documentation for dependencies.
   Fix: declare the task.
 - The task is an Ant optional task and the JAR file and/or libraries
     implementing the functionality were not found at the time you
     yourself built your installation of Ant from the Ant sources.
   Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
     task and make sure it contains more than merely a META-INF/MANIFEST.MF.
     If all it contains is the manifest, then rebuild Ant with the needed
     libraries present in ${ant.home}/lib/optional/ , or alternatively,
     download a pre-built release version from apache.org
 - The build file was written for a later version of Ant
   Fix: upgrade to at least the latest release version of Ant
 - The task is not an Ant core or optional task 
     and needs to be declared using <taskdef>.
 - You are attempting to use a task defined using 
    <presetdef> or <macrodef> but have spelt wrong or not 
   defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

大根の生る木

しばらく日記を付けていなかったのでひさびさに。

もう一月ほどまえになるけど、石清水八幡宮に行った帰りに樟葉にある一族の墓地近くの寺に行くと、大根が生っている木があった。


親が言うには、昔来たときはもっとたくさんあったらしいけど、あんな上まで登るのは怖いなぁ・・・

artifactory

mavenのインハウスリポジトリ作成キット??

まだ余り読んでない。とりあえずこの辺読むのは落ち着いてから・・・

多分リポジトリへの問い合わせがあったときのキャッシング処理とかしてくれるんだろう。

http://www.jfrog.org/sites/artifactory/latest/
http://d.hatena.ne.jp/szk-takanori/20071019/1192800438
http://d.hatena.ne.jp/masanobuimai/20080109#1199890351

mavenのテスト・リリース・配備用コンフィグの変更方法

たとえば、テストリリースの場合はデバッグ情報をON、本番リリースの場合はデバッグをOFFにしたりする方法が、antだと ant-contlib の if 文や、プロパティ値の設定などで処理切り替えをしたらいいんですが、mavenだと良く分からなかった。

ということでその辺りを解決する方法がid:TrinityTさんの日記に書いてあったのでメモメモ。

http://d.hatena.ne.jp/TrinityT/20080109/1199845543

・・・とはいえ今は忙しくてpomのメンテができる状態じゃないんだよなぁ・・・

将来的にはantからmavenに移行したいけれども。

UMLet改造部分

前提として、Windowsで、uxfファイルをダブルクリックでオープンできるようにしてあります。
標準だとダブルクリックからオープンした場合最初に保存を行った時に、開いたファイルに保存してくれりゃいいのに Save As と同様の操作になってしまうので、下記クラスを変更して回避。

com.umlet.control.io.FileOP に下記のメソッドを追加
    public void setSaveFileName(String fileName){
    	this.saveFileName = fileName;
    }

com.umlet.control.Umlet#setFileName(String s)を下記に変更

  public void setFileName(String s) {
    _fileName=s;
    if (_saveMenuItem!=null) {
      if (_fileName!=null){
          _saveMenuItem.setEnabled(true);
    	  // set default save file name(for file associate open)
          FileOp.getInstance().setSaveFileName(_fileName);
      }
      
      else
        _saveMenuItem.setEnabled(false);
    }
  }

なんでUMLetが上記動作をサポートしないのかは謎。というか上記で問題があるかもしれないんで自己責任でー。

UMLet8.01

この前からUMLetのソースを改変しつつ使っていたわけですが、この度UMLet8.01のソースを取ってくるといきなりコンパイルエラー。

理由は、com.umlet.element.base.Group というクラスができてしまったせいでcom.umlet.element.base.Entityの中で使用しているGroupクラスのデフォルト解決先がcom.umlet.control.Groupでは無くなってしまったようだ。

あと、XMLContentHandlerクラスの方のGroupの解決もおかしい。

単純にGroupを完全修飾クラス名に修正しただけでは色々問題有るなーと思い前のソースを取ってこようとしたら Ver 8.00 のリンクが無くなってる orz

Ver 7.00へのリンクからURL予想をしたところZIP自体は消えたんでは無いみたい。前のが欲しい場合は下記リンクから。
http://www.umlet.com/umlet_8/umlet8.zip

年末日記

12/28 仕事納め
12/29 夕方から大阪の友達んとこへ。飲み。どうやらNはドクターになれるようで何より。あと他の会社と自分の会社の違いがあいかわらず多すぎるなーとか思った。PCの全操作ログって何ですかそれ。バックアップ用?(笑
12/30 実家へ帰る。全然寝てないので爆睡。起きたら相変わらずアレルギー性喘息の症状が現れ始めた。「功名が辻」1巻読破。
12/31 起きたら喘息。死ねる。発作沈める薬で治療するも余り効かず。今年も紅白は見ない。「功名が辻」2巻読破。「レイトン教授と不思議な町」をやってたらいつの間にか寝ててDSの電源が切れてた・・・やり直し。雪が降らねー
01/01 あけましておめでとうございます。喘息は相変わらず。夕方頃に毎年恒例の救急病院に年始の挨拶?に行ったら人が多すぎです。やっぱり子どもが多いなぁ。治療して貰って薬を貰ったらなんとステロイド剤30mgを毎日朝に飲めと。ステロイドって大丈夫か俺。
01/02 朝起きたら楽になってる。すごいぞステロイド。夕方から姉夫婦が到着。夫さんの先月の残業200時間越えだと・・・。姉歯さんのおかげで設計系は今仕事量が地獄らしい。「功名が辻」全四巻読了。すらすら読めた。家から持ってきたJOJO第4部詳説を全く読んでない・・・
01/03 朝から石清水八幡宮に初詣。3日だけど結構人がいるなぁ。夕方から徳島に戻り。
01/04 会社ー