-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce buildMaven derivation #17
base: test
Are you sure you want to change the base?
Conversation
Simplify the process of building a runnable JAR by including a useful derivation for others to use. It requires that the project under question is setup specifically to use the `repositoryLayout` however if so; it makes onboarding onto mvn2nix super easy.
@DerGuteMoritz curious for your thoughts. |
# @param generated: The nix expression generated by mvn2nix | ||
# @param repository: A maven repository; see buildMavenRepository above. | ||
# @param src: The src files to feed into maven | ||
buildMaven = { maven ? pkgs.maven, jdk ? pkgs.jdk, generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to split this:
buildMavenJar
& buildMavenExecutable
or something and have buildMavenExecutable
create a linkFarm
of the repository & output of buildMavenJar
@roberth also since you have good insights :) |
An unfortunate way mvn2nix operates now is that the test dependencies are part of the runtime closure because the full maven repository is included. Not sure a great solution here without restarting that whole problem about using aether etc.. |
You could figure out some rudimentary scope info by invoking maven more than once. For example
The difference between the scans will tell you something about test dependencies. My example won't help you distinguish between plugin dependencies and build dependencies though, but there's probably something you can do with the goals to tease out more information about that. You could also use the pom and aether for determining runtime dependencies but still use repo scanning to figure out plugin dependencies on top of that. Ultimately this is also a problem for the project author to solve. They probably haven't been shipping entire repos or sources only. Most projects will build an assembly or fat jar or something, so they should have an |
Simplify the process of building a runnable JAR by including a useful derivation for others to use.
It requires that the project under question is setup specifically to use the
repositoryLayout
however if so; it makes on-boarding onto mvn2nix super easy.At the moment, I've decided to only include
buildMaven
to create a runnable JAR artifact since that seems the most likely usage for someone wanting to bring their Maven application into a Nix derivation.We can consider alternative derivations that simply generate a JAR.