Skip to content
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

Some small quality of live improvements #23

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

@fzakaria
Copy link
Collaborator

@fzakaria fzakaria commented Oct 15, 2020

A few small improvements for quality of life; might be worth
upstreaming as I was looking into this plugin.

  1. create a friendly Nix wrapper that includes maven and some sane
    defaults such as setting the maven repository to a temporary directory.

This causes the build to take longer since nothing is cached,
unfortunately however the likelyhood of using some local dependency is
less.

  1. change the default to emit to STDOUT just to follow unix philosophy a
    bit more. I changed the logging that maven emits to STDERR instead in
    similar vein.

  2. updated the README accordingly

fzakaria added 4 commits Oct 15, 2020
A few small improvements for quality of life; might be worth
upstreaming as I was looking into this plugin.

1. create a friendly Nix wrapper that includes maven and some sane
defaults such as setting the maven repository to a temporary directory.

This causes the build to take longer since nothing is cached,
unfortunately however the likelyhood of using some local dependency is
less.

2. change the default to emit to STDOUT just to follow unix philosophy a
bit more. I changed the logging that maven emits to STDERR instead in
similar vein.

3. updated the README accordingly
System properties
------------------

* `mvn2nixOutputFile`: Change the name of the file generated by mvn2nix
* `outputFile`: Set the name of the file generated by mvn2nix, otherwise it is output to STDOUT
Copy link
Collaborator Author

@fzakaria fzakaria Oct 15, 2020

This system property remains useful if you want to embed this plugin within a pom.xml of a project.

{ pkgs ? import <nixpkgs> {}, writeShellScriptBin ? pkgs.writeShellScriptBin, maven ? pkgs.maven }:
writeShellScriptBin "mvn2nix" ''
MAVEN_OPTS=-Dorg.slf4j.simpleLogger.logFile=System.err ${maven}/bin/mvn -Dmaven.repo.local=$(mktemp -d -t mavenXXX) org.nixos.mvn2nix:mvn2nix-maven-plugin:mvn2nix "$@"
''
Copy link
Collaborator Author

@fzakaria fzakaria Oct 15, 2020

This is merely step 1; next round will be to get the plugin to build itself using the package-info.json it has produced.
Then setting the maven.repo.local to that value.

In this world, the version identifier will be frozen to something like 0.0-NIX
(I'll use set-version during the build process to change the version in the nix derivation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant