一、java-maven常用命令

mvn archetype:create 创建Maven项目
mvn compile 编译源代码
mvn deploy 发布项目
mvn test-compile 编译测试源代码
mvn test 运行应用程序中的单元测试
mvn site 生成项目相关信息的网站
mvn clean 清除项目目录中的生成结果
mvn package 根据项目生成的jar
mvn install 在本地Repository中安装jar
mvn eclipse:eclipse 生成eclipse项目文件
mvnjetty:run 启动jetty服务
mvntomcat:run 启动tomcat服务

二、利用java-maven创建一个最简单的Hello World项目。

1、编写pom文件

首先创建一个名为hello-world的文件夹,打开该文件夹,新建一个名为pom.xml的文件,输入其内容如代码如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.</modelVersion>
<groupId>com.juvenxu.mvnbook</groupId>
<artifactId>hello-world</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Maven Hello World Project</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.2.</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.juvenxu.mvnbook.helloworld.HelloWorld</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

2、编写主代码

默认情况下,Maven假设项目主代码位于src/main/java目录,我们遵循Maven的约定,创建该目录,然后在该目录下创建文件com/juvenxu/mvnbook/helloworld/HelloWorld.java,其内容如下

package com.juvenxu.mvnbook.helloworld; 

public class HelloWorld {
public String sayHello() {
return "Hello Maven";
} public static void main(String[] args) {
System.out.print( new HelloWorld().sayHello());
}
}

这是一个简单的Java类,它有一个sayHello()方法,返回一个String。同时这个类还带有一个main方法,创建一个HelloWorld实例,调用sayHello()方法,并将结果输出到控制台。

在项目根目录下运行命令 mvn clean compile ,我们会得到如下输出

[root@wangmaster hello-world]# mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.juvenxu.mvnbook:hello-world >-------------------
[INFO] Building Maven Hello World Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hello-world ---
[INFO] Deleting /opt/project/maven/hello-world/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello-world ---
[WARNING] Using platform encoding (UTF- actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/project/maven/hello-world/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello-world ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-, i.e. build is platform dependent!
[INFO] Compiling source file to /opt/project/maven/hello-world/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.659 s
[INFO] Finished at: --13T05::+:
[INFO] ------------------------------------------------------------------------

3、编写测试代码

Maven项目中默认的主代码目录是src/main/java,对应地,Maven项目中默认的测试代码目录是src/test/java。因此,在编写测试用例之前,我们先创建该目录。

在该目录下添加HelloWorldTest.java文件,内容如下

package com.juvenxu.mvnbook.helloworld;
import static org.junit.Assert.assertEquals;
import org.junit.Test; public class HelloWorldTest { @Test
public void testSayHello() {
HelloWorld helloWorld = new HelloWorld();
String result = helloWorld.sayHello(); assertEquals( "Hello Maven", result );
}
}

测试用例编写完毕之后就可以调用Maven执行测试,运行 mvn clean test :

[root@wangmaster hello-world]# mvn clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.juvenxu.mvnbook:hello-world >-------------------
[INFO] Building Maven Hello World Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hello-world ---
[INFO] Deleting /opt/project/maven/hello-world/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello-world ---
[WARNING] Using platform encoding (UTF- actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/project/maven/hello-world/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello-world ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-, i.e. build is platform dependent!
[INFO] Compiling source file to /opt/project/maven/hello-world/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hello-world ---
[WARNING] Using platform encoding (UTF- actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/project/maven/hello-world/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hello-world ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-, i.e. build is platform dependent!
[INFO] Compiling source file to /opt/project/maven/hello-world/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.:test (default-test) @ hello-world ---
[INFO] Surefire report directory: /opt/project/maven/hello-world/target/surefire-reports -------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.juvenxu.mvnbook.helloworld.HelloWorldTest
Tests run: , Failures: , Errors: , Skipped: , Time elapsed: 0.212 sec Results : Tests run: , Failures: , Errors: , Skipped: [INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.599 s
[INFO] Finished at: --13T05::+:
[INFO] ------------------------------------------------------------------------

4、打包及运行

Hello World的POM中没有指定打包类型,使用默认打包类型jar,我们可以简单地执行命令 mvn clean package 进行打包。

[root@wangmaster hello-world]# mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.juvenxu.mvnbook:hello-world >-------------------
[INFO] Building Maven Hello World Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.2.1/maven-shade-plugin-1.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.2.1/maven-shade-plugin-1.2.1.pom (5.8 kB at 1.9 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/13/maven-plugins-13.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/13/maven-plugins-13.pom (12 kB at 18 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.2.1/maven-shade-plugin-1.2.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-shade-plugin/1.2.1/maven-shade-plugin-1.2.1.jar (68 kB at 63 kB/s)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hello-world ---
[INFO] Deleting /opt/project/maven/hello-world/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello-world ---
[WARNING] Using platform encoding (UTF- actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/project/maven/hello-world/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello-world ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-, i.e. build is platform dependent!
[INFO] Compiling source file to /opt/project/maven/hello-world/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hello-world ---
[WARNING] Using platform encoding (UTF- actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/project/maven/hello-world/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hello-world ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-, i.e. build is platform dependent!
[INFO] Compiling source file to /opt/project/maven/hello-world/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.:test (default-test) @ hello-world ---
[INFO] Surefire report directory: /opt/project/maven/hello-world/target/surefire-reports -------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.juvenxu.mvnbook.helloworld.HelloWorldTest
Tests run: , Failures: , Errors: , Skipped: , Time elapsed: 0.142 sec Results : Tests run: , Failures: , Errors: , Skipped: [INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ hello-world ---
[INFO] Building jar: /opt/project/maven/hello-world/target/hello-world-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-shade-plugin:1.2.:shade (default) @ hello-world ---
Downloading from central: https://repo.maven.apache.org/maven2/asm/asm/3.1/asm-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/asm/asm/3.1/asm-3.1.pom (278 B at 515 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/asm/asm-parent/3.1/asm-parent-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/asm/asm-parent/3.1/asm-parent-3.1.pom (4.2 kB at 8.4 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/asm/asm-commons/3.1/asm-commons-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/asm/asm-commons/3.1/asm-commons-3.1.pom (436 B at 807 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/asm/asm-tree/3.1/asm-tree-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/asm/asm-tree/3.1/asm-tree-3.1.pom (425 B at 863 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/jdom/jdom/1.0/jdom-1.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/jdom/jdom/1.0/jdom-1.0.pom (1.2 kB at 2.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/1.1/maven-dependency-tree-1.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/1.1/maven-dependency-tree-1.1.pom (2.9 kB at 5.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/8/maven-shared-components-8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/8/maven-shared-components-8.pom (2.7 kB at 4.7 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/7/maven-parent-7.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/7/maven-parent-7.pom (21 kB at 31 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom (2.7 kB at 4.8 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.8/maven-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.8/maven-2.0.8.pom (12 kB at 19 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/6/maven-parent-6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/6/maven-parent-6.pom (20 kB at 28 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.pom (2.1 kB at 3.5 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom (3.1 kB at 5.5 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom (2.3 kB at 4.0 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.pom (2.0 kB at 4.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.pom (2.7 kB at 5.3 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.pom (1.9 kB at 4.3 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom (1.6 kB at 2.8 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.pom (2.0 kB at 4.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar
Downloading from central: https://repo.maven.apache.org/maven2/asm/asm/3.1/asm-3.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/asm/asm-commons/3.1/asm-commons-3.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/asm/asm-tree/3.1/asm-tree-3.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/jdom/jdom/1.0/jdom-1.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/asm/asm/3.1/asm-3.1.jar (43 kB at 38 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/1.1/maven-dependency-tree-1.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/asm/asm-tree/3.1/asm-tree-3.1.jar (22 kB at 13 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/asm/asm-commons/3.1/asm-commons-3.1.jar (33 kB at 14 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-dependency-tree/1.1/maven-dependency-tree-1.1.jar (34 kB at 15 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/jdom/jdom/1.0/jdom-1.0.jar (153 kB at 57 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar (251 kB at 75 kB/s)
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /opt/project/maven/hello-world/target/hello-world-1.0-SNAPSHOT.jar with /opt/project/maven/hello-world/target/hello-world-1.0-SNAPSHOT-shaded.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.081 s
[INFO] Finished at: --13T05::+:
[INFO] ------------------------------------------------------------------------

我们还需要一个安装的步骤,执行 mvn clean install:

[root@wangmaster hello-world]# mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.juvenxu.mvnbook:hello-world >-------------------
[INFO] Building Maven Hello World Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hello-world ---
[INFO] Deleting /opt/project/maven/hello-world/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello-world ---
[WARNING] Using platform encoding (UTF- actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/project/maven/hello-world/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello-world ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-, i.e. build is platform dependent!
[INFO] Compiling source file to /opt/project/maven/hello-world/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hello-world ---
[WARNING] Using platform encoding (UTF- actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/project/maven/hello-world/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hello-world ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-, i.e. build is platform dependent!
[INFO] Compiling source file to /opt/project/maven/hello-world/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.:test (default-test) @ hello-world ---
[INFO] Surefire report directory: /opt/project/maven/hello-world/target/surefire-reports -------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.juvenxu.mvnbook.helloworld.HelloWorldTest
Tests run: , Failures: , Errors: , Skipped: , Time elapsed: 0.171 sec Results : Tests run: , Failures: , Errors: , Skipped: [INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ hello-world ---
[INFO] Building jar: /opt/project/maven/hello-world/target/hello-world-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-shade-plugin:1.2.:shade (default) @ hello-world ---
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /opt/project/maven/hello-world/target/hello-world-1.0-SNAPSHOT.jar with /opt/project/maven/hello-world/target/hello-world-1.0-SNAPSHOT-shaded.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ hello-world ---
[INFO] Installing /opt/project/maven/hello-world/target/hello-world-1.0-SNAPSHOT.jar to /root/.m2/repository/com/juvenxu/mvnbook/hello-world/1.0-SNAPSHOT/hello-world-1.0-SNAPSHOT.jar
[INFO] Installing /opt/project/maven/hello-world/pom.xml to /root/.m2/repository/com/juvenxu/mvnbook/hello-world/1.0-SNAPSHOT/hello-world-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.932 s
[INFO] Finished at: --13T05::+:
[INFO] ------------------------------------------------------------------------

现在,我们在项目根目录中执行该jar文件:

[root@wangmaster hello-world]# java -jar target/hello-world-1.0-SNAPSHOT.jar
Hello Maven

参考文章:https://blog.csdn.net/u010523770/article/details/70168353

java项目构建工具Maven的更多相关文章

  1. Java项目工程化之项目构建工具Maven

    欢迎查看Java开发之上帝之眼系列教程,如果您正在为Java后端庞大的体系所困扰,如果您正在为各种繁出不穷的技术和各种框架所迷茫,那么本系列文章将带您窥探Java庞大的体系.本系列教程希望您能站在上帝 ...

  2. 项目构建工具maven的使用方法

    最近在开发javaweb项目中有用到maven,以前并不是很了解,于是学习了一些相关内容,记之共享. 本篇内容在Windows环境下实施,JDK版本使用的1.7.0_79. 一.maven是什么? 简 ...

  3. 走进JavaWeb技术世界12:从手动编译打包到项目构建工具Maven

    小李的Build之路(上) 转自: 刘欣 码农翻身 2016-07-10 摘要:手工Build的烦恼要不是为了和女朋友留在一个城市,小李肯定去北上广奋斗去了.现在他只能留在这个2.5线城市,进入这家软 ...

  4. 项目构建工具Maven

  5. 项目管理构建工具——Maven(基础篇)

    项目管理构建工具--Maven(基础篇) 在前面的内容中我们学习了JDBC并且接触到了jar包概念 在后面我们的实际开发中会接触到很多jar包,jar包的导入需要到互联网上进行就会导致操作繁琐 Mav ...

  6. 取代 Maven?这款项目构建工具性能提升 300%

    在 GitHub 上闲逛的时候,发现了一个新的项目:maven-mvnd,持续霸占 GitHub trending 榜单好几天了. maven-mvnd,可以读作 Maven Daemon,译作 Ma ...

  7. 项目管理及自动构建工具Maven

    项目管理及自动构建工具Maven 一.Maven安装.目录结构.cmd命令1.下载安装apache-maven-3.2.3-bin.zip下载:http://maven.apache.org/down ...

  8. 【项目构建工具】 Gradle笔记1

    一.Gradle简介 Gradle是一个基于Apache Ant和Apache Maven概念的项目自动化构建开源工具.它使用一种基于Groovy的特定领域语言(DSL)来声明项目设置,抛弃了基于XM ...

  9. 项目管理构建工具——Maven(高阶篇)

    项目管理构建工具--Maven(高阶篇) 我们在之前的文章中已经基本了解了Maven,但也仅仅只止步于了解 Maven作为我们项目管理构建的常用工具,具备许多功能,在这篇文章中我们来仔细介绍 分模块开 ...

随机推荐

  1. day5-2正则表达式

    正则表达式: 正则表达式对象的创建 1,构造函数 var pattern =new RegExp("正则表达式","修饰符") var pattern =new ...

  2. 1013 Battle Over Cities (25分) DFS | 并查集

    1013 Battle Over Cities (25分)   It is vitally important to have all the cities connected by highways ...

  3. Java面向对象编程 -1.2

    类与对象简介 类是某一类事物的共性的抽象概念 而对象描述的是一个具体的产物 类是一个模板,而对象才是类可以使用的实例,先有类再有对象 在类之中一般都会有两个组成: 成员属性(Filed) :有些时候为 ...

  4. Python数据类型-1 数据类型介绍

    数据类型 在python这门语言中,数据类型分为两种. 内置的和自定义的. 内置的包括数字.字符串.布尔.列表.元组.字典.Bytes.集合这些常用的以及一些不太常用的数据类型.而自定义的,一般以类的 ...

  5. Python基础-4 运算符

    运算符 运算符:以1 + 2为例,1和2被称为操作数,"+" 称为运算符. Python语言支持以下类型的运算符: 算术运算符 比较(关系)运算符 赋值运算符 逻辑运算符 位运算符 ...

  6. redis 高性能的原因

    1. redis 数据存储在内存中: 2. redis 是单线程: 3. redis 多路复用: 指令先放到队列里 4.redis 使用resp 协议

  7. 树莓派4B踩坑指南 - (2)安装系统及初始化

    安装系统及初始化 格式化TF卡:SDFormatter 4.0.如果需要换系统,则必须先烧录进一个空img,然后再格式化! 烧录系统:Win32DiskImager-0.9.5 更改默认密码:账号pi ...

  8. Python的类(class)和实例(Instance)如何操作使用

    面向对象最重要的概念就是类(Class)和实例(Instance),必须牢记类是抽象的模板,比如Student类,而实例是根据类创建出来的一个个具体的“对象”,每个对象都拥有相同的方法,但各自的数据可 ...

  9. ORACLE 用32進制表示月中的一天

    WHEN 'YMD' THEN             v_year := to_char(SYSDATE, 'Y');             v_month := FN_CONVERT_DECIM ...

  10. Day9 - A - Apple Catching POJ - 2385

    Description 有两棵APP树,编号为1,2.每一秒,这两棵APP树中的其中一棵会掉一个APP.每一秒,你可以选择在当前APP树下接APP,或者迅速移动到另外一棵APP树下接APP(移动时间可 ...