zoukankan      html  css  js  c++  java
  • maven-source-plugin 自动将源码打包并发布

    maven-source-plugin提供项目自动将源码打包并发布的功能,在需要发布源码项目的pom.xml文件中添加如下代码即可:

    <!-- Source attach plugin -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-source-plugin</artifactId>
    <executions>
    <execution>
    <id>attach-sources</id>
    <goals>
    <goal>jar</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    执行 mvn install,maven会自动将source install到repository 。
    执行 mvn deploy,maven会自动将source deploy到remote-repository 。
    执行 mvn source:jar,单独打包源码。

    注意:在多项目构建中,将source-plugin置于顶层或parent的pom中并不会发挥作用,必须置于具体项目的pom中。

    maven-deploy-plugin
    maven-compiler-plugin:maven的默认编译使用的jdk版本貌似很低,使用maven-compiler-plugin插件可以指定项目源码的jdk版本,编译后的jdk版本,以及编码
    maven-surefire-plugin:如果你执行过mvn test或者执行其他maven命令时跑了测试用例,你就已经用过maven-surefire-plugin了。maven-surefire-plugin是maven里执
    行测试用例的插件,不显示配置就会用默认配置。这个插件的surefire:test命令会默认绑定maven执行的test阶段。
    maven-checkstyle-plugin
    spring-javaformat-maven-plugin
    spring-boot-maven-plugin   <!--spring-boot-maven-plugin 是需要启动主类的-->
    maven-shade-plugin
    maven-plugin-annotations
    maven-assembly-plugin
    maven-release-plugin 结合<scm>使用的
  • 相关阅读:
    练习上传下载时遇到的问题
    el表达式遇到的问题
    js中for循环闭包问题记录
    随机排座位(模板) 20.10.17
    #STL:优先队列数据结构函数的用法 #堆 #优先队列数据结构(堆) #priority_queue 20.10.17
    关于int的范围
    #归并排序 归并排序的刷题记录 ~20.09.25
    #欧拉函数 ~20.8.27
    #排列 #组合 ~20.8.24
    105.七夕祭
  • 原文地址:https://www.cnblogs.com/cuiqq/p/12864184.html
Copyright © 2011-2022 走看看