栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot源码环境构建:2.2.9.RELEASE版本

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot源码环境构建:2.2.9.RELEASE版本

参考:
https://zhuanlan.zhihu.com/p/385370315
这篇文章中,告诉我们如何下载springboot源码
并且,2.2.9之后不在是maven构建
所以,这里下载2.2.9版本进行构建

下载后,导入IDEA中
并新建自己的modules:spring-boot-mytest
自己新建的modules的pom内容如下:



	4.0.0
	
		org.springframework.boot
		spring-boot-starter-parent
		2.2.9.RELEASE
		 
	

	com.pzj
	spring-boot-mytest
	0.0.1-SNAPSHOT
	spring-boot-mytest
	Demo project for Spring Boot

	
		8
	

	jar

	
		
			org.springframework.boot
			spring-boot-starter-web
		

		
			org.springframework.boot
			spring-boot-starter-test
			test
		

	

	
		
			
				org.springframework.boot
				spring-boot-maven-plugin
			
		
	

这里的parent是2.2.9.RELEASE。这样就可以直接引用我们本地的springboot代码。
此贴中,在spring-boot-mytest里创建自己的controller进行访问。
但是,失败了。

解决办法:
我们需要先构建项目,才能成功。
构建步骤:
第一步:
配置maven镜像地址:

    
    aliyun  
    Nexus Aliyun  
    http://maven.aliyun.com/nexus/content/groups/public/  
    central          
    
	
	
    ui  
    Nexus UI  
    central          
    http://uk.maven.org/maven2/  
    
	
	
    ibiblio  
    Nexus Ibiblio  
    central          
    http://mirrors.ibiblio.org/pub/mirrors/maven2/  
    
	
	
    jboss-public-repository-group  
    Nexus JBoss  
    central          
    http://repository.jboss.org/nexus/content/groups/public  
    

	
    repo2  
    Nexus Repo2  
    central          
    http://repo2.maven.org/maven2/  
    

第二步:进入spring-boot-2.2.9.RELEASE中。
下载maven-wrapper
https://github.com/bdemers/maven-wrapper
第三步:命令构建
下载完成后
执行以下命令:

Linux:
./mvnw clean install -DskipTests -Pfast
Windows
mvnw.cmd clean install -DskipTests -Pfast


出现以上画面,就是构建成功。
于是,我们再回到IDEA中

启动 spring-boot-mytest 模块
访问controller即可正常访问。
这样,springboot源码就是构建成功了。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/966750.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号