Open xkl700 opened 3 years ago
环境 JDK1.8.0251+MAVEN3.6.1+IDEA
修改子项目下的pom.xml
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>8</source> <target>8</target> </configuration> </plugin> </plugins> </build>
我发现他打包的时候将itstack-demo-design-10-00项目的包打到了org.springframework.boot下 修改itstack-demo-design-10-00子项目下的pom.xml
org.springframework.boot
<!--修改前--> <packaging>war</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.2.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
<!--修改后--> <parent> <artifactId>itstack-demo-design</artifactId> <groupId>org.itstack</groupId> <version>1.0-SNAPSHOT</version> </parent> <packaging>jar</packaging>
另<dependencies></dependencies>中<groupId></groupId>的值为org.springframework.boot的都加上<version>2.1.2.RELEASE</version>
dependencies></dependencies>
<groupId></groupId>
<version>2.1.2.RELEASE</version>
Maven Compiler 插件默认会加 -source 1.5 及 -target 1.5 参数来编译(估计是为了兼容一些比较老的 Linux 服务器操作系统,它们通常只有 JDK 5),而我们的代码里使用了 JDK 7/8 的语法。
<build> ... <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.2</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> ... </build>
老哥 提个pr呀 我又躺了一遍
环境 JDK1.8.0251+MAVEN3.6.1+IDEA
[1]itstack-demo-design-8-02 报错信息为 错误: -source 1.6 中不支持 diamond 运算符
修改子项目下的pom.xml
[2]itstack-demo-design-10-01 报错信息为 Cannot resolve org.itstack.demo.design.domain.UserInfo
我发现他打包的时候将itstack-demo-design-10-00项目的包打到了
org.springframework.boot
下 修改itstack-demo-design-10-00子项目下的pom.xml另<
dependencies></dependencies>
中<groupId></groupId>
的值为org.springframework.boot
的都加上<version>2.1.2.RELEASE</version>
[3]报错信息为 错误: -source 1.5 中不支持 diamond 运算符
Maven Compiler 插件默认会加 -source 1.5 及 -target 1.5 参数来编译(估计是为了兼容一些比较老的 Linux 服务器操作系统,它们通常只有 JDK 5),而我们的代码里使用了 JDK 7/8 的语法。