记录自己开发入职第一天需要干的事情

拉取代码前的准备工作

安装JDK;数据库本地可视化客户端(如Navicat、SQLyog、DBeaver、Workbench )、Windows连接linux终端工具(Xshell、SecureCRT、Putty)

下载IDEA——配置IDEA开发环境

  • maven路径配置、setting文件配置及仓库配置

可配置本地仓库、公司私有仓库和中央仓库

1、本地仓库,也就是maven_home的地址 

<!--本地仓库,每个人设置的可能不一样-->
<localRepository>D:\dev\repository</localRepository>

 2、公司的私有仓库配置

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
      <username>你的用户名</username>
      <password>你的密码</password>
      <id>central</id>
    </server>
    <server>
      <username>你的用户名</username>
      <password>你的密码</password>
      <id>snapshots</id>
    </server>
  </servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://ip:端口/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://ip:端口/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>plugins-release</name>
          <url>http://ip:端口/artifactory/plugins-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>plugins-snapshot</name>
          <url>http://ip:端口/artifactory/plugins-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

可参考:https://www.jianshu.com/p/dfd02fa239e2

3、以下是某位大佬关于阿里云镜像仓库的配置文件参考,转自:https://www.cnblogs.com/Narule/p/12595960.html 

<?xml version="1.0" encoding="UTF-8"?>


<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  
   <!-- 此处修改maven_home地址 -->
  <localRepository>E:\data\code\maven_home</localRepository>

  <mirrors>
     <!-- 阿里云仓库 
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
		-->
		<mirror>
			<id>alimaven</id>
			<name>aliyun maven</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
			<mirrorOf>central</mirrorOf>
		</mirror>
        <!-- 中央仓库1 
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>
-->
        <!-- 中央仓库2  
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
		-->
		<!--
        <mirror>
          <id>mirrorId</id>
          <mirrorOf>repositoryId</mirrorOf>
          <name>Human Readable Name for this Mirror.</name>
          <url>http://my.repository.com/repo/path</url>
        </mirror>
		-->
<!--
     <mirror>  
	  <id>alimaven</id>  
	  <name>aliyun maven</name>  
	  <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
	  <mirrorOf>central</mirrorOf>          
	 </mirror>
	 -->
  </mirrors>

  <profiles>
	<profile>    
		<id>jdk-1.8</id>    
		<activation>    
          <activeByDefault>true</activeByDefault>    
          <jdk>1.8</jdk>    
		</activation>    
		<properties>    
			<maven.compiler.source>1.8</maven.compiler.source>    
			<maven.compiler.target>1.8</maven.compiler.target>    
			<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
		</properties>    
	</profile>
  </profiles>

</settings>
  • 安装插件

如果需要lombok(注解)、Grep Console(彩色控制台)、Translation(翻译)、Alibaba Cloud Toolkit(部署)等插件,下载配置

 

  • 可配置git的路径、开通代码权限,git拉取代码(参考:git相关命令大全)

  • maven 打包,启动项目

开始时打包没成功,系统打包的时候需要指定一些参数:

mvn clean install -Denv=dev -DappId=指定的appId号码 -Dmaven.test.skip=true

启动的时候也要加一下启动参数:-Denv=dev -DappId=指定的appId号码

//控制台log显示颜色 -Denv=dev -Dspring.output.ansi.enabled=ALWAYS

  • swagger访问SpringBoot项目地址

远程:http://id地址:端口号/项目名/swagger-ui.html

本地:http://localhost:端口号/项目名/swagger-ui.html

端口号为:yml文件中server:port: 8080,配置的端口号

项目名为:yml文件中server:servlet:contextPath: /dev,设置的名称

  • 0
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

笑嫣如❀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值