maven
/Users/haogeoyes/work/code/java/pkg/apache-maven-3.8.6
jdk
/Library/Java/JavaVirtualMachines/
https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html
ls /Library/Java/JavaVirtualMachines/
jdk-11.0.16.jdk
教程
https://www.runoob.com/maven/maven-setup.html
https://maven.apache.org/download.cgi
# tar zxvf apache-maven-3.8.6-bin.tar.gz
# cat ~/.zshrc
source ~/.bash_profile
# vi ~/.bash_profile
export PATH=$PATH:/Users/haogeoyes/go/bin
export M2_HOME="/Users/haogeoyes/work/code/java/pkg/apache-maven-3.8.6"
export PATH=$PATH:$M2_HOME/bin
# mvn -v
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /Users/haogeoyes/work/code/java/pkg/apache-maven-3.8.6
Java version: 11.0.16, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.16.jdk/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "12.1", arch: "aarch64", family: "mac"
Maven 工程的基本工作单元,是一个XML文件,包含了项目的基本信息,用于描述项目如何构建,声明项目依赖
maven 配置详细说明 https://www.runoob.com/maven/maven-pom.html
4.0.0
asia.banseon
banseon-maven2
jar
1.0-SNAPSHOT
banseon-maven
http://www.baidu.com/banseon
A maven project to study maven.
jira
http://jira.baidu.com/banseon
Demo
banseon@126.com
banseon@126.com
banseon@126.com
http:/hi.baidu.com/banseon/demo/dev/
HELLO WORLD
banseon
banseon@126.com
Project Manager
Architect
demo
http://hi.baidu.com/banseon
No
-5
Apache 2
http://www.baidu.com/banseon/LICENSE-2.0.txt
repo
A business-friendly OSS license
scm:svn:http://svn.baidu.com/banseon/maven/banseon/banseon-maven2-trunk(dao-trunk)
scm:svn:http://svn.baidu.com/banseon/maven/banseon/dao-trunk
http://svn.baidu.com/banseon
demo
http://www.baidu.com/banseon
......
......
Windows XP
Windows
x86
5.1.2600
mavenVersion
2.0.3
/usr/local/hudson/hudson-home/jobs/maven-guide-zh-to-production/workspace/
/usr/local/hudson/hudson-home/jobs/maven-guide-zh-to-production/workspace/
......
......
......
......
......
......
banseon-repository-proxy
banseon-repository-proxy
http://192.168.1.169:9999/repository/
default
......
org.apache.maven
maven-artifact
3.8.1
jar
test
spring-core
org.springframework
true
......
banseon-maven2
banseon maven2
file://${basedir}/target/deploy
banseon-maven2
Banseon-maven2 Snapshot Repository
scp://svn.baidu.com/banseon:/usr/local/maven-snapshot
banseon-site
business api website
scp://svn.baidu.com/banseon:/var/www/localhost/banseon-web
验证 validate 验证项目 验证项目是否正确且所有必须信息是可用的
编译 compile 执行编译 源代码编译在此阶段完成
测试 Test 测试 使用适当的单元测试框架(例如JUnit)运行测试。
包装 package 打包 创建JAR/WAR包如在 pom.xml 中定义提及的包
检查 verify 检查 对集成测试的结果进行检查,以保证质量达标
安装 install 安装 安装打包的项目到本地仓库,以供其他项目使用
部署 deploy 部署 拷贝最终的工程包到远程仓库中,以共享给其他开发人员和工程
修改maven仓库
vi /Users/haogeoyes/work/code/java/pkg/apache-maven-3.8.6/conf/settings.xml
aliyunmaven
*
阿里云公共仓库
https://maven.aliyun.com/repository/public
新建 package
新建 class
@RestController
public class HelloController {
@RequestMapping("/")
public String hello(){
return "hello world";
}
}