|
17 | 17 | <groupId>co.oslc.refimpl</groupId> |
18 | 18 | <artifactId>server-cm</artifactId> |
19 | 19 | <version>0.3.0-SNAPSHOT</version> |
20 | | - <packaging>war</packaging> |
| 20 | + <packaging>jar</packaging> |
21 | 21 | <name>CM</name> |
22 | 22 | <properties> |
23 | 23 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|
28 | 28 | <servlet.port>8801</servlet.port> |
29 | 29 | <application.contextpath>/</application.contextpath> |
30 | 30 | <application.filename>server-cm</application.filename> |
| 31 | + <jetty.version>12.0.16</jetty.version> |
31 | 32 |
|
32 | 33 | <!-- Start of user code properties |
33 | 34 | --> |
|
116 | 117 | </profile> |
117 | 118 | <!-- End of user code |
118 | 119 | --> |
119 | | - <profile> |
120 | | - <!-- some servlet containers (Tomcat) does not ship with a JSTL impl |
121 | | - In such cases, run with this profile--> |
122 | | - <id>with-jstl-impl</id> |
123 | | - <dependencies> |
124 | | - <!-- Start of user code profile_dependencies |
125 | | - --> |
126 | | - <!-- TODO: Add additional dependencies to this profile here to avoid them be overridden upon future re-generation --> |
127 | | - <!-- End of user code |
128 | | - --> |
129 | | - <dependency> |
130 | | - <groupId>jakarta.servlet.jsp.jstl</groupId> |
131 | | - <artifactId>jakarta.servlet.jsp.jstl-api</artifactId> |
132 | | - </dependency> |
133 | | - <dependency> |
134 | | - <groupId>org.glassfish.web</groupId> |
135 | | - <artifactId>jakarta.servlet.jsp.jstl</artifactId> |
136 | | - </dependency> |
137 | | - </dependencies> |
138 | | - </profile> |
139 | | - |
140 | 120 | </profiles> |
141 | 121 | <!-- Start of user code pre_dependencies |
142 | 122 | --> |
|
151 | 131 | <scope>import</scope> |
152 | 132 | <type>pom</type> |
153 | 133 | </dependency> |
| 134 | + <dependency> |
| 135 | + <groupId>org.eclipse.jetty</groupId> |
| 136 | + <artifactId>jetty-bom</artifactId> |
| 137 | + <version>${jetty.version}</version> |
| 138 | + <type>pom</type> |
| 139 | + <scope>import</scope> |
| 140 | + </dependency> |
154 | 141 | </dependencies> |
155 | 142 | </dependencyManagement> |
156 | 143 | <dependencies> |
|
163 | 150 | </dependency> |
164 | 151 | <!-- End of user code |
165 | 152 | --> |
| 153 | + <!-- Embedded Jetty 12 (EE10) --> |
| 154 | + <dependency> |
| 155 | + <groupId>org.eclipse.jetty.ee10</groupId> |
| 156 | + <artifactId>jetty-ee10-servlet</artifactId> |
| 157 | + </dependency> |
| 158 | + |
166 | 159 | <!-- General dependencies --> |
167 | 160 | <dependency> |
168 | 161 | <groupId>org.slf4j</groupId> |
169 | 162 | <artifactId>slf4j-simple</artifactId> |
170 | | - <scope>runtime</scope> |
171 | 163 | </dependency> |
172 | 164 | <!-- Servlet dependencies --> |
173 | 165 | <dependency> |
174 | 166 | <groupId>jakarta.servlet</groupId> |
175 | 167 | <artifactId>jakarta.servlet-api</artifactId> |
176 | | - <scope>provided</scope> |
177 | | - </dependency> |
178 | | - <dependency> |
179 | | - <groupId>jakarta.servlet.jsp.jstl</groupId> |
180 | | - <artifactId>jakarta.servlet.jsp.jstl-api</artifactId> |
181 | | - <!--When running with the jetty-maven-plugin, you |
182 | | - get warnings about jsp classes being scanned from multiple locations. |
183 | | - adding the "provided" scope avoids these warnings.--> |
184 | | - <scope>provided</scope> |
185 | 168 | </dependency> |
186 | 169 | <dependency> |
187 | 170 | <groupId>org.glassfish.jersey.core</groupId> |
|
245 | 228 | <groupId>org.eclipse.lyo.server</groupId> |
246 | 229 | <artifactId>oauth-consumer-store</artifactId> |
247 | 230 | </dependency> |
248 | | - <dependency> |
249 | | - <groupId>org.eclipse.lyo.server</groupId> |
250 | | - <artifactId>oauth-webapp</artifactId> |
251 | | - <type>war</type> |
252 | | - </dependency> |
| 231 | + <!-- Removed oauth-webapp war dependency as we are not using war overlay anymore |
| 232 | + and avoiding JSP. If needed, we would need to manually handle it. --> |
| 233 | + |
253 | 234 | <dependency> |
254 | 235 | <groupId>org.eclipse.lyo</groupId> |
255 | 236 | <artifactId>oslc-domains</artifactId> |
|
308 | 289 | </compilerArgument> |
309 | 290 | </configuration> |
310 | 291 | </plugin> |
311 | | - <plugin> |
312 | | - <groupId>org.eclipse.jetty</groupId> |
313 | | - <artifactId>jetty-maven-plugin</artifactId> |
314 | | - <version>11.0.20</version> |
315 | | - <configuration> |
316 | | - <webApp> |
317 | | - <contextPath>${application.contextpath}</contextPath> |
318 | | - <_initParams> |
319 | | - <org.eclipse.jetty.servlet.Default.useFileMappedBuffer>false</org.eclipse.jetty.servlet.Default.useFileMappedBuffer> |
320 | | - </_initParams> |
321 | | - </webApp> |
322 | | - <httpConnector> |
323 | | - <port>${servlet.port}</port> |
324 | | - </httpConnector> |
325 | | - <scan>5</scan> |
326 | | - </configuration> |
327 | | - </plugin> |
328 | | - <plugin> |
329 | | - <groupId>org.codehaus.cargo</groupId> |
330 | | - <artifactId>cargo-maven3-plugin</artifactId> |
331 | | - <version>1.10.25</version> |
332 | | - <configuration> |
333 | | - <!--This plugins supports the following containers--> |
334 | | - <container> |
335 | | - <!--These containers are know to work--> |
336 | | - <containerId>tomcat10x</containerId> |
337 | | - <containerId>jetty12x</containerId> |
338 | | - <!-- <containerId>payara</containerId> --> |
339 | | - <!-- <containerId>wildfly26x</containerId> --> |
340 | | - <!--These containers are know to fail--> |
341 | | - <!-- Context Root Not Found --> |
342 | | - <!-- <containerId>liberty</containerId> --> |
343 | | - </container> |
344 | | - <configuration> |
345 | | - <properties> |
346 | | - <cargo.servlet.port>${servlet.port}</cargo.servlet.port> |
347 | | - </properties> |
348 | | - </configuration> |
349 | | - <deployables> |
350 | | - <deployable> |
351 | | - <type>war</type> |
352 | | - <location>${project.build.directory}/${project.build.finalName}.war</location> |
353 | | - <properties> |
354 | | - <context>${application.contextpath}</context> |
355 | | - </properties> |
356 | | - </deployable> |
357 | | - </deployables> |
358 | | - </configuration> |
359 | | - </plugin> |
360 | | - <!-- Swagger-ui --> |
| 292 | + |
361 | 293 | <plugin> |
362 | 294 | <!-- Download Swagger UI webjar. --> |
363 | 295 | <groupId>org.apache.maven.plugins</groupId> |
364 | 296 | <artifactId>maven-dependency-plugin</artifactId> |
365 | 297 | <version>3.9.0</version> |
366 | 298 | <executions> |
367 | 299 | <execution> |
| 300 | + <id>unpack-swagger-ui</id> |
368 | 301 | <phase>prepare-package</phase> |
369 | 302 | <goals> |
370 | 303 | <goal>unpack</goal> |
|
377 | 310 | <version>${swagger-ui.version}</version> |
378 | 311 | </artifactItem> |
379 | 312 | </artifactItems> |
380 | | - <outputDirectory>${project.build.directory}/swagger-ui</outputDirectory> |
| 313 | + <!-- Unpack to classes so it is included in the jar --> |
| 314 | + <outputDirectory>${project.build.outputDirectory}/static/swagger-ui</outputDirectory> |
| 315 | + <includes>**/*.*</includes> |
| 316 | + </configuration> |
| 317 | + </execution> |
| 318 | + <execution> |
| 319 | + <id>copy-dependencies</id> |
| 320 | + <phase>package</phase> |
| 321 | + <goals> |
| 322 | + <goal>copy-dependencies</goal> |
| 323 | + </goals> |
| 324 | + <configuration> |
| 325 | + <outputDirectory>${project.build.directory}/lib</outputDirectory> |
| 326 | + <includeScope>runtime</includeScope> |
| 327 | + <useBaseVersion>true</useBaseVersion> |
381 | 328 | </configuration> |
382 | 329 | </execution> |
383 | 330 | </executions> |
384 | 331 | </plugin> |
| 332 | + |
385 | 333 | <plugin> |
386 | | - <!-- Add Swagger UI resources to the war file. --> |
387 | 334 | <groupId>org.apache.maven.plugins</groupId> |
388 | | - <artifactId>maven-war-plugin</artifactId> |
389 | | - <version>3.5.1</version> |
| 335 | + <artifactId>maven-jar-plugin</artifactId> |
| 336 | + <version>3.4.2</version> |
390 | 337 | <configuration> |
391 | | - <webResources combine.children="append"> |
392 | | - <resource> |
393 | | - <directory>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}</directory> |
394 | | - <includes> |
395 | | - <include>**/*.*</include> |
396 | | - </includes> |
397 | | - <targetPath>/swagger-ui/dist</targetPath> |
398 | | - </resource> |
399 | | - </webResources> |
| 338 | + <archive> |
| 339 | + <manifest> |
| 340 | + <addClasspath>true</addClasspath> |
| 341 | + <classpathPrefix>lib/</classpathPrefix> |
| 342 | + <mainClass>co.oslc.refimpl.cm.Main</mainClass> |
| 343 | + <useUniqueVersions>false</useUniqueVersions> |
| 344 | + </manifest> |
| 345 | + </archive> |
400 | 346 | </configuration> |
401 | 347 | </plugin> |
402 | 348 |
|
| 349 | + <!-- We also need to move the unpacked swagger-ui files to the right place. |
| 350 | + The unpack above puts them in static/swagger-ui/META-INF/resources/webjars/swagger-ui/${version}/ |
| 351 | + We want them in static/swagger-ui/dist/ |
| 352 | + --> |
| 353 | + <plugin> |
| 354 | + <artifactId>maven-resources-plugin</artifactId> |
| 355 | + <version>3.3.1</version> |
| 356 | + <executions> |
| 357 | + <execution> |
| 358 | + <id>copy-swagger-ui-dist</id> |
| 359 | + <phase>prepare-package</phase> |
| 360 | + <goals> |
| 361 | + <goal>copy-resources</goal> |
| 362 | + </goals> |
| 363 | + <configuration> |
| 364 | + <outputDirectory>${project.build.outputDirectory}/static/swagger-ui/dist</outputDirectory> |
| 365 | + <resources> |
| 366 | + <resource> |
| 367 | + <directory>${project.build.outputDirectory}/static/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}</directory> |
| 368 | + </resource> |
| 369 | + </resources> |
| 370 | + </configuration> |
| 371 | + </execution> |
| 372 | + </executions> |
| 373 | + </plugin> |
| 374 | + |
403 | 375 | <!-- Start of user code plugins |
404 | 376 | --> |
405 | 377 | <!-- End of user code |
|
0 commit comments