Of course, that was just a simple hack. Anyone can extend it into something
more robust, and make a ruby/maven plugin out of it (
http://mojo.codehaus.org/rubyscript-maven-plugin). That way you can run the
thing as part of a maven build. Good luck!

Eric

On 4/5/06, Julio Oliveira <[EMAIL PROTECTED]> wrote:
>
> OK it's fine and working.
>
> tanks to you Eric and Wayne.
>
> Now i'm registered to the Eric web and read some notes.
>
> I'm download ruby and install it, I supose maven need it to work with
> the scrip... ??
>
> I will try the script and send you the result....???'
>
> I have more than 100 jar, and the problem is that all time, it's
> changing dinamic, and there is a problem to  maintain it.
>
> regards.
>
> MUCHAS  GRACIAS   BOTIJAS
>
>
>
>
> On 4/5/06, Wayne Fay <[EMAIL PROTECTED]> wrote:
> > While you're at it, why not write out the <dependencies> list for the
> > installed jars at the end of the program run?
> >
> > Otherwise this only solves half the problem. ;-)
> >
> > Wayne
> >
> > On 4/5/06, Eric Redmond <[EMAIL PROTECTED]> wrote:
> > > Because I'm such a nice guy :), here is a ruby script to install all
> jars in
> > > a given directory to Maven. Just ensure there are no spaces in your
> > > directory path.
> > >
> > > Eric
> > >
> > > ----- BEGIN SCRIPT -----
> > > # Set the MVN SCRIPT
> > > # Eric Redmond / Propellors.net
> > >
> > > MVN_SCRIPT = "C:/maven-2.1-SNAPSHOT/bin/mvn.bat"
> > > VERSION = "1"
> > >
> > > def install_jars( base_dir_name, group_id )
> > >    gid_set = !group_id.nil?
> > >    Dir.foreach( base_dir_name ) { |file_name|
> > >        next unless file_name =~ /\.jar$/
> > >        artifact_id = file_name.sub(/.jar$/, '')
> > >        group_id = gid_set ? group_id : artifact_id
> > >        file_name = "#{base_dir_name}/#{file_name}"
> > >        puts
> > >
> system("#{MVN_SCRIPT}","install:install-file","-DgroupId=#{group_id}","-DartifactId=#{artifact_id}","-Dversion=#{VERSION}","-Dpackaging=jar","-Dfile=#{file_name}")
> > >    }
> > > end
> > >
> > > begin
> > >    bdir, gid = ARGV[0],ARGV[1] unless ARGV[0].nil?&&(puts "usage:
> > > install_jars.rb <BASE_DIR_WITH_JARS> [GROUP_ID]")|exit
> > >    install_jars( bdir, gid )
> > > end
> > > ------ END SCRIPT ------
> > >
> > >
> > > On 4/5/06, Julio Oliveira <[EMAIL PROTECTED]> wrote:
> > > >
> > > > ok Wayne
> > > >
> > > > I think it will be modified .....
> > > >
> > > >
> > > > But how to do the site without compile,   site:site doesn't work
> > > >
> > > > regards
> > > >
> > > >
> > > > On 4/5/06, Wayne Fay <[EMAIL PROTECTED]> wrote:
> > > > > On 4/5/06, Julio Oliveira <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > For #1 what if i have 100 .jars  have i to do it one by one...
> or is
> > > > > > there any tip to do in a one line ( take all a folder with the
> 100
> > > > > > .jar's )
> > > > > >
> > > > >
> > > > > Yes, one by one. So 100 will take a while. Have fun.
> > > > >
> > > > > Wayne
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to