Java近期新聞:Grail 5.0、Spring、Hibernate、WildFly及Kotlin Multik開發庫更新

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2021年10月11日起始周Java新聞更新:OpenJDK、JDK 18、Spring Framework、Grails 5.0、Micronaut 3.1、Helidon 2.3.4、Hibernate ORM和Hibernate Reactive GA版本、與WildFly 25、GraalVM Native Tools 0.96、Apache Camel 3.11.3、Piranha 21.10.0相關的更新,以及Kotlin的Multik多維數組開發庫。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" OpenJDK"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" 經過一週的評審,JEP 408,也就是Simple Web Server由JDK 18的Proposed to Target狀態進入到了Targeted。這個JEP提供了一個基於HTTP命令行的、最小化的、只提供靜態文件的Web服務器。這個工具主要用於構建原型、臨時編碼和測試,特別是在培訓環境中。這個Web服務器可以通過以下命令來啓動:"}]},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":" $ java -m jdk.httpserver [-b bind address] [-p port] [-d directory] [-h to show help message] [-o none|default|verbose]"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/openjdk.java.net\/jeps\/419","title":null,"type":null},"content":[{"type":"text","text":"JEP 419"}]},{"type":"text","text":",也就是外部函數和內存API從Draft狀態進入到了Candidate。該JEP從JEP 412(已在JDK 17中發佈)演化而來,基於Java社區的反饋做了改進,主要變更包括:支持更多的內存訪問變量句柄,如boolean和MemoryAddress接口;MemoryAddress和MemorySegment接口的解除引用API;簡化持有調用方法句柄的API,不再需要傳遞MemoryType枚舉;在內存段之間拷貝數組的新API。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"JDK 18"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"JDK 18嚐鮮構建版"},{"type":"link","attrs":{"href":"https:\/\/github.com\/openjdk\/jdk\/releases\/tag\/jdk-18%2B19","title":null,"type":null},"content":[{"type":"text","text":"Build 19"}]},{"type":"text","text":"可用,修復了在Build 18中存在的各種問題,更多細節可參看發佈"},{"type":"link","attrs":{"href":"https:\/\/jdk.java.net\/18\/release-notes","title":null,"type":null},"content":[{"type":"text","text":"公告"}]},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"JDK 18目前的特性集合如下:"}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"JEP 400:"},{"type":"link","attrs":{"href":"https:\/\/openjdk.java.net\/jeps\/400","title":null,"type":null},"content":[{"type":"text","text":"默認字符集爲UTF-8"}]},{"type":"text","text":";"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"JEP 408:"},{"type":"link","attrs":{"href":"https:\/\/openjdk.java.net\/jeps\/408","title":null,"type":null},"content":[{"type":"text","text":"Simple Web Server"}]},{"type":"text","text":";"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"JEP 413:"},{"type":"link","attrs":{"href":"https:\/\/openjdk.java.net\/jeps\/413","title":null,"type":null},"content":[{"type":"text","text":"Java API文檔中加入了代碼片段"}]},{"type":"text","text":";"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"JEP 417:"},{"type":"link","attrs":{"href":"https:\/\/openjdk.java.net\/jeps\/417","title":null,"type":null},"content":[{"type":"text","text":"Vector API(第三個孵化器)"}]},{"type":"text","text":"。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"開發者可以通過"},{"type":"link","attrs":{"href":"https:\/\/bugreport.java.com\/bugreport\/","title":null,"type":null},"content":[{"type":"text","text":"Java Bug Database"}]},{"type":"text","text":"提交bug。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Spring Framework"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Spring Framework發佈多個單點版本。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"5.3.11版本包含了32個問題修復和改進,5.2.18.RELEASE版本包含10個問題修復和改進。這個兩個版本都提供了一個增強的DefaultResponseErrorHandler類,可以將整個錯誤響應消息體記錄到日誌當中。5.3.11版本的其他新特性包括:支持非公開的Record聲明;可以直接調用實現了Closeable和AutoCloseable接口的類的close()方法。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Grails"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Grails基金會發布了Grails 5.0,升級了多個依賴項:Apache Groovy 3、Micronaut Framework 3、Gradle 7、Spring Boot 2.5、Spring Framework 5.3以及Spock 2.0。其他值得注意的變更還包括:棄用基於點號的訪問模式;默認按類型裝配,取代了按名字裝配;Gradle插件改動。更新細節可在發佈"},{"type":"link","attrs":{"href":"https:\/\/github.com\/grails\/grails-core\/releases\/tag\/v5.0.0","title":null,"type":null},"content":[{"type":"text","text":"公告"}]},{"type":"text","text":"和"},{"type":"link","attrs":{"href":"https:\/\/grails.org\/documentation.html","title":null,"type":null},"content":[{"type":"text","text":"文檔"}]},{"type":"text","text":"中找到。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Micronaut"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Micronaut基金會發布了"},{"type":"link","attrs":{"href":"https:\/\/micronaut.io\/2021\/10\/11\/micronaut-framework-released\/","title":null,"type":null},"content":[{"type":"text","text":"Micronaut 3.1"}]},{"type":"text","text":",帶來了大量的新特性,包括:支持JDK 17;工廠Bean可以創建原始類型或原始數組類型的Bean;新的@InjectScope註解,用於銷燬無定義作用域的Bean;對生成類的自檢進行了優化;改進了針對Kotlin的上下文傳播;在HTTP過濾器中使用正則表達式。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Helidon"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Helidon 2.3.4發佈,改進的特性包括:修復了WebServer組件存在的問題,比如Netty服務器在負載下會掛起,以及在檢查消息體是否被完全讀取時出現的靜態條件;修復了WebClient的一個問題,如果一個主機地址出現在一個非主機列表中,將其轉換成相對的請求RUI;修復了與Metrics組件相關的問題,如新的PeriodExecutor類會錯誤地記錄警告信息,警告信息的消息可能是錯誤的,以及指標性能優化導致的原生鏡像構建錯誤。更多細節可以參看發佈"},{"type":"link","attrs":{"href":"https:\/\/github.com\/oracle\/helidon\/releases\/tag\/2.3.4","title":null,"type":null},"content":[{"type":"text","text":"公告"}]},{"type":"text","text":"。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Hibernate"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Hibernate發佈了"},{"type":"link","attrs":{"href":"https:\/\/hibernate.org\/orm\/","title":null,"type":null},"content":[{"type":"text","text":"Hibernate ORM"}]},{"type":"text","text":"的單點版本和"},{"type":"link","attrs":{"href":"https:\/\/hibernate.org\/reactive\/","title":null,"type":null},"content":[{"type":"text","text":"Hibernate Reactive"}]},{"type":"text","text":"的GA版本。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Hibernate ORM 5.6.0.Final修復了同時使用@EmbeddedId和@MapsId時會出現的一個錯誤,將依賴項ByteBuddy升級到1.11.20,增加了爲升級到Hibernate ORM 6.0而發出的棄用警告信息。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Hibernate ORM 6.0第一個Beta版本的特性包括:遷移到了Jakarta Persistence;改進的類型系統,引入了新的根據位置讀取JDBC記錄的概念;新的類型註解;改進的時間區域支持。更多細節可以在"},{"type":"link","attrs":{"href":"https:\/\/docs.jboss.org\/hibernate\/orm\/6.0\/userguide\/html_single\/Hibernate_User_Guide.html","title":null,"type":null},"content":[{"type":"text","text":"用戶指南"}]},{"type":"text","text":"、"},{"type":"link","attrs":{"href":"https:\/\/github.com\/hibernate\/hibernate-orm\/blob\/6.0.0.Beta1\/migration-guide.adoc","title":null,"type":null},"content":[{"type":"text","text":"遷移指南"}]},{"type":"text","text":"和"},{"type":"link","attrs":{"href":"https:\/\/hibernate.org\/orm\/releases\/6.0\/","title":null,"type":null},"content":[{"type":"text","text":"發佈公告"}]},{"type":"text","text":"頁找到。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Hibernate Reactive 1.0.0.CR10發佈,支持MySQL、DB2和MS SQL Server的"},{"type":"link","attrs":{"href":"https:\/\/hibernate.org\/reactive\/documentation\/1.0\/reference\/html_single\/#_automatic_schema_export","title":null,"type":null},"content":[{"type":"text","text":"自動模式驗證和更新"}]},{"type":"text","text":"。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"WildFly"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"WildFly團隊向Java社區發佈了很多與WildFly 25相關的更新。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"WildFly 25的源碼到鏡像(Source to Image,S2I)Docker鏡像已在quay.io上發佈,用於構建、分析和發佈容器鏡像。這些鏡像包含了與WildFly 25 GA版本相關的更新。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/github.com\/wildfly-extras\/wildfly-jar-maven-plugin\/","title":null,"type":null},"content":[{"type":"text","text":"WildFly Bootable JAR 6.0"}]},{"type":"text","text":" Maven插件發佈,特性包括:Galleon配置"},{"type":"link","attrs":{"href":"https:\/\/github.com\/wildfly-extras\/wildfly-jar-maven-plugin\/tree\/6.0.0.Final\/examples","title":null,"type":null},"content":[{"type":"text","text":"示例"}]},{"type":"text","text":";自動生成自簽名安全證書;原生支持OpenID Connect。更多細節可以參看這篇"},{"type":"link","attrs":{"href":"https:\/\/www.wildfly.org\/news\/2020\/10\/19\/bootable-jar-2.0-released\/","title":null,"type":null},"content":[{"type":"text","text":"博文"}]},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"WildFly 25現在支持MicroProfile Reactive Messaging 2.0規範,基於"},{"type":"link","attrs":{"href":"https:\/\/github.com\/smallrye\/smallrye-reactive-messaging","title":null,"type":null},"content":[{"type":"text","text":"SmallRye Reactive Messaging"}]},{"type":"text","text":"實現。開發者現在可以使用@Channel註解和Emitter接口將數據推送到響應式流中。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"GraalVM"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在1.0版本之前,Oracle實驗室發佈了0.9.6版本的"},{"type":"link","attrs":{"href":"https:\/\/github.com\/graalvm\/native-build-tools\/","title":null,"type":null},"content":[{"type":"text","text":"Native Build Tools"}]},{"type":"text","text":",提供用於操作GraalVM原生鏡像的插件。該版本集成了JUnit 5.8,不過也引入了一個重大變化,導致Maven用戶需要定義插件擴展。"}]},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"\n org.graalvm.buildtools\n native-maven-plugin\n ${native.maven.plugin.version}\n true\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不再需要junit-platform-native依賴項,不過Gradle用戶仍然需要這個依賴項。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Apache Camel"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Apache Camel 3.11.3發佈,包含26個bug修復和改進,包括:依賴項Apache Karaf升級到1.1.11、Camel Spring Boot升級到2.5.5。更多細節可參看發佈"},{"type":"link","attrs":{"href":"https:\/\/camel.apache.org\/releases\/release-3.11.3\/","title":null,"type":null},"content":[{"type":"text","text":"公告"}]},{"type":"text","text":"。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Piranha"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Piranha 21.10.0發佈。該版本號稱是“第一個支持版本”,提供了一個新的支持分支,與自JDK 17以後的LTS Java版本對齊,並支持Jakarta EE。更多細節可以在官方"},{"type":"link","attrs":{"href":"https:\/\/javadoc.io\/doc\/cloud.piranha\/project\/21.10.0\/index.html","title":null,"type":null},"content":[{"type":"text","text":"文檔"}]},{"type":"text","text":"和問題追蹤系統中找到。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Kotlin Multik開發庫"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"JetBrains發佈Multik 0.1,一個新的多維數組開發庫,可以讀寫.csv文件,執行代數運算,支持複數,並改進了已有函數的性能。更多細節可以在這篇"},{"type":"link","attrs":{"href":"https:\/\/blog.jetbrains.com\/kotlin\/2021\/02\/multik-multidimensional-arrays-in-kotlin\/","title":null,"type":null},"content":[{"type":"text","text":"博文"}]},{"type":"text","text":"中找到。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"原文鏈接"},{"type":"text","text":":"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.infoq.com\/news\/2021\/10\/java-news-roundup-oct11-2021\/","title":null,"type":null},"content":[{"type":"text","text":"Java News Roundup: Grails 5.0, Spring Framework, Hibernate, WildFly and the Kotlin Multik Library"}]}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章