- 新建 maven 宿主仓库:maven2 (hosted)
- 新建脚本:mavenimport.sh
while getopts ":r:u:p:" opt; do case $opt in r) REPO_URL="$OPTARG" ;; u) USERNAME="$OPTARG" ;; p) PASSWORD="$OPTARG" ;; esac done find . -type f -not -path './mavenimport\.sh*' -not -path '*/\.*' -not -path '*/\^archetype\-catalog\.xml*' -not -path '*/\^maven\-metadata\-local*\.xml' -not -path '*/\^maven\-metadata\-deployment*\.xml' | sed "s|^\./||" | xargs -I '{}' curl -u "$USERNAME:$PASSWORD" -X PUT -v -T {} ${REPO_URL}/{} ;
- 授权
chmod +x mavenimport.sh
- 运行上传,mavenimport.sh 脚本需要放在上传maven仓库的根目录,如图所示:
drwxr-xr-x 3 root root 19 2月 14 22:50 antlr drwxr-xr-x 3 root root 30 2月 14 22:50 avalon-framework drwxr-xr-x 3 root root 38 2月 14 22:47 backport-util-concurrent drwxr-xr-x 3 root root 25 2月 14 22:47 classworlds drwxr-xr-x 3 root root 17 2月 14 22:47 cn drwxr-xr-x 3 root root 20 2月 14 22:47 com drwxr-xr-x 3 root root 31 2月 14 22:50 commons-beanutils drwxr-xr-x 3 root root 27 2月 14 22:50 commons-chain drwxr-xr-x 3 root root 25 2月 14 22:47 commons-cli drwxr-xr-x 3 root root 27 2月 14 22:47 commons-codec drwxr-xr-x 3 root root 33 2月 14 22:50 commons-collections drwxr-xr-x 3 root root 30 2月 14 22:50 commons-digester drwxr-xr-x 3 root root 24 2月 14 22:50 commons-io drwxr-xr-x 3 root root 26 2月 14 22:47 commons-lang drwxr-xr-x 4 root root 56 2月 14 22:50 commons-logging drwxr-xr-x 3 root root 31 2月 14 22:50 commons-validator drwxr-xr-x 3 root root 19 2月 14 22:50 dom4j drwxr-xr-x 3 root root 21 2月 14 22:50 javax drwxr-xr-x 3 root root 19 2月 14 22:47 junit drwxr-xr-x 3 root root 19 2月 14 22:49 log4j drwxr-xr-x 3 root root 20 2月 14 22:50 logkit -rwxr-xr-x 1 root root 449 2月 15 21:55 mavenimport.sh drwxr-xr-x 11 root root 138 2月 14 22:50 org drwxr-xr-x 3 root root 17 2月 14 22:50 oro drwxr-xr-x 3 root root 20 2月 14 22:50 sslext drwxr-xr-x 3 root root 24 2月 14 22:50 xerces drwxr-xr-x 3 root root 22 2月 14 22:50 xml-apis
./mavenimport.sh -u 用户名 -p 密码 -r 宿主仓库地址
参与评论
您还未登录,请先
登录
后发表或查看评论
04-19
1173

“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交