1.常用命令.md

travis

  • ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
  • mvn deploy -Prelease -DskipTests=true -Dmaven.javadoc.skip=true -B -V

修改版本

mvn versions:set -DnewVersion=1.2.0-SNAPSHOT

手动下载源码

  • 指定jar
    mvn dependency:sources -DincludeArtifactIds=common-annotation

  • 全量sources
    mvn dependency:resolve -Dclassifier=sources

archetype

mvn clean archetype:create-from-project -Darchetype.properties=./archetype.properties -Darchetype.filteredExtentions=java,xml,jsp,properties,sql

mvn archetype:generate -DgroupId=com.hellobike.base -DartifactId=mytest -Dpackage=com.hellobile.base.mytest -Dversion=1.0.0-SNAPSHOT -DarchetypeGroupId=com.hellobike.helloboot -DarchetypeArtifactId=sample-helloboot-archetype -DarchetypeVersion=1.0.0-SNAPSHOT 

SNAPSHOT 不带日期

默认本地打包带不带日期, 从服务器下载的就带日期

远程下载也不带日期, 需要打包时候指定:

mvn clean deploy -DuseUniqueVersions=false

显示有效完整的pom 文件

mvn help:effective-pom

Maven定制化打包后的包名(加入时间戳)

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.build.timestamp.format>yyyy-MM-dd_HH_mm</maven.build.timestamp.format>
  </properties>

  <build>
    <finalName>${project.artifactId}-${maven.build.timestamp}</finalName>
  </build>

2.archetype.md

基于 Maven Archetype 创建项目
How is metadata about an archetype stored?

变量配置

  <requiredProperties>
    <requiredProperty key="property-with-default">
      <defaultValue>default-value</defaultValue>
    </requiredProperty>
    <requiredProperty key="property-without-default"/>
  </requiredProperties>

Copyright © 2018 INSTALL.REN