I use this script:
--------------------------------------
#!/bin/csh
if ($1 == "") then
echo "Usage: installjar <org> <module> <revision> <path-to-file>"
else
/usr/local/ant/bin/ant -Dorg="$1" -Dmodule="$2" -Drev="$3"
-Dinstall.path="$4" $5 $6 $7 $8 $9
endif
--------------------------------------
With the following build target:
--------------------------------------
<target name="installjar"
depends="init-ivy"
description="--> install jar to masrep">
<ivy:install settingsRef="masergy.settings" organisation="${org}"
module="${module}" revision="${rev}" type="jar" from="${localjar.resolver}"
to="${to.resolver}" />
</target>
--------------------------------------
Where my build.properties defines these variables:
localjar.resolver=localjars
to.resolver=masrep_sftp
And my ivysettings.xml includes:
<resolvers>
<filesystem name="localjars">
<artifact pattern="${install.path}/[artifact]-[revision].[ext]" />
<artifact pattern="${install.path}/[artifact].[ext]" />
</filesystem>
</resolvers>
This script allows me to specify a jar on the local filesystem by its name and
the directory in which it resides (install.path), add the org, and rev
metadata, and publish it to one of my resolvers (I use SFTP with a keyfile to
push files up to our webserver; you may use a filesystem resolver or webdav as
a destination).
I also have a bigger hack of a perl script which attempts to read a directory
of jars and guess the org, modul, and rev (validating against maven2), or
prompt the user when it's unclear. See the attachment.
---
Kirby Files
Software Architect
Masergy Communications
[email protected]
-----Original Message-----
From: Jim Newsham [mailto:[email protected]]
Sent: Thu 12/18/2008 9:24 PM
To: [email protected]
Subject: how to import artifacts
I'd like to integrate ivy into our development process. In order to do so,
I would need to import all the existing dependencies (typically jars) that
our project currently uses, into a shared repository. I couldn't find this
anywhere in the documentation, so. what is the magical incantation to add a
single artifact into the repository? I would expect there to be a simple
command-line invocation where you pass a few parameters (org, module,
version, filename), and the file is added to the repository.
This seems to me a fundamental requirement to set up a repository, so I'm
rather surprised that it's not documented in some obvious place, and there's
no tutorial that explains it. I saw a tutorial that shows how to copy
artifacts from one repository to another, but that's worthless if what you
have doesn't live in any repository yet.
Thanks in advance,
Jim