mvn2nix-maven-plugin icon indicating copy to clipboard operation
mvn2nix-maven-plugin copied to clipboard

project-info.json missing "authenticated" flag sometimes if dependency has already been fetched into local maven repository

Open trentonstrong opened this issue 9 years ago • 11 comments

My current workaround is to use the following one liner:

mvn -Dmaven.repo.local=mktemp -d -t maven org.nixos.mvn2nix:mvn2nix-maven-plugin:mvn2nix

trentonstrong avatar Aug 13 '15 22:08 trentonstrong

Can confirm, for local dependencies that are not available online.

Profpatsch avatar Mar 15 '16 23:03 Profpatsch

Same here -- trying to build a project-info.json on a big project with no local repo is a bit painful.

grahamc avatar Jun 04 '16 20:06 grahamc

The workaround given above does indeed work: mvn -Dmaven.repo.local=$(mktemp -d -t maven) org.nixos.mvn2nix:mvn2nix-maven-plugin:mvn2nix.

Could we change the title of this issue to something slightly more descriptive? e.g.

project-info.json missing "authenticated" flag sometimes if dependency has already been fetched into local maven repository.

lverns avatar Feb 08 '17 14:02 lverns

Unfortunately the workaround does not work for me. I've even tried deleting the default local Maven repository but have had no luck. I'd appreciate any help if someone knows what the problem is.

---EDIT---

I tested the workaround on my system with Maven 3.2.5 in addition to Maven 3.3.9, but am still getting the attribute 'authenticated' missing error.

kmdouglass:~$ uname -a
Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux

kmdouglass:~$ mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.7.0_121, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-4-amd64", arch: "amd64", family: "unix"

kmdouglass:~$ nix-build ij2.nix  --show-trace 
error: while evaluating the attribute ‘args’ of the derivation ‘ImageJ’ at /home/kmdouglass/Desktop/workspace/ImageJ_Nix/ij2.nix:5:3:
while evaluating the attribute ‘text’ of the derivation ‘install.sh’ at /nix/store/6cgxclznakgrwxmccxyb9s5qcyax29rn-nixpkgs-17.09pre106045.7369fd0b51/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute ‘buildPhase’ of the derivation ‘ij-1.51j.jar’ at /nix/store/6cgxclznakgrwxmccxyb9s5qcyax29rn-nixpkgs-17.09pre106045.7369fd0b51/nixpkgs/pkgs/build-support/build-maven.nix:60:5:
while evaluating the attribute ‘text’ of the derivation ‘settings.xml’ at /nix/store/6cgxclznakgrwxmccxyb9s5qcyax29rn-nixpkgs-17.09pre106045.7369fd0b51/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute ‘buildCommand’ of the derivation ‘maven-repository’ at /nix/store/6cgxclznakgrwxmccxyb9s5qcyax29rn-nixpkgs-17.09pre106045.7369fd0b51/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute ‘text’ of the derivation ‘build-maven-repository.sh’ at /nix/store/6cgxclznakgrwxmccxyb9s5qcyax29rn-nixpkgs-17.09pre106045.7369fd0b51/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating anonymous function at /nix/store/6cgxclznakgrwxmccxyb9s5qcyax29rn-nixpkgs-17.09pre106045.7369fd0b51/nixpkgs/pkgs/build-support/build-maven.nix:17:31, called from undefined position:
attribute ‘authenticated’ missing, at /nix/store/6cgxclznakgrwxmccxyb9s5qcyax29rn-nixpkgs-17.09pre106045.7369fd0b51/nixpkgs/pkgs/build-support/build-maven.nix:17:39

kmdouglass avatar May 12 '17 20:05 kmdouglass

This is causing trouble for me too

copumpkin avatar Jun 29 '17 02:06 copumpkin

I think this is just caused by this line being hidden behind if (res.getRepository() instanceof RemoteRepository), which I guess is not always the case.

copumpkin avatar Jun 29 '17 02:06 copumpkin

The better solution though is probably just to amend the builder in nixpkgs to not assume it's there. Something like .authenticated or false would probably be all that it takes. I'll experiment and maybe push up a fix.

copumpkin avatar Jun 29 '17 02:06 copumpkin

The workaround also doesn't work for exhibitor, as it has two modules in the top-level project, exhibitor-core and exhibitor-standalone, the latter of which depends on the former, and so it'll always be a local repo.

joelthompson avatar Jun 29 '17 02:06 joelthompson

@copumpkin Did you manage to experiment with fixing missing "authenticated" as you mentioned in June?

datakurre avatar Jan 23 '18 19:01 datakurre

I followed up with @copumpkin's suggestion of .authenticated or false, but I found that a large number of dependencies on this project (kframework/k) also do not specify url or sha1.

ttuegel avatar Jul 25 '18 13:07 ttuegel

@ttuegel Is it dependencies of dependencies that have no url and sha1?

e.g. maven-install-plugin > maven-project

asymmetric avatar Jul 25 '18 14:07 asymmetric