Eclipse STS
Java代码自动补全
修改 Window -> Perferences -> Java -> Editor -> Content Assist : 右边出现的选项中Auto activation triggers for Java 修改为 .abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
XML 自动补全
Windows -> preferance -> XML -> XML Files -> Editor -> Content Assist:右边出现的选项中Prompt when these characters are inserted修改为 <=:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
快捷键
- 在光标所在行的下一行加一空行:
shift+enter - 在光标所在行的上一行加一空行:
ctrl+shift+enter
Eclipse 中文乱码问题解决
MAVEN
添加依赖自动提示
修改 Window -> Perferences -> Maven : 勾选右边出现的选项
Download repository index updates on startupWindow中的show view,选择other。点开Maven,选择“Maven Respositories”,点开"Global Respositories",在alimaven或central上点击右键选择“rebuild index”更新索引。此过程需要网络。如果网速慢,可能比较耗时; Local Repository右键选择Rebuild index(如果不出现Local Repository,重启eclipse)
重启eclipse
分模块管理
版本锁定
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring.cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
添加Maven仓库镜像
<repositories>
<repository>
<id>aliyun-repos</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<!--https://github.com/jacek99/structlog4j -->
<repository>
<id>jcenter</id>
<url>http://jcenter.bintray.com</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>