idea maven jdk7编译,target没有class

404 阅读1分钟

问题

idea maven编译,target没有class。而且是jdk7没有,但是jdk8有。eclipse jdk7也有。

原因

因为依赖了springboot,而springboot pom文件里是jdk8。

解决方法

排除所有和springboot相关的依赖。

<!--  <parent>--> //排除父依赖
<!--    <groupId>com.xxx.maven</groupId>-->
<!--    <artifactId>springboot-parent</artifactId>-->
<!--    <version>1.0.1</version>-->
<!--  </parent>-->

<!-- 外部elastic-job依赖 -->
  <dependency>
      <groupId>com.cxytiandi</groupId>
      <artifactId>elastic-job-spring-boot-starter</artifactId>
      <version>1.0.4</version>
      <exclusions>
        <exclusion>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
        </exclusion>
        <exclusion> //排除依赖的依赖
          <artifactId>spring-boot-autoconfigure</artifactId>
          <groupId>org.springframework.boot</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spring-boot-configuration-processor</artifactId>
          <groupId>org.springframework.boot</groupId>
        </exclusion>
      </exclusions>
  </dependency>