1.水戸
#2。一般的な
私は、既存のパッケージでネクサスを期待して、倉庫パックのすべてをアップロードしたいので、私が追加されていない、カバーしていません。私は、一括アップロードジャーにしたいと思います。
3.スキーム1 - 一括アップロードスクリプト
PS:nexus3.xバージョンでは、スクリプトのみをアップロードすることができます
瓶に3.1バッチ
- MACディレクトリでは、新しいフォルダのレポを作成し、我々は、ローカルライブラリフォルダの大半を配置する必要があり、フォルダの許可
(base) lcc@lcc nexus-3.22.0-02$ mkdir repo2
(base) lcc@lcc nexus-3.22.0-02$ chmod -R 777 repo2
スクリプトを作成します。
(base) lcc@lcc nexus-3.22.0-02$ vi maven_local_to_nexus.sh
内容如下
#!/bin/bash
# copy and run this script to the root of the repository directory containing files
# this script attempts to exclude uploading itself explicitly so the script name is important
# Get command line params
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}/{} ;
リンクを確立するためのスクリプトの実行許可を与えられました
./maven_local_to_nexus.sh -u admin -p 123456 -r http://localhost:8081/repository/maven-lcc
しかし、このようなAのデフォルト後の下で、システム全体にアップロードされます。
実行効果の後
< HTTP/1.1 201 Created
< Date: Mon, 30 Mar 2020 07:24:03 GMT
< Server: Nexus/3.22.0-02 (OSS)
< X-Content-Type-Options: nosniff
< Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
< X-XSS-Protection: 1; mode=block
< Content-Length: 0
<
* Connection #0 to host localhost left intact
* Trying ::1:8081...
* TCP_NODELAY set
* Connection failed
* connect to ::1 port 8081 failed: Connection refused
* Trying 127.0.0.1:8081...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8081 (#0)
* Server auth using Basic with user 'admin'
> PUT /repository/maven-lcc/snapshots/system/org/sonatype/nexus/nexus-oss-edition/3.22.0-02/nexus-oss-edition-3.22.0-02-features.xml HTTP/1.1
> Host: localhost:8081
> Authorization: Basic YWRtaW46MTIzNDU2
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 469
> Expect: 100-continue
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
インターフェース示します
4.スキーム2 - ダイレクトコピー(ネクサス2)
PWの中央にコピーローカル倉庫ジャーパッケージ(私のパスはDである:\ネクサス\ネクサス2.14.8-01束\ sonatype作業\ネクサス\ストレージ\中央)、
それから更新索引,不更新索引无效
参考ます。https://blog.csdn.net/libusi001/article/details/99593832