1. Mito
# 2. General
because I want to upload all of the warehouse pack, hoping nexus in the existing package, I do not cover, not added. I would like to bulk upload jar.
3. Scheme 1 - Bulk upload script
PS: nexus3.x version can only upload script
3.1 Batch into the jar
- In mac directory, create a new folder repo, we need to put the bulk of the local library folder, and the folder Authorization
(base) lcc@lcc nexus-3.22.0-02$ mkdir repo2
(base) lcc@lcc nexus-3.22.0-02$ chmod -R 777 repo2
Create a script
(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}/{} ;
Given the script executable permission to establish link
./maven_local_to_nexus.sh -u admin -p 123456 -r http://localhost:8081/repository/maven-lcc
But after such a default is uploaded into the whole system under the.
After the execution effect
< 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
Interface shown
4. Scheme 2 - direct copy (nexus 2)
The local warehouse jar package copied to the PW central (my path is D: \ nexus \ nexus-2.14.8-01-bundle \ sonatype-work \ nexus \ storage \ central), the
then更新索引,不更新索引无效
Reference: https: //blog.csdn.net/libusi001/article/details/99593832