v5.0.0 (2026-07-14)
<dependency>
<groupId>net.hasor</groupId>
<artifactId>hasor-core</artifactId>
<version>5.0.0</version>
</dependency>
Version 5.0 raises the runtime baseline to Java 17, reorganizes Core configuration, object providers, and startup APIs, and uses Cobble for shared infrastructure.
Scope
- Java runtime, Core startup and extension APIs, Web container integration, and JSON responses
Changes
- Added
- Provide
Hasor.run(args, primarySources)for quick startup, with startup argument binding, primary source registration, and shutdown hook control. - Add
AppContext.toBeanMap(),toTypeMap(), andtoNameMap()to access Beans through Maps by binding ID, type, or name. - Add
WebServers,WebServerConfig, andWebServerProviderto Web for creating, configuring, and discovering embedded HTTP containers.
- Provide
- Improved
- Use Cobble for shared utilities, configuration, resource loading, class scanning, and dynamic proxies.
- Use Java
Supplierfor object provider APIs, and Cobble for scope and interceptor interfaces. - Remove the separate
Environmentabstraction; expose configuration, events, resource loaders, and class loaders directly throughAppContext.
- Fixed
- Restore the
javax.annotation-apidependency to support@PostConstructand@PreDestroylifecycle annotations.
- Restore the
Upgrade notes
- Use Java 17 or later for building and running applications. Applications on 4.x must adapt their source and recompile; replacing dependencies alone is insufficient.
- The original
net.hasor.core.Settings,Scope, AOP, and shared utility APIs have changed or moved to Cobble. Update custom containers, scopes, and interceptors. - Adapt business extensions using the original
Providertype to the newSupplierAPIs; access capabilities previously obtained throughgetEnvironment()throughAppContext. @InjectSettingsnow reads configuration consistently from Settings. The${...}syntax still strips its delimiters, but no longer reads environment variables directly through the old Environment. Create corresponding configuration keys for previous environment variable injection; explicitly specify packages when using class scanning APIs.- The built-in
JsonRenderEnginestill uses Fastjson but no longer explicitly enablesWriteMapNullValue. Check response formats or customize the renderer for APIs that depend on null fields being included.