やってることは、ディレクトリ内にある.jarファイルをmvn deploy:deploy-fileしまくっているだけ。
バージョンごとにちまちまコマンド打つのが面倒なので作った。
deploy-file.rb
# repository URL or File # example: file://C:/repos print "-Durl = " repos = gets.chomp # groupId # example: com.example print "-DgroupId = " groupId = gets.chomp # artifactId # example: hoge print "-DartifactId = " artifactId = gets.chomp Dir::glob("*.jar") do |path| File.basename(path, ".jar") =~ /#{artifactId}.(.*)/ version = $1 p cmd = "mvn deploy:deploy-file -Durl=#{repos} -Dfile=#{path} -DgroupId=#{groupId} -DartifactId=#{artifactId} -Dversion=#{version} -Dpackaging=jar -DgeneratePom=true" open("| " + cmd) do |out| while !out.eof print out.gets end end end
それにしてもRubyはしばらく触っていないと忘れるなぁ。