@ECHO OFF
if %1a==a goto usage
if "%MAVEN_HOME%"=="" goto MHusage
set REPO_DIR=%1
:start
shift
if %1a==a goto parsed
set REPO_DIR=%REPO_DIR% %1
goto start
:parsed
echo copying to repository %REPO_DIR%
REM this warns but works on WinNT+, should work on Win9x too
if not exist "%REPO_DIR%\nul" mkdir "%REPO_DIR%"
if not exist "%REPO_DIR%\maven\nul" mkdir "%REPO_DIR%\maven"
if not exist "%REPO_DIR%\maven\jars\nul" mkdir "%REPO_DIR%\maven\jars"
if not exist "%REPO_DIR%\maven\jars\dom4j-1.7-20060614.jar" copy "%MAVEN_HOME%\lib\dom4j-1.7-20060614.jar" "%REPO_DIR%\maven\jars"
if not exist "%REPO_DIR%\jaxen\nul" mkdir "%REPO_DIR%\jaxen"
if not exist "%REPO_DIR%\jaxen\jars\nul" mkdir "%REPO_DIR%\jaxen\jars"
if not exist "%REPO_DIR%\jaxen\jars\jaxen-1.1-beta-9.jar" copy "%MAVEN_HOME%\lib\jaxen-1.1-beta-9.jar" "%REPO_DIR%\jaxen\jars"
if not exist "%REPO_DIR%\ant\nul" mkdir "%REPO_DIR%\ant"
if not exist "%REPO_DIR%\ant\jars\nul" mkdir "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\jars\ant-1.6.5.jar" copy "%MAVEN_HOME%\lib\ant-1.6.5.jar" "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\nul" mkdir "%REPO_DIR%\ant"
if not exist "%REPO_DIR%\ant\jars\nul" mkdir "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\jars\ant-nodeps-1.6.5.jar" copy "%MAVEN_HOME%\lib\ant-nodeps-1.6.5.jar" "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\nul" mkdir "%REPO_DIR%\ant"
if not exist "%REPO_DIR%\ant\jars\nul" mkdir "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\jars\ant-junit-1.6.5.jar" copy "%MAVEN_HOME%\lib\ant-junit-1.6.5.jar" "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\nul" mkdir "%REPO_DIR%\ant"
if not exist "%REPO_DIR%\ant\jars\nul" mkdir "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\jars\ant-launcher-1.6.5.jar" copy "%MAVEN_HOME%\lib\ant-launcher-1.6.5.jar" "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\nul" mkdir "%REPO_DIR%\ant"
if not exist "%REPO_DIR%\ant\jars\nul" mkdir "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\ant\jars\ant-trax-1.6.5.jar" copy "%MAVEN_HOME%\lib\ant-trax-1.6.5.jar" "%REPO_DIR%\ant\jars"
if not exist "%REPO_DIR%\maven\nul" mkdir "%REPO_DIR%\maven"
if not exist "%REPO_DIR%\maven\jars\nul" mkdir "%REPO_DIR%\maven\jars"
if not exist "%REPO_DIR%\maven\jars\commons-jelly-1.0.1-20060717.jar" copy "%MAVEN_HOME%\lib\commons-jelly-1.0.1-20060717.jar" "%REPO_DIR%\maven\jars"
if not exist "%REPO_DIR%\commons-jelly\nul" mkdir "%REPO_DIR%\commons-jelly"
if not exist "%REPO_DIR%\commons-jelly\jars\nul" mkdir "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jelly\jars\commons-jelly-tags-ant-1.1.jar" copy "%MAVEN_HOME%\lib\commons-jelly-tags-ant-1.1.jar" "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jelly\nul" mkdir "%REPO_DIR%\commons-jelly"
if not exist "%REPO_DIR%\commons-jelly\jars\nul" mkdir "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jelly\jars\commons-jelly-tags-define-1.0.jar" copy "%MAVEN_HOME%\lib\commons-jelly-tags-define-1.0.jar" "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jelly\nul" mkdir "%REPO_DIR%\commons-jelly"
if not exist "%REPO_DIR%\commons-jelly\jars\nul" mkdir "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jelly\jars\commons-jelly-tags-util-1.1.1.jar" copy "%MAVEN_HOME%\lib\commons-jelly-tags-util-1.1.1.jar" "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jelly\nul" mkdir "%REPO_DIR%\commons-jelly"
if not exist "%REPO_DIR%\commons-jelly\jars\nul" mkdir "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jelly\jars\commons-jelly-tags-xml-1.1.jar" copy "%MAVEN_HOME%\lib\commons-jelly-tags-xml-1.1.jar" "%REPO_DIR%\commons-jelly\jars"
if not exist "%REPO_DIR%\commons-jexl\nul" mkdir "%REPO_DIR%\commons-jexl"
if not exist "%REPO_DIR%\commons-jexl\jars\nul" mkdir "%REPO_DIR%\commons-jexl\jars"
if not exist "%REPO_DIR%\commons-jexl\jars\commons-jexl-1.1.jar" copy "%MAVEN_HOME%\lib\commons-jexl-1.1.jar" "%REPO_DIR%\commons-jexl\jars"
if not exist "%REPO_DIR%\commons-logging\nul" mkdir "%REPO_DIR%\commons-logging"
if not exist "%REPO_DIR%\commons-logging\jars\nul" mkdir "%REPO_DIR%\commons-logging\jars"
if not exist "%REPO_DIR%\commons-logging\jars\commons-logging-1.0.4.jar" copy "%MAVEN_HOME%\lib\commons-logging-1.0.4.jar" "%REPO_DIR%\commons-logging\jars"
if not exist "%REPO_DIR%\commons-httpclient\nul" mkdir "%REPO_DIR%\commons-httpclient"
if not exist "%REPO_DIR%\commons-httpclient\jars\nul" mkdir "%REPO_DIR%\commons-httpclient\jars"
if not exist "%REPO_DIR%\commons-httpclient\jars\commons-httpclient-3.0.jar" copy "%MAVEN_HOME%\lib\commons-httpclient-3.0.jar" "%REPO_DIR%\commons-httpclient\jars"
if not exist "%REPO_DIR%\commons-codec\nul" mkdir "%REPO_DIR%\commons-codec"
if not exist "%REPO_DIR%\commons-codec\jars\nul" mkdir "%REPO_DIR%\commons-codec\jars"
if not exist "%REPO_DIR%\commons-codec\jars\commons-codec-1.2.jar" copy "%MAVEN_HOME%\lib\commons-codec-1.2.jar" "%REPO_DIR%\commons-codec\jars"
if not exist "%REPO_DIR%\commons-cli\nul" mkdir "%REPO_DIR%\commons-cli"
if not exist "%REPO_DIR%\commons-cli\jars\nul" mkdir "%REPO_DIR%\commons-cli\jars"
if not exist "%REPO_DIR%\commons-cli\jars\commons-cli-1.0-beta-2.jar" copy "%MAVEN_HOME%\lib\commons-cli-1.0-beta-2.jar" "%REPO_DIR%\commons-cli\jars"
if not exist "%REPO_DIR%\commons-io\nul" mkdir "%REPO_DIR%\commons-io"
if not exist "%REPO_DIR%\commons-io\jars\nul" mkdir "%REPO_DIR%\commons-io\jars"
if not exist "%REPO_DIR%\commons-io\jars\commons-io-1.2.jar" copy "%MAVEN_HOME%\lib\commons-io-1.2.jar" "%REPO_DIR%\commons-io\jars"
if not exist "%REPO_DIR%\forehead\nul" mkdir "%REPO_DIR%\forehead"
if not exist "%REPO_DIR%\forehead\jars\nul" mkdir "%REPO_DIR%\forehead\jars"
if not exist "%REPO_DIR%\forehead\jars\forehead-1.0-beta-5.jar" copy "%MAVEN_HOME%\lib\forehead-1.0-beta-5.jar" "%REPO_DIR%\forehead\jars"
if not exist "%REPO_DIR%\log4j\nul" mkdir "%REPO_DIR%\log4j"
if not exist "%REPO_DIR%\log4j\jars\nul" mkdir "%REPO_DIR%\log4j\jars"
if not exist "%REPO_DIR%\log4j\jars\log4j-1.2.13.jar" copy "%MAVEN_HOME%\lib\log4j-1.2.13.jar" "%REPO_DIR%\log4j\jars"
if not exist "%REPO_DIR%\xml-apis\nul" mkdir "%REPO_DIR%\xml-apis"
if not exist "%REPO_DIR%\xml-apis\jars\nul" mkdir "%REPO_DIR%\xml-apis\jars"
if not exist "%REPO_DIR%\xml-apis\jars\xml-apis-1.3.03.jar" copy "%MAVEN_HOME%\lib\endorsed\xml-apis-1.3.03.jar" "%REPO_DIR%\xml-apis\jars"
if not exist "%REPO_DIR%\xml-resolver\nul" mkdir "%REPO_DIR%\xml-resolver"
if not exist "%REPO_DIR%\xml-resolver\jars\nul" mkdir "%REPO_DIR%\xml-resolver\jars"
if not exist "%REPO_DIR%\xml-resolver\jars\xml-resolver-1.1.jar" copy "%MAVEN_HOME%\lib\endorsed\xml-resolver-1.1.jar" "%REPO_DIR%\xml-resolver\jars"
if not exist "%REPO_DIR%\xerces\nul" mkdir "%REPO_DIR%\xerces"
if not exist "%REPO_DIR%\xerces\jars\nul" mkdir "%REPO_DIR%\xerces\jars"
if not exist "%REPO_DIR%\xerces\jars\xercesImpl-2.8.0.jar" copy "%MAVEN_HOME%\lib\endorsed\xercesImpl-2.8.0.jar" "%REPO_DIR%\xerces\jars"
if not exist "%REPO_DIR%\org.codehaus.plexus\nul" mkdir "%REPO_DIR%\org.codehaus.plexus"
if not exist "%REPO_DIR%\org.codehaus.plexus\jars\nul" mkdir "%REPO_DIR%\org.codehaus.plexus\jars"
if not exist "%REPO_DIR%\org.codehaus.plexus\jars\plexus-utils-1.0.5.jar" copy "%MAVEN_HOME%\lib\plexus-utils-1.0.5.jar" "%REPO_DIR%\org.codehaus.plexus\jars"
if not exist "%REPO_DIR%\maven\nul" mkdir "%REPO_DIR%\maven"
if not exist "%REPO_DIR%\maven\jars\nul" mkdir "%REPO_DIR%\maven\jars"
if not exist "%REPO_DIR%\maven\jars\maven-model-3.0.2.jar" copy "%MAVEN_HOME%\lib\maven-model-3.0.2.jar" "%REPO_DIR%\maven\jars"
if not exist "%REPO_DIR%\stax\nul" mkdir "%REPO_DIR%\stax"
if not exist "%REPO_DIR%\stax\jars\nul" mkdir "%REPO_DIR%\stax\jars"
if not exist "%REPO_DIR%\stax\jars\stax-1.2.0.jar" copy "%MAVEN_HOME%\lib\stax-1.2.0.jar" "%REPO_DIR%\stax\jars"
if not exist "%REPO_DIR%\stax\nul" mkdir "%REPO_DIR%\stax"
if not exist "%REPO_DIR%\stax\jars\nul" mkdir "%REPO_DIR%\stax\jars"
if not exist "%REPO_DIR%\stax\jars\stax-api-1.0.1.jar" copy "%MAVEN_HOME%\lib\stax-api-1.0.1.jar" "%REPO_DIR%\stax\jars"
if not exist "%REPO_DIR%\net.java.dev.stax-utils\nul" mkdir "%REPO_DIR%\net.java.dev.stax-utils"
if not exist "%REPO_DIR%\net.java.dev.stax-utils\jars\nul" mkdir "%REPO_DIR%\net.java.dev.stax-utils\jars"
if not exist "%REPO_DIR%\net.java.dev.stax-utils\jars\stax-utils-20060502.jar" copy "%MAVEN_HOME%\lib\stax-utils-20060502.jar" "%REPO_DIR%\net.java.dev.stax-utils\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\wagon-provider-api-1.0-beta-2.jar" copy "%MAVEN_HOME%\lib\wagon-provider-api-1.0-beta-2.jar" "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\wagon-http-1.0-beta-2.jar" copy "%MAVEN_HOME%\lib\wagon-http-1.0-beta-2.jar" "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\wagon-file-1.0-beta-2.jar" copy "%MAVEN_HOME%\lib\wagon-file-1.0-beta-2.jar" "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\wagon-ssh-common-1.0-beta-2.jar" copy "%MAVEN_HOME%\lib\wagon-ssh-common-1.0-beta-2.jar" "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\nul" mkdir "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\org.apache.maven.wagon\jars\wagon-ssh-1.0-beta-2.jar" copy "%MAVEN_HOME%\lib\wagon-ssh-1.0-beta-2.jar" "%REPO_DIR%\org.apache.maven.wagon\jars"
if not exist "%REPO_DIR%\commons-beanutils\nul" mkdir "%REPO_DIR%\commons-beanutils"
if not exist "%REPO_DIR%\commons-beanutils\jars\nul" mkdir "%REPO_DIR%\commons-beanutils\jars"
if not exist "%REPO_DIR%\commons-beanutils\jars\commons-beanutils-1.6.1.jar" copy "%MAVEN_HOME%\lib\commons-beanutils-1.6.1.jar" "%REPO_DIR%\commons-beanutils\jars"
if not exist "%REPO_DIR%\commons-collections\nul" mkdir "%REPO_DIR%\commons-collections"
if not exist "%REPO_DIR%\commons-collections\jars\nul" mkdir "%REPO_DIR%\commons-collections\jars"
if not exist "%REPO_DIR%\commons-collections\jars\commons-collections-3.0.jar" copy "%MAVEN_HOME%\lib\commons-collections-3.0.jar" "%REPO_DIR%\commons-collections\jars"
if not exist "%REPO_DIR%\commons-lang\nul" mkdir "%REPO_DIR%\commons-lang"
if not exist "%REPO_DIR%\commons-lang\jars\nul" mkdir "%REPO_DIR%\commons-lang\jars"
if not exist "%REPO_DIR%\commons-lang\jars\commons-lang-2.0.jar" copy "%MAVEN_HOME%\lib\commons-lang-2.0.jar" "%REPO_DIR%\commons-lang\jars"
if not exist "%REPO_DIR%\com.jcraft\nul" mkdir "%REPO_DIR%\com.jcraft"
if not exist "%REPO_DIR%\com.jcraft\jars\nul" mkdir "%REPO_DIR%\com.jcraft\jars"
if not exist "%REPO_DIR%\com.jcraft\jars\jsch-0.1.27.jar" copy "%MAVEN_HOME%\lib\jsch-0.1.27.jar" "%REPO_DIR%\com.jcraft\jars"
goto end
:MHusage
echo MAVEN_HOME must be set
:usage
echo usage: %0 [repository directory]
:end
