Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

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

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +1 to +4
{ 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant