1、按照一些博客
https://blog.csdn.net/a67474506/article/details/52013493
配置了一个springboot 2.0   jdk8  web的项目

https://start.spring.io/

26、创建简单的springboot

2、导入eclipse,没有相对的classpath 与 project 文件,拷贝其他项目的,修改project中的名字,再导入eclipse

26、创建简单的springboot
3、更新maven依赖,运行例子 MywharfApplication  ,启动没报错,增加url访问control

26、创建简单的springboot
4、打包成jar文件,放在 阿里云上运行。

右键maven build ...     输入clean package  再在skin Test 打上钩。打完包在target中看看打完后的jar。  mywharf-0.0.1-SNAPSHOT.jar

26、创建简单的springboot

将mywharf-0.0.1-SNAPSHOT.jar 拷贝到阿里云某目录下,运行。
nohup java -jar mywharf-0.0.1-SNAPSHOT.jar  -server.port=8080 &

26、创建简单的springboot

nohup和&是后台运行命令 
项目中创建了不同环境的配置文件,
application-test.properties
application-dev.properties

运行时也可以手动指定,不指定默认就是读  application.properties
nohup java -Dspring.profiles.active=test -jar mywharf-0.0.1-SNAPSHOT.jar  -server.port=8080 &
 

公网访问:

26、创建简单的springboot

 

待续。。。。。。   

①、项目代码结构划分。日记落盘目录 logback

②、数据库 mysql

③、整合前端页面  选型?

④、整合后端技术 dubbo   有无必要? 需要zk,貌似无rpc调用

⑤、spring cloud 限流等?

 

 

5、推送代码到远程git

参照前面文章第8步后面的内容  https://blog.csdn.net/chinaCsdnV2/article/details/80458610


推送github

①、通过github创建repository  【这里不创建gitignore ,防止与项目中的冲突】

②、在项目根目录下添加文件.gitignore  【这里手动创建】
③、在terminal中执行github提示的命令【GitHub创建repository时就有命令提示】


#初始化本地仓库
git init
#将本地内容添加至git索引中
git add .
#将索引添加至本地仓库中
git commit -m "first commit"
#添加远程仓库路径
git remote add origin https://github.com/xxxxx/xxxxx.git
#将本地内容push至远程仓库中
git push -u origin master

 

 

代码地址:https://github.com/gemeiren/mywharf

 

 


由于前面通过github创建repository 不小心加了gitignore ,项目中也增加了gitignore 
git 出现 fatal: refusing to merge unrelated histories 错误

https://www.centos.bz/2018/03/git-%E5%87%BA%E7%8E%B0-fatal-refusing-to-merge-unrelated-histories-%E9%94%99%E8%AF%AF/

最后采用了强制拉取,解决本地冲突的方法
第二种方法:
使用这个强制的方法

git pull origin master --allow-unrelated-histories

相关文章:

  • 2021-12-31
  • 2022-12-23
  • 2021-12-11
  • 2021-10-11
  • 2021-12-01
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-21
  • 2021-08-05
  • 2021-07-18
  • 2021-07-31
  • 2021-05-29
  • 2021-11-29
  • 2021-08-09
相关资源
相似解决方案