maven官方安装及编译教程 | maven官方文档
2018-01-25 22:42
260 查看
maven 构建Java应用及其他应用的入门教程,建议读者参考Spring的官方文档 【点击跳转】
这里主要说明下,我们maven中编译Java代码的几个关键命令的说明,首先贴出maven帮助文档中对这几个命令的描述:
This will run Maven, telling it to execute the compile goal. When it’s finished, you should find the compiled .class files in the target/classes directory.
The package goal will compile your Java code, run any tests, and finish by packaging the code up in a JAR file within the target directory. The name of the JAR file will be based on the project’s and . For example, given the minimal pom.xml file from before, the JAR file will be named gs-maven-0.1.0.jar.
The install goal will compile, test, and package your project’s code and then copy it into the local dependency repository, ready for another project to reference it as a dependency.
Maven uses a plugin called “surefire” to run unit tests. The default configuration of this plugin compiles and runs all classes in src/test/java with a name matching *Test. You can run the tests on the command line like this
总结起来就是,如果对于Java文件的编译只是想得到其class文件,就直接用
参考官方文档 https://spring.io/guides/gs/maven/
转载请注明出处:http://blog.csdn.net/coder__cs/article/details/79167540
本文出自【elon33的博客】
这里主要说明下,我们maven中编译Java代码的几个关键命令的说明,首先贴出maven帮助文档中对这几个命令的描述:
mvn compile
This will run Maven, telling it to execute the compile goal. When it’s finished, you should find the compiled .class files in the target/classes directory.
mvn package
The package goal will compile your Java code, run any tests, and finish by packaging the code up in a JAR file within the target directory. The name of the JAR file will be based on the project’s and . For example, given the minimal pom.xml file from before, the JAR file will be named gs-maven-0.1.0.jar.
mvn install
The install goal will compile, test, and package your project’s code and then copy it into the local dependency repository, ready for another project to reference it as a dependency.
mvn test
Maven uses a plugin called “surefire” to run unit tests. The default configuration of this plugin compiles and runs all classes in src/test/java with a name matching *Test. You can run the tests on the command line like this
总结起来就是,如果对于Java文件的编译只是想得到其class文件,就直接用
mvn compile命令,如果想要编译出来的项目文件作为本地库依赖给其他项目使用时,则需要用
mvn install,对于第三种
mvn package命令,则是在需要将项目打包到其他平台运行时使用,最后
mvn test命令则是和junit测试包相关的,当./test/java文件目录下有以*Test.java结尾的Java文件时,执行这个命令就会自动开启测试。
参考官方文档 https://spring.io/guides/gs/maven/
转载请注明出处:http://blog.csdn.net/coder__cs/article/details/79167540
本文出自【elon33的博客】
相关文章推荐
- Nutch教程中文翻译1(官方教程,中英对照)——Nutch的编译、安装和简单运行
- << CocoaPods安装和使用教程 >>github code4app以及cocoachina 苹果官方文档
- cloudera hadoop maven编译安装步骤详细教程
- centos6.4 编译安装boost.python 1.54--来自官方文档
- 【opencv 官方教程】翻译1 基本安装使用 编译工程 读取、显示、保存图片
- cloudera hadoop maven编译安装步骤详细教程
- Oracle 10g 官方中文安装帮助文档以及Oracle官方中文教程文档下载
- RabbitMQ在Ubuntu 16.04下的安装教程——官方文档翻译
- [Unity官方文档翻译]Downloading and Installing Unity下载和安装unity教程
- Oracle 10g 官方中文安装帮助文档以及Oracle官方中文教程文档下载
- W3School Redis教程(安装/基本操作/高级操作/命令/官方文档/官方集群教程)
- Oracle 10g 官方中文安装帮助文档以及Oracle官方中文教程文档下载
- maven安装详解教程
- CentOS下编译安装nginx及配置缩略图插件的方法教程
- 官方Caffe—Microsoft编译安装
- BigBlueButton官方安装文档简单翻译
- Centos6.4编译安装mysql 8.0.0 详细教程
- LAMP+django手工编译安装文档
- Dojo1.11官方教程文档翻译(1.2)Hello Dojo!