Skip to content

Commit

Permalink
update maven compile in jdk profile
Browse files Browse the repository at this point in the history
  • Loading branch information
“HzjNeverStop” committed Nov 24, 2023
1 parent 26f9251 commit 3fbc638
Showing 1 changed file with 39 additions and 19 deletions.
58 changes: 39 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<logback.version>1.4.9</logback.version>
<slf4j.version>2.0.7</slf4j.version>
<log4j2.version>2.19.0</log4j2.version>
Expand Down Expand Up @@ -163,33 +162,18 @@
<url>http://github.com/alipay/sofa-common-tools/tree/master</url>
</scm>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<source>17</source>
<target>17</target>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>compile-java-21</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>21</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java21</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -290,6 +274,42 @@
</build>

<profiles>
<profile>
<activation>
<jdk>21</jdk>
</activation>
<id>jdk21</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>21</source>
<target>21</target>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>compile-java-21</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>21</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java21</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
Expand Down

0 comments on commit 3fbc638

Please sign in to comment.