|
74 | 74 | </runnerParentFirstArtifacts> |
75 | 75 | </configuration> |
76 | 76 | </plugin> |
77 | | - <plugin> |
78 | | - <artifactId>maven-compiler-plugin</artifactId> |
79 | | - <configuration> |
80 | | - <!-- |
81 | | - In order for vector support to work on JDK 21+, we need to build the module with JDK 23, |
82 | | - because in that version Vector is no longer preview, so we build target and runtime versions |
83 | | - don't need to match (remember that preview features only work on the same runtime version as the target |
84 | | - --> |
85 | | - <source>21</source> |
86 | | - <target>21</target> |
87 | | - <release combine.self="override" /> <!-- make sure -release is not passed to javac--> |
88 | | - <compilerArgs> |
89 | | - <arg>--add-modules=jdk.incubator.vector</arg> |
90 | | - </compilerArgs> |
91 | | - <annotationProcessorPaths> |
92 | | - <path> |
93 | | - <groupId>io.quarkus</groupId> |
94 | | - <artifactId>quarkus-extension-processor</artifactId> |
95 | | - <version>${quarkus.version}</version> |
96 | | - </path> |
97 | | - </annotationProcessorPaths> |
98 | | - </configuration> |
99 | | - </plugin> |
100 | 77 | </plugins> |
101 | 78 | </build> |
102 | 79 |
|
| 80 | + <profiles> |
| 81 | + <!-- Java 21: Enable preview features to match gpu-llama3 compilation --> |
| 82 | + <profile> |
| 83 | + <id>jdk21-with-preview</id> |
| 84 | + <activation> |
| 85 | + <jdk>21</jdk> |
| 86 | + </activation> |
| 87 | + <build> |
| 88 | + <plugins> |
| 89 | + <plugin> |
| 90 | + <artifactId>maven-compiler-plugin</artifactId> |
| 91 | + <configuration> |
| 92 | + <!-- |
| 93 | + Target Java 21 with preview features to match gpu-llama3 dependency |
| 94 | + --> |
| 95 | + <source>21</source> |
| 96 | + <target>21</target> |
| 97 | + <release combine.self="override" /> <!-- make sure -release is not passed to javac--> |
| 98 | + <compilerArgs> |
| 99 | + <arg>--enable-preview</arg> |
| 100 | + <arg>--add-modules=jdk.incubator.vector</arg> |
| 101 | + </compilerArgs> |
| 102 | + <annotationProcessorPaths> |
| 103 | + <path> |
| 104 | + <groupId>io.quarkus</groupId> |
| 105 | + <artifactId>quarkus-extension-processor</artifactId> |
| 106 | + <version>${quarkus.version}</version> |
| 107 | + </path> |
| 108 | + </annotationProcessorPaths> |
| 109 | + </configuration> |
| 110 | + </plugin> |
| 111 | + </plugins> |
| 112 | + </build> |
| 113 | + </profile> |
| 114 | + |
| 115 | + <!-- Java 22-23: Compile to Java 21 target for compatibility --> |
| 116 | + <profile> |
| 117 | + <id>jdk22-23-with-preview</id> |
| 118 | + <activation> |
| 119 | + <jdk>[22,23]</jdk> |
| 120 | + </activation> |
| 121 | + <build> |
| 122 | + <plugins> |
| 123 | + <plugin> |
| 124 | + <artifactId>maven-compiler-plugin</artifactId> |
| 125 | + <configuration> |
| 126 | + <!-- |
| 127 | + Compile with JDK 22-23 but target Java 21 for compatibility |
| 128 | + --> |
| 129 | + <source>21</source> |
| 130 | + <target>21</target> |
| 131 | + <release combine.self="override" /> <!-- make sure -release is not passed to javac--> |
| 132 | + <compilerArgs> |
| 133 | + <arg>--enable-preview</arg> |
| 134 | + <arg>--add-modules=jdk.incubator.vector</arg> |
| 135 | + </compilerArgs> |
| 136 | + <annotationProcessorPaths> |
| 137 | + <path> |
| 138 | + <groupId>io.quarkus</groupId> |
| 139 | + <artifactId>quarkus-extension-processor</artifactId> |
| 140 | + <version>${quarkus.version}</version> |
| 141 | + </path> |
| 142 | + </annotationProcessorPaths> |
| 143 | + </configuration> |
| 144 | + </plugin> |
| 145 | + </plugins> |
| 146 | + </build> |
| 147 | + </profile> |
| 148 | + |
| 149 | + <!-- Java 24+: Use current JDK's preview features --> |
| 150 | + <profile> |
| 151 | + <id>jdk24-plus</id> |
| 152 | + <activation> |
| 153 | + <jdk>[24,)</jdk> |
| 154 | + </activation> |
| 155 | + <build> |
| 156 | + <plugins> |
| 157 | + <plugin> |
| 158 | + <artifactId>maven-compiler-plugin</artifactId> |
| 159 | + <configuration> |
| 160 | + <!-- |
| 161 | + Use JDK 24+ where preview features are supported for current version |
| 162 | + --> |
| 163 | + <source>24</source> |
| 164 | + <target>24</target> |
| 165 | + <release combine.self="override" /> <!-- make sure -release is not passed to javac--> |
| 166 | + <compilerArgs> |
| 167 | + <arg>--enable-preview</arg> |
| 168 | + <arg>--add-modules=jdk.incubator.vector</arg> |
| 169 | + </compilerArgs> |
| 170 | + <annotationProcessorPaths> |
| 171 | + <path> |
| 172 | + <groupId>io.quarkus</groupId> |
| 173 | + <artifactId>quarkus-extension-processor</artifactId> |
| 174 | + <version>${quarkus.version}</version> |
| 175 | + </path> |
| 176 | + </annotationProcessorPaths> |
| 177 | + </configuration> |
| 178 | + </plugin> |
| 179 | + </plugins> |
| 180 | + </build> |
| 181 | + </profile> |
| 182 | + </profiles> |
| 183 | + |
103 | 184 | </project> |
0 commit comments