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

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

Open
trentonstrong opened this issue Aug 13, 2015 · 11 comments

Comments

@trentonstrong
Copy link

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

@Profpatsch
Copy link
Member

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

@grahamc
Copy link
Member

grahamc commented Jun 4, 2016

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

@lverns
Copy link

lverns commented Feb 8, 2017

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.

@shlevy shlevy changed the title mvn2nix misses "authenticated" flag sometimes if dependency has already been fetched into local maven repository project-info.json missing "authenticated" flag sometimes if dependency has already been fetched into local maven repository Feb 8, 2017
@kmdouglass
Copy link

kmdouglass commented May 12, 2017

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

@copumpkin
Copy link
Member

This is causing trouble for me too

@copumpkin
Copy link
Member

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
Copy link
Member

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.

@joelthompson
Copy link

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.

@datakurre
Copy link

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

@ttuegel
Copy link
Member

ttuegel commented Jul 25, 2018

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.

asymmetric added a commit to asymmetric/nixpkgs that referenced this issue Jul 25, 2018
The `authenticated` attribute is not always present in the
`project-info.json` produced by maven2nix[0]

We therefore check for its presence, and default it to false.

[0]: NixOS/mvn2nix-maven-plugin#5 (comment)
@asymmetric
Copy link

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants