Skip to content

Commit e058aed

Browse files
committed
build: clean up some compiler warning, remove deprecated code usage
1 parent cca61d1 commit e058aed

15 files changed

Lines changed: 111 additions & 92 deletions

File tree

modules/jooby-apt/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,34 @@
191191
<phase>package</phase>
192192
<configuration>
193193
<minimizeJar>true</minimizeJar>
194+
<filters>
195+
<filter>
196+
<artifact>*:*</artifact>
197+
<excludes>
198+
<exclude>META-INF/LICENSE</exclude>
199+
<exclude>META-INF/LICENSE.txt</exclude>
200+
<exclude>META-INF/NOTICE</exclude>
201+
<exclude>META-INF/NOTICE.txt</exclude>
202+
<exclude>META-INF/DEPENDENCIES</exclude>
203+
204+
<exclude>META-INF/MANIFEST.MF</exclude>
205+
206+
<exclude>module-info.class</exclude>
207+
<exclude>META-INF/versions/*/module-info.class</exclude>
208+
209+
<exclude>META-INF/*.SF</exclude>
210+
<exclude>META-INF/*.DSA</exclude>
211+
<exclude>META-INF/*.RSA</exclude>
212+
</excludes>
213+
</filter>
214+
</filters>
194215
<transformers>
195216
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
196217
<manifestEntries>
197218
<Automatic-Module-Name>io.jooby.apt</Automatic-Module-Name>
198219
</manifestEntries>
199220
</transformer>
221+
<transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer"/>
200222
</transformers>
201223
</configuration>
202224
</execution>

modules/jooby-camel/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,20 @@
5353
<scope>test</scope>
5454
</dependency>
5555
</dependencies>
56+
57+
<build>
58+
<plugins>
59+
<plugin>
60+
<groupId>org.apache.maven.plugins</groupId>
61+
<artifactId>maven-jar-plugin</artifactId>
62+
<configuration>
63+
<archive>
64+
<manifestEntries>
65+
<Automatic-Module-Name>io.jooby.camel</Automatic-Module-Name>
66+
</manifestEntries>
67+
</archive>
68+
</configuration>
69+
</plugin>
70+
</plugins>
71+
</build>
5672
</project>

modules/jooby-camel/src/main/java/module-info.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

modules/jooby-flyway/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,20 @@
3838
<scope>test</scope>
3939
</dependency>
4040
</dependencies>
41+
42+
<build>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-jar-plugin</artifactId>
47+
<configuration>
48+
<archive>
49+
<manifestEntries>
50+
<Automatic-Module-Name>io.jooby.flyway</Automatic-Module-Name>
51+
</manifestEntries>
52+
</archive>
53+
</configuration>
54+
</plugin>
55+
</plugins>
56+
</build>
4157
</project>

modules/jooby-flyway/src/main/java/module-info.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

modules/jooby-javadoc/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
<name>jooby-javadoc</name>
1515

1616
<dependencies>
17-
<!-- Source: https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
1817
<dependency>
1918
<groupId>org.apache.commons</groupId>
2019
<artifactId>commons-lang3</artifactId>
2120
<version>3.20.0</version>
2221
</dependency>
2322

24-
<!-- Source: https://mvnrepository.com/artifact/org.apache.commons/commons-text -->
2523
<dependency>
2624
<groupId>org.apache.commons</groupId>
2725
<artifactId>commons-text</artifactId>
@@ -32,6 +30,12 @@
3230
<groupId>com.puppycrawl.tools</groupId>
3331
<artifactId>checkstyle</artifactId>
3432
<version>13.4.0</version>
33+
<exclusions>
34+
<exclusion>
35+
<groupId>org.codehaus.plexus</groupId>
36+
<artifactId>plexus-container-default</artifactId>
37+
</exclusion>
38+
</exclusions>
3539
</dependency>
3640

3741
<!-- Test dependencies -->

modules/jooby-jetty/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
<version>${jetty.version}</version>
4545
</dependency>
4646

47+
<dependency>
48+
<groupId>org.eclipse.jetty.compression</groupId>
49+
<artifactId>jetty-compression-server</artifactId>
50+
<version>${jetty.version}</version>
51+
</dependency>
52+
53+
<dependency>
54+
<groupId>org.eclipse.jetty.compression</groupId>
55+
<artifactId>jetty-compression-gzip</artifactId>
56+
<version>${jetty.version}</version>
57+
</dependency>
58+
4759
<!-- Test dependencies -->
4860
<dependency>
4961
<groupId>org.junit.jupiter</groupId>

modules/jooby-jetty/src/main/java/io/jooby/jetty/JettyServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
import java.util.concurrent.TimeUnit;
1515
import java.util.function.Consumer;
1616

17+
import org.eclipse.jetty.compression.server.CompressionHandler;
1718
import org.eclipse.jetty.http.UriCompliance;
1819
import org.eclipse.jetty.server.*;
1920
import org.eclipse.jetty.server.Server;
2021
import org.eclipse.jetty.server.handler.ContextHandler;
21-
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
2222
import org.eclipse.jetty.util.DecoratedObjectFactory;
2323
import org.eclipse.jetty.util.compression.CompressionPool;
2424
import org.eclipse.jetty.util.compression.DeflaterPool;
@@ -248,7 +248,7 @@ public io.jooby.Server start(@NonNull Jooby... application) {
248248

249249
/* ********************************* Gzip *************************************/
250250
if (gzip) {
251-
var gzipHandler = new GzipHandler();
251+
var gzipHandler = new CompressionHandler();
252252
context.insertHandler(gzipHandler);
253253
}
254254
/* ********************************* WebSocket *************************************/

modules/jooby-jetty/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
requires org.eclipse.jetty.websocket.server;
2020
requires java.desktop;
2121
requires org.eclipse.jetty.http;
22+
requires org.eclipse.jetty.compression.server;
2223

2324
provides Server with
2425
JettyServer;

modules/jooby-kotlin/src/main/kotlin/io/jooby/kt/CoroutineRouter.kt

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ import kotlinx.coroutines.*
1616
internal class RouterCoroutineScope(override val coroutineContext: CoroutineContext) :
1717
CoroutineScope
1818

19+
@DslMarker
20+
@Target(
21+
AnnotationTarget.CLASS,
22+
AnnotationTarget.TYPEALIAS,
23+
AnnotationTarget.TYPE,
24+
AnnotationTarget.FUNCTION,
25+
)
26+
annotation class CoroutineRouterDsl
27+
28+
@CoroutineRouterDsl
1929
class CoroutineRouter(val coroutineStart: CoroutineStart, val router: Router) {
2030

2131
val coroutineScope: CoroutineScope by lazy {
@@ -39,7 +49,6 @@ class CoroutineRouter(val coroutineStart: CoroutineStart, val router: Router) {
3949
* @param handler Error handler.
4050
* @return This router.
4151
*/
42-
@RouterDsl
4352
fun error(
4453
statusCode: StatusCode,
4554
handler: suspend ErrorHandlerContext.() -> Unit,
@@ -54,7 +63,6 @@ class CoroutineRouter(val coroutineStart: CoroutineStart, val router: Router) {
5463
* @param handler Error handler.
5564
* @return This router.
5665
*/
57-
@RouterDsl
5866
fun error(
5967
type: KClass<Throwable>,
6068
handler: suspend ErrorHandlerContext.() -> Unit,
@@ -73,7 +81,6 @@ class CoroutineRouter(val coroutineStart: CoroutineStart, val router: Router) {
7381
* @param handler Error handler.
7482
* @return This router.
7583
*/
76-
@RouterDsl
7784
fun error(
7885
predicate: Predicate<StatusCode>,
7986
handler: suspend ErrorHandlerContext.() -> Unit,
@@ -91,7 +98,6 @@ class CoroutineRouter(val coroutineStart: CoroutineStart, val router: Router) {
9198
* @param handler Error handler.
9299
* @return This router.
93100
*/
94-
@RouterDsl
95101
fun error(handler: suspend ErrorHandlerContext.() -> Unit): CoroutineRouter {
96102
val chain =
97103
fun(
@@ -110,33 +116,25 @@ class CoroutineRouter(val coroutineStart: CoroutineStart, val router: Router) {
110116
return this
111117
}
112118

113-
@RouterDsl
114119
fun get(pattern: String, handler: suspend HandlerContext.() -> Any) = route(GET, pattern, handler)
115120

116-
@RouterDsl
117121
fun post(pattern: String, handler: suspend HandlerContext.() -> Any) =
118122
route(POST, pattern, handler)
119123

120-
@RouterDsl
121124
fun put(pattern: String, handler: suspend HandlerContext.() -> Any) = route(PUT, pattern, handler)
122125

123-
@RouterDsl
124126
fun delete(pattern: String, handler: suspend HandlerContext.() -> Any) =
125127
route(DELETE, pattern, handler)
126128

127-
@RouterDsl
128129
fun patch(pattern: String, handler: suspend HandlerContext.() -> Any) =
129130
route(PATCH, pattern, handler)
130131

131-
@RouterDsl
132132
fun head(pattern: String, handler: suspend HandlerContext.() -> Any) =
133133
route(HEAD, pattern, handler)
134134

135-
@RouterDsl
136135
fun trace(pattern: String, handler: suspend HandlerContext.() -> Any) =
137136
route(TRACE, pattern, handler)
138137

139-
@RouterDsl
140138
fun options(pattern: String, handler: suspend HandlerContext.() -> Any) =
141139
route(OPTIONS, pattern, handler)
142140

0 commit comments

Comments
 (0)