Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calvin-l/nixjars
Java packages (JARs) built with Nix
https://github.com/calvin-l/nixjars
Last synced: 23 days ago
JSON representation
Java packages (JARs) built with Nix
- Host: GitHub
- URL: https://github.com/calvin-l/nixjars
- Owner: Calvin-L
- License: mit
- Created: 2024-03-18T05:42:55.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-13T00:15:40.000Z (4 months ago)
- Last Synced: 2024-10-16T08:10:43.219Z (2 months ago)
- Language: Nix
- Size: 160 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Support: support-functions/buildJavaPackage.nix
Awesome Lists containing this project
README
# NixJARs
This is a set of Nix expressions for building Java packages (JARs). It already
includes several common Java libraries and can be easily extended with more.
For instance, the top 10 most popular Java libraries (as of March 2024) are all
available:- junit (as `junit4`)
- slf4j-api (as `slf4j.api`)
- guava
- mockito
- jackson-databind (as `jackson.databind`)
- commons-lang3 (as `commons-lang`)
- logback-classic (as `logback.classic`)
- commons-io
- lombok
- gsonTo list available packages:
nix-env -qaPf . | sort
TODO: document `buildJavaPackage`. See `examples/basic-project.nix`.
TODO: document how to overlay an upgrade for one particular package. See
`examples/override-package.nix`.## Motivation
I am sick of `NoClassDefFoundError`.
The packages here are guaranteed to meet a minimum level of compatibility since
they are compiled from source against each other.## FAQ
**Why not build with Ant/Maven/Gradle?**
All of the projects here have some other build system, and all of those build
systems are ignored. The major Java build systems are deeply incompatible with
the Nix way of doing things, since they insist on locating dependencies
themselves rather than having them provided by an external package manager.
See [Misadventures Recompiling the Java Ecosystem from Source](https://calvin.loncaric.us/articles/JavaCompilation.html)
for more information about why Maven, specifically, would be a nightmare to
support.**Java 9 Modules?**
Yes, modules are supported. However, at the moment the builder does not
modularize executables, which means there isn't actually any run-time
encapsulation protection. TODO: switch from `CLASSPATH` to `--module-path` for
executables that support it.**OSGi?**
No. Most OSGi projects work just fine as normal JARs, which is the way this
set of packages prefers to use them.