1. setting文件 配置私服中设置的用户和密码

  1. <servers>
  2. <server>
  3. <id>releases</id>
  4. <username>admin</username>
  5. <password>xxxxxxxxxxx</password>
  6. </server>
  7. <server>
  8. <id>snapshots</id>
  9. <username>admin</username>
  10. <password>xxxxxxxxx</password>
  11. </server>
  12. <server>
  13. <id>Nexus</id>
  14. <username>admin</username>
  15. <password>xxxxxxx</password>
  16. </server>
  17. <server>
  18. <id>Nexus2</id>
  19. <username>admin</username>
  20. <password>xxxxxxx</password>
  21. </server>

2.需要打包的项目的pom.xml配置

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <version>1.1.0</version>
  5. <modelVersion>4.0.0</modelVersion>
  6. <packaging>jar</packaging>
  7. <artifactId>msg-service</artifactId>
  8.  
  9. <properties>
  10. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  11. <maven.compiler.plugin.version>3.2</maven.compiler.plugin.version>
  12. <maven_jar_plugin_version>2.4</maven_jar_plugin_version>
  13. </properties>
  14.  
  15. <dependencies>
  16.  
  17. <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin -->
  18. <dependency>
  19. <groupId>org.apache.maven.plugins</groupId>
  20. <artifactId>maven-dependency-plugin</artifactId>
  21. <version>3.0.1</version>
  22. </dependency>
  23.  
  24. </dependencies>
  25.  
  26. <distributionManagement>
  27. <repository>
  28. <id>releases</id>
  29. <name>Maven Snapshots</name>
  30. <url>http://192.168.79.16:9081/nexus/content/repositories/releases</url>
  31. </repository>
  32. <snapshotRepository>
  33. <id>snapshots</id>
  34. <name>Maven Snapshots</name>
  35. <url>http://192.168.79.16:9081/nexus/content/repositories/snapshots</url>
  36. </snapshotRepository>
  37. </distributionManagement>
  38.  
  39. <build>
  40. <finalName>msg-service</finalName>
  41. <sourceDirectory>src/main/java/com/fqgj/jkzj/msg/service</sourceDirectory>
  42. <!--<resources>-->
  43. <!--&lt;!&ndash; 控制资源文件的拷贝 &ndash;&gt;-->
  44. <!--<resource>-->
  45. <!--<directory>...</directory>-->
  46. <!--</resource>-->
  47. <!--</resources>-->
  48.  
  49. <plugins>
  50. <plugin>
  51. <groupId>org.apache.maven.plugins</groupId>
  52. <artifactId>maven-compiler-plugin</artifactId>
  53. <version>${maven.compiler.plugin.version}</version>
  54. <configuration>
  55. <source>1.8</source>
  56. <target>1.8</target>
  57. </configuration>
  58. </plugin>
  59. <plugin>
  60. <inherited>true</inherited>
  61. <groupId>org.apache.maven.plugins</groupId>
  62. <artifactId>maven-surefire-plugin</artifactId>
  63. <version>2.19.1</version>
  64. <configuration>
  65. <skip>true</skip><!-- 跳过测试 -->
  66. </configuration>
  67. </plugin>
  68. <plugin>
  69. <groupId>org.apache.maven.plugins</groupId>
  70. <artifactId>maven-jar-plugin</artifactId>
  71. <version>${maven_jar_plugin_version}</version>
  72. <configuration>
  73. <archive>
  74. <addMavenDescriptor>true</addMavenDescriptor>
  75. <index>true</index>
  76. <manifest>
  77. <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
  78. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  79. </manifest>
  80. </archive>
  81. </configuration>
  82. </plugin>
  83. <plugin>
  84. <artifactId>maven-source-plugin</artifactId>
  85. <version>2.1</version>
  86. <configuration>
  87. <attach>true</attach>
  88. </configuration>
  89. <executions>
  90. <execution>
  91. <phase>compile</phase>
  92. <goals>
  93. <goal>jar</goal>
  94. </goals>
  95. </execution>
  96. </executions>
  97. </plugin>
  98. </plugins>
  99. </build>
  100. </project>

maven打包jar源码至私服的更多相关文章

  1. maven上传源码到私服

    上传源码 项目中采用了分模块的方式构建,直接将maven-source-plugin写到父pom中,尝试了很多次发现源码一直不能上传到私服中,纠结了很长时间才发现原来多模块项目和普通一个项目的配置是有 ...

  2. Maven打包生成源码包和Javadoc包

    https://blog.csdn.net/top_code/article/details/53586551 当我们开发了一个公共模块,将它deploy到Maven仓库时,最好同时提供源码包和Jav ...

  3. 使用maven&&make-distribution.sh编译打包spark源码

    1>基础环境准备: jdk1.8.0_101 maven 3.3.9scala2.11.8 安装好上述软件,配置好环境变量,并检查是否生效. 2>配置maven:intellij idea ...

  4. Spark 学习(三) maven 编译spark 源码

    spark 源码编译 scala 版本2.11.4 os:ubuntu 14.04 64位 memery 3G spark :1.1.0 下载源码后解压 1 准备环境,安装jdk和scala,具体参考 ...

  5. win7+idea+maven搭建spark源码阅读环境

    1.参考. 利用IDEA工具编译Spark源码(1.60~2.20) https://blog.csdn.net/He11o_Liu/article/details/78739699 Maven编译打 ...

  6. Maven命令下载源码和javadocs

    1:Maven命令下载源码和javadocs 当在IDE中使用Maven时如果想要看引用的jar包中类的源码和javadoc需要通过maven命令下载这些源码,然后再进行引入,通过mvn命令能够容易的 ...

  7. SpringMVC+Maven开发项目源码详细介绍

    代码地址如下:http://www.demodashi.com/demo/11638.html Spring MVC概述 Spring MVC框架是一个开源的Java平台,为开发强大的基于Java的W ...

  8. Maven 依赖调解源码解析(二):如何调试 Maven 源码和插件源码

    本文是系列文章<Maven 源码解析:依赖调解是如何实现的?>第二篇,主要介绍如何调试 Maven 源码和插件源码.系列文章总目录参见:https://www.cnblogs.com/xi ...

  9. 使用 maven 自动将源码打包并发布

    1.maven-source-plugin 访问地址 在 pom.xml 中添加 下面的 内容,可以 使用 maven 生成 jar 的同时 生成 sources 包 <plugin> & ...

随机推荐

  1. Siki_Unity_1-2_Unity5.2入门课程_进入Unity开发的奇幻世界_Roll A Ball

    1-2 Unity5.2入门课程 进入Unity开发的奇幻世界 任务1:Roll A Ball项目简介 Unity官网的tutorial入门项目 方向键控制小球在平台上滚动,碰撞方块得分,消掉所有方块 ...

  2. 手机端网页返回顶部js代码

    <!DOCTYPE html>  <html>  <head>  <meta http-equiv="Content-Type" cont ...

  3. 最小生成树(II)与Kruskal算法

    为防止网页加载过慢,故分两章.上接https://www.cnblogs.com/Uninstalllingyi/p/10479470.html Kruskal算法——将森林合并成树 玩过瘟疫公司吗… ...

  4. 创新手机游戏《3L》开发点滴(3)——道具、物品、装备表设计 V2(最终版)

    我们正在开发一款新手游,里面有道具,之前也写了一篇博文记录了下我们的设计思路,但是国庆到了,于是我有了时间继续纠结这个问题. 其实我主要是在到底是用mysql还是mongodb上纠结.这个复杂.痛苦. ...

  5. Mybatis ResultMap(2)

    SQL 映射XML 文件是所有sql语句放置的地方.需要定义一个workspace,一般定义为对应的接口类的路径.写好SQL语句映射文件后,需要在MyBAtis配置文件mappers标签中引用,例如: ...

  6. android仿win8

    在 eoe上偶然发现已经有人实现了这个功能的源码(地址:http://www.eoeandroid.com /forum.php?mod=viewthread&tid=327557),马上下载 ...

  7. [solution]xdebug正确配置,但不显示错误信息

    一开始以为是配置问题,其实不是,折腾了好久,貌似中文网页很少有人提到这事,更别提解决之道! 最好还是用英文关键词google之:得如下网页 https://bugs.launchpad.net/ubu ...

  8. Android中Parcelabel对象的使用和理解

    1. Parcelable接口 Interface for classes whose instances can be written to and restored from a Parcel. ...

  9. Linux服务器记录并查询历史操作记录

    Linux服务器在使用过程中,经常会有除自己之外的其他人员使用.并不是每个人都对Linux服务器特别熟悉,难免会有一些操作导致服务器报错. 因此,监控Linux服务器的操作并记录下来,是非常有必要的! ...

  10. python2 对URL编码进行编译

    在请求页面时有时会返回类似: %E8%AF%A5985%E5%A4%A7%E5%AD%A6%E5%B8%B8%E5%B9%B4%E4%BD%8D%E5%B1%85%E5%9B%BD%E5%86%85% ...