1

My package depends on packages that are currently only on github. I tried to pull the packages down to my own vendor folder so my dependencies part looks like this:

 defp deps(:prod) do
    [
     {:ex_doc, "~> 0.16.2"},
     {:finder, path: "vendor/Finder" },
     {:erlware_commons, "~> 1.0"},
     {:pattern_tap, path: "vendor/elixir-pattern-tap"},
     {:temp, "~> 0.2"},
    ]
  end

When I try running mix hex.publish I get this error:

** (Mix) Stopping package build due to errors. Dependencies excluded from the package (only Hex packages can be dependencies): finder, pattern_tap

Is there a work around for this, something that tells hex the packages are locally managed so it won't be a problem ?

Muhammad Lukman Low
  • 8,177
  • 11
  • 44
  • 54
  • 3
    You'll have to publish those as separate packages on hex as far as I know. – Dogbert Aug 03 '17 at 05:39
  • https://stackoverflow.com/a/38949727/1650580 – Mike Buhot Aug 03 '17 at 05:50
  • Based on an earlier comment can one do this: "You need to include the stuff you're depending on from github. That is, get the source and build and then remove the github dependency. Just freeze the code on the version you pull from github." ? – Muhammad Lukman Low Aug 03 '17 at 06:06
  • Did you try the [git:](https://hexdocs.pm/mix/Mix.Tasks.Deps.html#module-git-options-git) option for your dependencies? – guitarman Aug 03 '17 at 06:08
  • Same error @guitarman – Muhammad Lukman Low Aug 03 '17 at 06:43
  • Like the error says. You can only have other packages on hex as dependencies in order to put something on hex. – Justin Wood Aug 03 '17 at 13:22
  • Yeah, just that I am on an impasse now. Those packages that I use don't belong to me so I cannot publish on hex.pm. I considered pulling those packages locally into my own source code and taking them off `mix.exs` but there are not many examples on how to do that. – Muhammad Lukman Low Aug 03 '17 at 23:01
  • Possible duplicate of [How to publish a package to hex with a dependency from github?](https://stackoverflow.com/questions/38949604/how-to-publish-a-package-to-hex-with-a-dependency-from-github) – Adam Millerchip Aug 31 '18 at 02:41

0 Answers0