简介

为了满足审计需要,将二方包和三方包纳入审计。该方案计划做以下工作:1. maven deploy 到独立仓库;2. 打包时候,作替换

操作步骤

第一步

建立私有仓库

http://*.*.*.*:8081/repository/maven-releases/

该仓库开启allow redeploy,即允许覆盖更新包

第二步

配置maven全局settings.xml文件,增加server

<servers>
  <server>
    <id>maven-releases</id>
    <username>admin</username>
    <password>2222</password>
  </server>
  <server>
    <id>maven-snapshots</id>
    <username>admin</username>
    <password>1111</password>
  </server>
</servers>

第三步

调整deploy命令

mvn deploy -Dmaven.test.skip=true  -DaltDeploymentRepository=maven-releases::default::http://*.*.*.*:8081/repository/maven-releases/

策略A:api

mvn deploy -Dmaven.test.skip=true  -DaltDeploymentRepository=maven-releases::default::http://*.*.*.*:8081/repository/maven-releases/  --non-recursive
cd *-*-api && mvn deploy -Dmaven.test.skip=true  -DaltDeploymentRepository=maven-releases::default::http://*.*.*.*:8081/repository/maven-releases/

策略B:all

mvn deploy -Dmaven.test.skip=true  -DaltDeploymentRepository=maven-releases::default::http://*.*.*.*:8081/repository/maven-releases/