Wednesday, March 28, 2018

mybatis-spring-boot-starter @PostConstruct can not work

What
by java9 below code not effect in some projects.

<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>

How
breakpoint at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration
  @PostConstruct
  public void checkConfigFileExists()
but not trigger.

Why
my java9 default is need add below maven dependcy:
<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>

Last
Thanks!

No comments: