尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Apache Juneau
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗📢 Documentation Update
This README has been updated to reflect our new Docusaurus-based documentation site. For the most current documentation, please visit the official Apache Juneau website.
Apache Juneau™ is a single cohesive Java ecosystem consisting of a comprehensive toolkit for marshalling POJOs to a wide variety of content types using a common framework, along with universal REST server and client APIs for creating Swagger-based self-documenting REST interfaces.
⚠️ Upgrading from 9.x? The project is currently developing the 10.0.0 release, which includes a number of breaking changes (the public
ObjectRestclass removed,SerializerSet/ParserSetlookups now returningOptional, the next-genRestClientno longer implicitly defaulting to JSON, thejuneau-assertions/juneau-bct/juneau-junit5modules merged into a singlejuneau-bctartifact, and the legacyjuneau-my-jetty-microservice/juneau-examples-restmodules removed, among others). See the 10.0.0 Migration Guide for the full list before upgrading.
2025-06-18 and 2026-07-28 protocol revisionsApache Juneau ships first-party MCP integration, built the same way as the rest of the framework: annotation-driven, POJO-based, no magic. The module family is split into revision-neutral cores plus thin adapters per protocol revision, so a 2025-06-18-only deployment never pulls in 2026-07-28-only dependencies (OAuth 2.1, JWT, reactive-streams SSE, etc.):
juneau-bean-mcp-v20250618 / juneau-bean-mcp-v20260728 adapters for each revision's wire beans.juneau-rest-server-mcp-v20250618 / juneau-rest-server-mcp-v20260728 adapters for exposing tools, prompts, and resources (dedicated servlet or drop-in mixin, plain or Spring Boot).juneau-rest-client-mcp-v20250618 / juneau-rest-client-mcp-v20260728 typed client facades, plus juneau-rest-client-mcp-auth for the client-side OAuth 2.1 acquisition flow.The 2026-07-28 revision is a strict superset of 2025-06-18 and is where new capability work (Multi-Round-Trip Requests/elicitation, subscriptions, cache hints, trace-context propagation) lands going forward. See MCP (Model Context Protocol) for the quickstart, setup guide, and full API reference.
Note: The documentation is automatically updated and provides the most current project information.
Apache Juneau™ excels in the following scenarios:
<dependency>
<groupId>org.apache.juneau</groupId>
<artifactId>juneau-shaded-all</artifactId>
<version>10.0.0-SNAPSHOT</version>
</dependency>
10.0.0is currently under development (tracking-SNAPSHOTbuilds) and has not yet been released. See the Downloads page for the latest released version.
import org.apache.juneau.json.*;
public class QuickStart {
public static void main(String[] args) {
// Create a simple POJO
Person person = new Person("John", 30);
// Serialize to JSON
String json = Json.of(person);
System.out.println(json);
// Output: {"name":"John","age":30}
}
public static class Person {
public String name;
public int age;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
}
}
// Parse JSON back to POJO
Person parsed = Json.to(json, Person.class);
System.out.println(parsed.name); // Output: John
import org.apache.juneau.rest.*;
import org.apache.juneau.rest.servlet.*;
@Rest(
title="Hello World API",
description="Simple REST API example"
)
public class HelloWorldResource extends BasicRestServlet {
@RestGet("/hello/{name}")
public String sayHello(@Path String name) {
return "Hello " + name + "!";
}
@RestGet("/person")
public Person getPerson() {
return new Person("Jane", 25);
}
}
import org.apache.juneau.rest.mock.*;
public class ApiTest {
@Test
public void testHello() throws Exception {
String response = MockRestClient
.create(HelloWorldResource.class)
.json5()
.build()
.get("/hello/World")
.run()
.assertStatus().is(200)
.getContent().asString();
assertEquals("Hello World!", response);
}
}
That's it! You now have:
juneau-config for INI-style configsjuneau-rest-server-springbootimport org.apache.juneau.xml.*;
// Serialize to XML
String xml = Xml.of(person);
System.out.println(xml);
// Output: <object><name>John</name><age>30</age></object>
// Parse XML back to POJO
Person parsed = Xml.to(xml, Person.class);
import org.apache.juneau.html.*;
// Serialize to HTML table
String html = Html.of(person);
System.out.println(html);
// Output: <table><tr><th>name</th><td>John</td></tr><tr><th>age</th><td>30</td></tr></table>
import org.apache.juneau.config.*;
// Create configuration
Config config = Config.create()
.set("database.host", "localhost")
.set("database.port", 5432)
.set("features.enabled", true)
.build();
// Read configuration
String host = config.get("database.host");
int port = config.get("database.port", Integer.class);
boolean enabled = config.get("features.enabled", Boolean.class);
import org.apache.juneau.rest.client.*;
import org.apache.juneau.http.*;
// Define REST interface
@Remote("http://api.example.com")
public interface UserService {
@Get("/users/{id}")
User getUser(@Path String id);
@Post("/users")
User createUser(@Body User user);
}
// Use as regular Java interface
UserService service = RestClient.create().build().getRemote(UserService.class);
User user = service.getUser("123");
import org.apache.juneau.rest.mock.*;
// Test without starting a server
@Test
public void testUserAPI() throws Exception {
String response = MockRestClient
.create(UserResource.class)
.json5()
.build()
.get("/users/123")
.run()
.assertStatus().is(200)
.getContent().asString();
assertThat(response).contains("John");
}
import org.apache.juneau.microservice.*;
// Create microservice
Microservice microservice = Microservice.create()
.servlet(UserResource.class)
.port(8080)
.build();
// Start server
microservice.start();
Apache Juneau™ is a single cohesive Java ecosystem consisting of the following parts, grouped by aggregator module. For the complete, always-current per-artifact list, see the Juneau Ecosystem Overview.
juneau-assertions/juneau-bct/juneau-junit5 artifacts).juneau-bean-mcp-* adapters.)Questions via email to [email protected] are always welcome.
Juneau is packed with features that may not be obvious at first. Users are encouraged to ask for code reviews by providing links to specific source files such as through GitHub. Not only can we help you with feedback, but it helps us understand usage patterns to further improve the product.
This repository uses multiple branches to separate different concerns:
master - Contains the main source code for Apache Juneaudocs - Contains the Docusaurus-based documentation siteasf-staging - Contains the staging/preview version of the websiteasf-site - Contains the production version of the websiteWhen working with the repository, ensure you're on the correct branch for your task:
master branchdocs branchasf-staging and asf-site branches are automatically updated during the release processBuilding requires:
GitControl, etc.).SecretStore implementation backed by the macOS security keychain CLI (implements the SecretStore SPI in juneau-commons).