直接点 CTRL + 类, 通常是编译的内容, 可以在不下载源码时简单看一下, 但有时编译效果不好, 也没有注释说明等. 这时最好是下载源码.
IDE 中都有相应功能, IDEA 和 eclipse 都有相应功能
IDEA 中下载源码 [Download Sources], 可以只下载某个 jar 包对应的源码.
命令行方式可以一次下载全部源码:
mvn dependency:sources ... Downloading from ssllrepo: http://dev.myrepo.com/artifactory/repo/com/fasterxml/classmate/1.3.4/classmate-1.3.4-sources.jar Downloaded from ssllrepo: http://dev.myrepo.com/artifactory/repo/com/fasterxml/classmate/1.3.4/classmate-1.3.4-sources.jar (48 kB at 694 kB/s) ...
下载的代码会保存到本地 maven 库里, 即 ${user.home}/.m2/repository
下
核心功能:
https://docs.spring.io/spring...
配置举例:
三种方式
application.properties 或 application.yml 或命令行选项
配置项
# REMOTE DEVTOOLS (RemoteDevToolsProperties) spring.devtools.remote.context-path=/.~~spring-boot!~ # Context path used to handle the remote connection. spring.devtools.remote.proxy.host= # The host of the proxy to use to connect to the remote application. spring.devtools.remote.proxy.port= # The port of the proxy to use to connect to the remote application. spring.devtools.remote.restart.enabled=true # Whether to enable remote restart. spring.devtools.remote.secret= # A shared secret required to establish a connection (required to enable remote support). spring.devtools.remote.secret-header-name=X-AUTH-TOKEN # HTTP header used to transfer the shared secret.
对应的Java类
RemoteDevToolsProperties.java 官方的 Java 包会在通过 META-INF
目录下的
spring-autoconfigure-metadata.properties spring-configuration-metadata.json
例如:
~/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.0.3.RELEASE/spring-boot-autoconfigure-2.0.3.RELEASE.jar!/META-INF/spring-configuration-metadata.json
{ "hints": [ ..., { "name": "spring.datasource.data", "providers": [ { "name": "handle-as", "parameters": { "target": "java.util.List<org.springframework.core.io.Resource>" } } ] }, { "name": "spring.datasource.driver-class-name", "providers": [ { "name": "class-reference", "parameters": { "target": "java.sql.Driver" } } ] }, ... }
JSON 结构比较简单, 容易看懂.
在这个文件里定义了相应的配置项,数值类型,以及可能的备选项进行描述, 从而使得 IDE 可以透过代码提示, 方便用户键入.
未完待续(鉴于很多转载/抓取的从不注明出处,我先发个半截的)
未完待续
未完待续
未完待续
未完待续
未完待续