NixOS / mvn2nix-maven-plugin

Generate project-info.json for use with nix's Maven repository generation functions
MIT License
31 stars 21 forks source link

Support for version ranges #12

Open bobvanderlinden opened 6 years ago

bobvanderlinden commented 6 years ago

It seems version ranges are not working correctly. I have the following in pom.xml:

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>[1.7.1,1.7.99)</version>
    </dependency>

When I run mvn2nix, the following pops up in project-info.json:

        {
          "artifactId": "slf4j-api",
          "groupId": "org.slf4j",
          "version": "[1.7.1,1.7.99)",
          "classifier": "",
          "extension": "jar",
          "scope": "compile",
          "optional": false,
          "exclusions": []
        },

Eventually, buildMaven will generate a shell script that includes:

dir=$out/org/slf4j/slf4j-api/[1.7.1,1.7.99)

This will result in an error.

I have gone through the code to see how to force it to resolve all versions, but I'm a bit at a loss. I also do not seem to have a good way to debug the code. All suggestions are welcome.

bobvanderlinden commented 6 years ago

It seems I was mistaken, as ~/.m2/repositories/org/slf4j/slf4j-api/[1.7.1,1.7.99) actually exists on my filesystem 😕 . buildMaven is not escaping the variables correctly, so this plugin is not at fault here.

ttuegel commented 6 years ago

Actually, the plugin is at fault! If you check that path, you will find no metadata inside because Maven treats that string as a version number which (of course) does not exist upstream.