1.先使用Maven install 打包成war包,构建坐标
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------< com.swliu:jt >----------------------------
[INFO] Building jt 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jt ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jt ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jt ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ jt ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ jt ---
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ jt ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/D:/software/workspace/user/swliu/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Packaging webapp
[INFO] Assembling webapp [jt] in [D:softwareworkspacestsjttargetjt-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [D:softwareworkspacestsjtsrcmainwebapp]
[INFO] Webapp assembled in [49639 msecs]
[INFO] Building war: D:softwareworkspacestsjttargetjt-0.0.1-SNAPSHOT.war
[INFO] WEB-INFweb.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jt ---
[INFO] Installing D:softwareworkspacestsjttargetjt-0.0.1-SNAPSHOT.war to D:softwareworkspaceuserswliu.m2repositorycomswliujt .0.1-SNAPSHOTjt-0.0.1-SNAPSHOT.war
[INFO] Installing D:softwareworkspacestsjtpom.xml to D:softwareworkspaceuserswliu.m2repositorycomswliujt .0.1-SNAPSHOTjt-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:08 min
[INFO] Finished at: 2022-07-04T15:18:45+08:00
[INFO] ------------------------------------------------------------------------
2.执行脚本,将war包发布到maven私服测试
swliu@X555LJ MINGW64 /d/software/workspace/user/testswliu/repository
$ ./mavenimport.sh -u admin -p admin -r http://127.0.0.1:8081/repository/repo_swliu/
* Trying 127.0.0.1:8081...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)
* Server auth using Basic with user 'admin'
> PUT /repository/repo_swliu//com/swliu/jt/0.0.1-SNAPSHOT/jt-0.0.1-SNAPSHOT.pom HTTP/1.1
> Host: 127.0.0.1:8081
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.78.0
> Accept: **
> Content-Length: 35219387
> Expect: 100-continue
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
} [65536 bytes data]
91 33.5M 0 0 91 30.7M 0 29.5M 0:00:01 0:00:01 --:--:-- 29.5M* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 201 Created
< Date: Mon, 04 Jul 2022 09:17:25 GMT
< Server: Nexus/3.38.1-01 (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
<
100 33.5M 0 0 100 33.5M 0 22.3M 0:00:01 0:00:01 --:--:-- 22.3M
* Connection #0 to host 127.0.0.1 left intact
* Trying 127.0.0.1:8081...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)
* Server auth using Basic with user 'admin'
> PUT /repository/repo_swliu//com/swliu/jt/0.0.1-SNAPSHOT/maven-metadata-local.xml HTTP/1.1
> Host: 127.0.0.1:8081
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.78.0
> Accept: **
> Content-Length: 217
> Expect: 100-continue
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Invalid path for a Maven 2 repository
< Server: Nexus/3.38.1-01 (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
< Connection: close
<
{ [0 bytes data]
0 217 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection 0
* Trying 127.0.0.1:8081...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8081 (#0)
* Server auth using Basic with user 'admin'
> PUT /repository/repo_swliu//com/swliu/jt/maven-metadata-local.xml HTTP/1.1
> Host: 127.0.0.1:8081
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.78.0
> Accept: */*
> Content-Length: 271
> Expect: 100-continue
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Invalid path for a Maven 2 repository
< Server: Nexus/3.38.1-01 (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
< Connection: close
<
{ [0 bytes data]
0 271 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection 0
构建私服路径:



