爱程序网

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

来源: 阅读:

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

 

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

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

     

  2. 配置pom.xml

<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文件

  2. 上传
    1. 使用eclipse上传

    2. 使用命令上传

  3. 查看上传是否成功

  4. 测试

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

    书写测试方法

关于爱程序网 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助