# Having local packages in a monorepo depend on one another

**URL:** https://discourse.julialang.org/t/having-local-packages-in-a-monorepo-depend-on-one-another/50454
**Category:** Package Management
**Tags:** question, package, pkg
**Created:** [November 19, 2020, 6:34pm UTC](https://discourse.julialang.org/t/having-local-packages-in-a-monorepo-depend-on-one-another/50454 "2020-11-19T18:34:57Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [November 19, 2020, 8:58pm UTC](https://discourse.julialang.org/t/having-local-packages-in-a-monorepo-depend-on-one-another/50454/4 "2020-11-19T20:58:02Z")

</div>

Just like you did `Pkg.develop` to add the packages to your global environment (`~/.julia/environments/1.5`) you should use `Pkg.develop` when you add them as dependencies of each other. Here is an example:

Generate two local packages:

```shell
$ jlpkg generate A; jlpkg generate B
 Generating project A ...
 Generating project B ...

```

Add them with `develop` and the path:

```shell
$ jlpkg --project=. dev A B # Add both to "global env"
  Resolving package versions...
Updating `/tmp/Project.toml`
  [a8860211] + A v0.1.0 `A`
  [c725e7a7] + B v0.1.0 `B`
Updating `/tmp/Manifest.toml`
  [a8860211] + A v0.1.0 `A`
  [c725e7a7] + B v0.1.0 `B`

```

Manifest looks good:

```shell
$ cat Manifest.toml 
# This file is machine-generated - editing it directly is not advised

[[A]]
path = "A"
uuid = "a8860211-dfc0-462f-9fbf-c3432d7e395f"
version = "0.1.0"

[[B]]
path = "B"
uuid = "c725e7a7-9ad5-4b2e-b018-0ca07287f03e"
version = "0.1.0"

```

Add `B` as a dependency to the `A` project:

```shell
$ jlpkg --project=A dev B # Add B as a dependency to A
  Resolving package versions...
Updating `/tmp/A/Project.toml`
  [c725e7a7] + B v0.1.0 `../B`
Updating `/tmp/A/Manifest.toml`
  [c725e7a7] + B v0.1.0 `../B`

```

Sync the global manifest to update `A`’s dependencies

```shell
$ jlpkg --project=. resolve # Sync the global manifest
[...]

```

Make sure `A` properly depends on `B`:

```shell
$ cat Manifest.toml 
# This file is machine-generated - editing it directly is not advised

[[A]]
deps = ["B"]
path = "A"
uuid = "a8860211-dfc0-462f-9fbf-c3432d7e395f"
version = "0.1.0"

[[B]]
path = "B"
uuid = "c725e7a7-9ad5-4b2e-b018-0ca07287f03e"
version = "0.1.0"

```

---

_[View the full topic](https://discourse.julialang.org/t/having-local-packages-in-a-monorepo-depend-on-one-another/50454)._
