|
34 | 34 |
|
35 | 35 | <properties>
|
36 | 36 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
| 37 | + <java8.build.outputDirectory>${project.basedir}/target</java8.build.outputDirectory> |
| 38 | + <java8.sourceDirectory>${project.basedir}/src/main/java8</java8.sourceDirectory> |
| 39 | + <java11.build.outputDirectory>${project.basedir}/target11</java11.build.outputDirectory> |
| 40 | + <java11.sourceDirectory>${project.basedir}/src/main/java11</java11.sourceDirectory> |
37 | 41 | </properties>
|
38 | 42 |
|
39 | 43 | <dependencies>
|
|
119 | 123 | <skip.tests>true</skip.tests>
|
120 | 124 | </properties>
|
121 | 125 | </profile>
|
| 126 | + <profile> |
| 127 | + <id>JettyExclude</id> |
| 128 | + <activation> |
| 129 | + <jdk>1.8</jdk> |
| 130 | + </activation> |
| 131 | + <build> |
| 132 | + <directory>${java8.build.outputDirectory}</directory> |
| 133 | + <plugins> |
| 134 | + <plugin> |
| 135 | + <groupId>org.codehaus.mojo</groupId> |
| 136 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 137 | + <executions> |
| 138 | + <execution> |
| 139 | + <phase>generate-sources</phase> |
| 140 | + <goals> |
| 141 | + <goal>add-source</goal> |
| 142 | + </goals> |
| 143 | + <configuration> |
| 144 | + <sources> |
| 145 | + <source>${java8.sourceDirectory}</source> |
| 146 | + </sources> |
| 147 | + </configuration> |
| 148 | + </execution> |
| 149 | + </executions> |
| 150 | + </plugin> |
| 151 | + <plugin> |
| 152 | + <groupId>org.apache.maven.plugins</groupId> |
| 153 | + <artifactId>maven-compiler-plugin</artifactId> |
| 154 | + <configuration> |
| 155 | + <testExcludes> |
| 156 | + <testExclude>org/glassfish/jersey/jetty/connector/*.java</testExclude> |
| 157 | + </testExcludes> |
| 158 | + </configuration> |
| 159 | + </plugin> |
| 160 | + </plugins> |
| 161 | + </build> |
| 162 | + </profile> |
| 163 | + <profile> |
| 164 | + <id>Jetty11</id> |
| 165 | + <activation> |
| 166 | + <jdk>[11,)</jdk> |
| 167 | + </activation> |
| 168 | + <build> |
| 169 | + <directory>${java11.build.outputDirectory}</directory> |
| 170 | + <plugins> |
| 171 | + <plugin> |
| 172 | + <groupId>org.codehaus.mojo</groupId> |
| 173 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 174 | + <executions> |
| 175 | + <execution> |
| 176 | + <phase>generate-sources</phase> |
| 177 | + <goals> |
| 178 | + <goal>add-source</goal> |
| 179 | + </goals> |
| 180 | + <configuration> |
| 181 | + <sources> |
| 182 | + <source>${java11.sourceDirectory}</source> |
| 183 | + </sources> |
| 184 | + </configuration> |
| 185 | + </execution> |
| 186 | + </executions> |
| 187 | + </plugin> |
| 188 | + </plugins> |
| 189 | + </build> |
| 190 | + </profile> |
| 191 | + <profile> |
| 192 | + <id>copyJDK11FilesToMultiReleaseJar</id> |
| 193 | + <activation> |
| 194 | + <file> |
| 195 | + <!-- ${java11.build.outputDirectory} does not work here --> |
| 196 | + <exists>target11/classes/org/glassfish/jersey/jetty/connector/JettyConnectorProvider.class</exists> |
| 197 | + </file> |
| 198 | + <jdk>1.8</jdk> |
| 199 | + </activation> |
| 200 | + <build> |
| 201 | + <plugins> |
| 202 | + <plugin> |
| 203 | + <groupId>org.apache.felix</groupId> |
| 204 | + <artifactId>maven-bundle-plugin</artifactId> |
| 205 | + <inherited>true</inherited> |
| 206 | + <extensions>true</extensions> |
| 207 | + <configuration> |
| 208 | + <instructions> |
| 209 | + <Multi-Release>true</Multi-Release> |
| 210 | + </instructions> |
| 211 | + </configuration> |
| 212 | + </plugin> |
| 213 | + <plugin> |
| 214 | + <groupId>org.apache.maven.plugins</groupId> |
| 215 | + <artifactId>maven-resources-plugin</artifactId> |
| 216 | + <inherited>true</inherited> |
| 217 | + <executions> |
| 218 | + <execution> |
| 219 | + <id>copy-jdk11-classes</id> |
| 220 | + <phase>prepare-package</phase> |
| 221 | + <goals> |
| 222 | + <goal>copy-resources</goal> |
| 223 | + </goals> |
| 224 | + <configuration> |
| 225 | + <outputDirectory>${java8.build.outputDirectory}/classes/META-INF/versions/11</outputDirectory> |
| 226 | + <resources> |
| 227 | + <resource> |
| 228 | + <directory>${java11.build.outputDirectory}/classes</directory> |
| 229 | + </resource> |
| 230 | + </resources> |
| 231 | + </configuration> |
| 232 | + </execution> |
| 233 | + </executions> |
| 234 | + </plugin> |
| 235 | + <plugin> |
| 236 | + <groupId>org.apache.maven.plugins</groupId> |
| 237 | + <artifactId>maven-antrun-plugin</artifactId> |
| 238 | + <executions> |
| 239 | + <execution> |
| 240 | + <id>copy-jdk11-sources</id> |
| 241 | + <phase>package</phase> |
| 242 | + <configuration> |
| 243 | + <target> |
| 244 | + <property name="sources-jar" value="${java8.build.outputDirectory}/${project.artifactId}-${project.version}-sources.jar"/> |
| 245 | + <echo>sources-jar: ${sources-jar}</echo> |
| 246 | + <zip destfile="${sources-jar}" update="true"> |
| 247 | + <zipfileset dir="${java11.sourceDirectory}" prefix="META-INF/versions/11"/> |
| 248 | + </zip> |
| 249 | + </target> |
| 250 | + </configuration> |
| 251 | + <goals> |
| 252 | + <goal>run</goal> |
| 253 | + </goals> |
| 254 | + </execution> |
| 255 | + </executions> |
| 256 | + </plugin> |
| 257 | + </plugins> |
| 258 | + </build> |
| 259 | + </profile> |
122 | 260 | </profiles>
|
123 | 261 |
|
124 | 262 | </project>
|
0 commit comments