A set of Java libraries dedicated to helping you build better applications.
- Features
- Getting Started
- Usage
- API Documentation
- Building from Source
- Running Tests
- Contributing
- License
- Contact
Xorcery contains several core modules, which are used by most applications and services:
- Core: dependency injection and runtime level support through HK2
- Configuration: composable, overridable, uses YAML+JSON-Schema for editing and validation
- JSON: JSON merging and reference resolving, primarily for configuration handling
- JUnit: helpers to run Xorcery in tests
- Log4j: integration of configuration and DI with Log4j2
- Runner: standard Main class with CLI to startup your application
- Util: various helper classes
The majority of the useful modules used to build applications and services are in the extensions, which you can add to your own project as needed.
- AWS Authentication
- Certificate management
- DNS client and registration
- EventStore client
- JAX-RS server helpers
- Jersey JAX-RS client
- Jersey JAX-RS server
- Jetty client
- Jetty server
- JSON:API
- JSON-Schema
- JWT server
- Keystore management
- Kurrent client
- Maven plugins: JSON-Schema generation for module configurations, etc.
- OpenSearch client
- OpenTelemetry: SDK integration, exporters, modules, and JDK/JVM/system integrations
- Reactive streams over websockets: integrated with Project Reactor(Flux)
- Secrets access
- Status API
- Thymeleaf integration
- Build and runtime translation
Most modules are integrated with the Configuration object, Log4j2 loggers, and OpenTelemetry observability support. Many of these only require you to add it as a dependency and providing your own configuration overrides. Some of them provide APIs and SPIs that you can use or implement in your own modules.
Before you begin, ensure you have the following installed:
- Java 21 or higher
- Maven 3.6+ or Gradle 6.0+
- Git (for cloning the repository)
You can verify your Java installation:
java -version
javac -version
Add the Maven BOM dependency to your pom.xml
:
<dependencyManagement>
<dependency>
<groupId>dev.xorcery</groupId>
<artifactId>xorcery-bom</artifactId>
<version>${xorcery.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
and then add any modules you want to use which are included in the BOM, including a reference to our repository server:
<dependencies>
...
<dependency>
<groupId>dev.xorcery</groupId>
<artifactId>xorcery-dns-client</artifactId>
</dependency>
...
</dependencies>
<repositories>
...
<repository>
<id>cantara-releases</id>
<name>Cantara Release Repository</name>
<url>https://mvnrepo.cantara.no/content/repositories/releases/</url>
</repository>
<repository>
<id>cantara-snapshots</id>
<name>Cantara Snapshot Repository</name>
<url>https://mvnrepo.cantara.no/content/repositories/snapshots/</url>
</repository>
</repositories>
git clone https://github.com/Cantara/xorcery.git
cd xorcery
mvn clean install
import dev.xorcery.core.Xorcery;
import dev.xorcery.configuration.Configuration;
import dev.xorcery.configuration.builder.ConfigurationBuilder;
public class Example {
public static void main(String[] args) throws Throwable {
// Add all module configuration and optional overrides, and then merge them into a single configuration
Configuration configuration = new ConfigurationBuilder().addDefaults().build();
try (Xorcery xorcery = new Xorcery(configuration)){
// This will use HK2 to find any enabled services, instantiate them using DI, and optionally use
// run-level semantics to get the application into a started state
}
// At this point the Xorcery instance has been closed/stopped, and all services are shutdown.
// Use shutdown hooks in your application for long-lived services that are stopped manually
}
}
You can do this both for your applications and for running tests. Each named service automatically gets a feature flag in the configuration (e.g. service "foo" is controlled by "foo.enabled: true/false" in config), which makes it straightforward to run Xorcery with all or a subset of the packaged services, depending on your needs.
See Javadocs
# Clone the repository
git clone https://github.com/Cantara/xorcery.git
cd xorcery
# Compile and install all modules
mvn clean install
# Maven
mvn test
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
git clone https://github.com/Cantara/xorcery.git
cd xorcery
mvn clean install
This project follows Google Java Style Guide. Please ensure your code adheres to these standards.
Q: What Java versions are supported? A: Java 21 and higher are supported.
Q: How do I report a bug? A: Please create an issue on GitHub with a detailed description and steps to reproduce.
Q: Is this project production-ready? A: Yes, this project is actively used in production environments.
This project is licensed under the ASLv2 License - see the LICENSE file for details.
Project Maintainer: Rickard Oberg
- Email: [email protected]
- GitHub: @rickardoberg
- LinkedIn: Your Profile
- Thanks to all contributors who have helped shape this project
- Built with ❤️ using Java
⭐ If you find this project helpful, please give it a star on GitHub!