1. Mito
# 2. general
porque quieren cargar todo el paquete de almacén, con la esperanza de nexo en el paquete existente, no cubro, no añadida. Me gustaría tarro de carga masiva.
3. Esquema 1 - script de carga a granel
guión versión nexus3.x sólo puede subir: PS
3.1 lote en el frasco
- En el directorio Mac, crear una nueva carpeta de recompra, tenemos que poner la mayor parte de la carpeta de la biblioteca local, y la carpeta de autorización
(base) lcc@lcc nexus-3.22.0-02$ mkdir repo2
(base) lcc@lcc nexus-3.22.0-02$ chmod -R 777 repo2
Crear una secuencia de comandos
(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}/{} ;
Dada la secuencia de comandos de permiso de ejecución para establecer enlace
./maven_local_to_nexus.sh -u admin -p 123456 -r http://localhost:8081/repository/maven-lcc
Pero después de tal defecto se carga en todo el sistema bajo el.
Después de que el efecto de la ejecución
< 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
interfaz se muestra
4. Esquema 2 - copia directa (nexo 2)
El paquete frasco de almacén local de copiado en el centro de PW (mi camino es D: \ nexo \ nexo entre 2.14.8-01 de haz \ Sonatype-work \ nexo \ almacenamiento \ central), la
entonces更新索引,不更新索引无效
Referencia: https: //blog.csdn.net/libusi001/article/details/99593832