8月 242019
 

本文仅展示总体配置,具体注解用法请另行搜索、查询。

1.加上maven依赖,引入相关包

</pre>
<pre><dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.9.2</version>
</dependency>
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-annotations -->
<dependency>
    <groupId>io.swagger.core.v3</groupId>
    <artifactId>swagger-annotations</artifactId>
    <version>2.0.8</version>
</dependency>
<!-- http://localhost:18004/doc.html -->
<dependency>
    <groupId>com.github.xiaoymin</groupId>
    <artifactId>swagger-bootstrap-ui</artifactId>
    <version>1.8.8</version>
</dependency>
<!-- Swagger用了高版本的 -->
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>28.0-jre</version>
</dependency></pre>
<pre>

Continue reading »

1月 102018
 

整理笔记本时发现一些以前做过的笔记,整理一下,在博客里留个记录,省的以后忘记。
问题是这样的:dubbo在部署时需要用到dubbo-admin,但dubbo-admin需要自己编译,网上各种下载的war包可能并不适合自己的开发环境、有极大概率是没法用的。
编译dubbo-admin很简单,在编译环境中准备好jdk、maven(jdk maven配置过程就没必要说了,网上n多教程),从github上下载dubbo源代码,准备工作就这些。
我的编译环境如下:

  • MacOSX High Sierra
  • Oracle JDK 1.8
  • apache maven 3.5.2

编译步骤: Continue reading »

3月 102017
 

这几天给开发机重装系统后遇到的一个问题,maven什么的都是最新的版本(maven 3.5.2, jdk 1.8),然而用idea打开项目后,总是注解报错,然后追根溯源发现是目前版本的maven在构建时默认面向jdk 1.5……参见这里:
http://maven.apache.org/plugins/maven-compiler-plugin/index.html

Also note that at present the default source setting is 1.5 and the default target setting is 1.5, independently of the JDK you run Maven with. If you want to change these defaults, you should set source and target as described in Setting the -source and -target of the Java Compiler.

Continue reading »

12月 222015
 

大家都说,阅读spring的源代码是个不错的学习方式,现在开始学习一下,头一次阅读开源代码,不知道怎么看,先随便记些笔记,记录一下,希望也能帮助别人吧。
目前我看代码的方式是阅读《spring源码深度解析》,按照上面的例子一步步阅读源代码,感觉这样难度降低不少,有书、有实际例子带着终归要容易一些。我所阅读的是spring framework 4.2的代码,从github上拉取的,拉取时间2015年11月份。
闲话少说,开始! Continue reading »

12月 172015
 

为了阅读spring源代码,用gradle重新build了spring framework 4,但发现有个项目死活过不去,spring-beans-groovy用gradle cleanidea eclipse命令build后总是出问题,直接导入eclipse中也会报错,查了一下,在 http://bbs.csdn.net/topics/390993197 发现问题原因:eclipse尚未安装Groovy插件,so,插件装起,eclipse Help –> install new software,添加Groovy插件地址,https://github.com/groovy/groovy-eclipse/wiki 此处有各种eclipse版本对应的groovy插件下载地址(注意eclipse的版本),安装插件后重新clean一下spring-beans-groovy这个项目就可以了。
以上

8月 142011
 

最近做项目把JDK的版本升到了1.6,但是问题也就随之而来。
首先,在eclipse中启动Tomcat服务器,始终不能启动
clip_image002
java.lang.NoClassDefFoundError: jdk1/6/0/10
开始以为是版本不兼容,但是直接发布在Tomcat目录下,直接点击Tomcat的StartUp.bat是可以启动的,运行正常。
于是写了一个测试类,在eclipse中运行这个类,只是输出几个字符,居然也不可以,报错信息一样。 Continue reading »