Maven配置jar(war)包自动打包上传Maven服务器的配置

Maven配置jar(war)包自动打包上传Maven服务器的配置

  1. 创建jar(war)包工程
    1. 创建一个maven工程

      Maven配置jar(war)包自动打包上传Maven服务器的配置

    2. 在工程中穿件一个测试类

      Maven配置jar(war)包自动打包上传Maven服务器的配置

     

  2. 配置pom.xml

    Maven配置jar(war)包自动打包上传Maven服务器的配置

<distributionManagement>

    <repository>

<id>nexus-releases</id>

<url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url>

</repository>

<snapshotRepository>

<id>nexus-snapshots</id>

<url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url>

</snapshotRepository>

</distributionManagement>

 

  1. 配置setting文件

    Maven配置jar(war)包自动打包上传Maven服务器的配置

  2. 上传
    1. 使用eclipse上传

      Maven配置jar(war)包自动打包上传Maven服务器的配置

    2. 使用命令上传

    Maven配置jar(war)包自动打包上传Maven服务器的配置

  3. 查看上传是否成功

    Maven配置jar(war)包自动打包上传Maven服务器的配置

  4. 测试

    新建一个maven工程,在工程中引入提交的jar包

    Maven配置jar(war)包自动打包上传Maven服务器的配置

    书写测试方法

    Maven配置jar(war)包自动打包上传Maven服务器的配置