fzakaria/mvn2nix

mvn2nix is not working ?

Closed this issue · 11 comments

when i execute nix run -f https://github.com/fzakaria/mvn2nix/archive/master.tar.gz \ --command mvn2nix > mvn2nix-lock.json
or the command: nix run -f https://github.com/fzakaria/mvn2nix/archive/master.tar.gz --command mvn2nix

in the terminal, it returns the error message: Failed to execute goals [[package]]. Exit code: 1,
what's going on here and how do i fix this issue ?

note: it started installing from cachix and made some progress, but it seems like something broke during the installation.

i'm trying to use mvn2nix to install/build the Eclipse JDT Language Server, is that possible with this mvn2nix tool ?
here's the associated links:

https://github.com/eclipse/eclipse.jdt.ls

https://github.com/emacs-lsp/lsp-java

@zeta-00 thanks for your feedback and issue; also for trying the software.
You can add the -v switch (or -vvv) to control the verbosity of helpful messages which get printed to STDERR.
I will report back from trying that eclipse project.

@zeta-00 looks like that eclipse language server uses P2 layout something related to OSGi.
I will admit I'm not at all familiar with OSGi, Tycho or the P2 layout -- I'm sorry.

I don't think this tool will help in it's current incarnation there.

I have the same issue as well, tried to install mvn2nix on macOS 10.15.6:

Running nix run -f https://github.com/fzakaria/mvn2nix/archive/master.tar.gz --command mvn2nix returns Failed to execute goals [[package]]. Exit code: 1.

There's no additional error information when I tried running with the -vvv flag.

@manojkarthick are you running it on a public repository ?
I'll be happy to look into it for you.

Thanks @fzakaria ! I'm trying to build https://github.com/apache/parquet-mr that build the parquet-tools CLI tool for working with files using the parquet file format.

@manojkarthick

2020-09-30 21:23:46,978 [Thread-1] INFO : [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.14/plexus-utils-3.0.14.jar (239 kB at 3.7 MB/s)
2020-09-30 21:23:47,033 [Thread-1] INFO : [ERROR] thrift failed output: 
2020-09-30 21:23:47,033 [Thread-1] INFO : [ERROR] thrift failed error: /bin/sh: thrift: command not found

I looked at it a bit more.

  1. I started a nix-shell -p thrift
    (My current version of nixpkgs has thrift at version 0.13.0)

  2. Change the pom.xml to set that version, otherwise the build will fail.

index a84af6e76..2e9eeaabb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -94,7 +94,7 @@
     <pig.version>0.16.0</pig.version>
     <pig.classifier>h2</pig.classifier>
     <thrift-maven-plugin.version>0.10.0</thrift-maven-plugin.version>
-    <thrift.version>0.12.0</thrift.version>
+    <thrift.version>0.13.0</thrift.version>
     <format.thrift.version>0.12.0</format.thrift.version>
     <fastutil.version>8.2.3</fastutil.version>
     <semver.api.version>0.9.33</semver.api.version>
  1. Run the build
nix run -f https://github.com/fzakaria/mvn2nix/archive/master.tar.gz \
--command mvn2nix \
  --goals package --goals "-DskipTests=true" \
  --repositories https://conjars.org/repo/ \
  --repositories https://jitpack.io/ \
  --repositories https://repo.maven.apache.org/maven2/ \
  --repositories https://repository.cloudera.com/artifactory/ \
> mvn2nix-lock.json

I think that should get you further.

Thanks @fzakaria - I did try to install it with thrift initially. Sorry I forgot to mention that initially. Unfortunately that does not fix the issue. The actual command I'm trying to run is:

nix run -f https://github.com/fzakaria/mvn2nix/archive/master.tar.gz \
--command mvn2nix \
  --goals package --goals "-DskipTests=true" \
  --repositories https://conjars.org/repo/ \
  --repositories https://jitpack.io/ \
  --repositories https://repo.maven.apache.org/maven2/ \
  --repositories https://repository.cloudera.com/artifactory/ \
  --repositories https://maven.twttr.com/ \
> mvn2nix-lock.json

I had to add https://maven.twttr.com to the list of repositories for the hadoop-lzo dependency. The error message returned is Failed to execute goals [[package, -DskipTests=true]]. Exit code: 1. Would you be able to guide me how you obtained the error message in #25 (comment) ? That would help me with digging in a little further.

I'm having the same problem. I want to build a package that is using our own maven repo. How can I get more debugging information?

@Anderssorby @manojkarthick you can put -vvv after the call to mvn2nix to see more DEBUG output.
This issue is probably not the right format to do interactive messaging; I'm going to close it.

You can reach me over e-mail, Java channel on the NixOS discord server, fzakaria on freenode or the #nixos irc channel.