---
title: 'Composer libs for plugins'
url: 'https://getgrav.org/forum/archive/composer-libs-for-plugins-t2526'
markdown: 'https://getgrav.org/forum/archive/composer-libs-for-plugins-t2526.md'
date: '2026-06-21'
description: 'When developing plugins, if additional libraries are required using composer is there a way of getting them installed?'
---

[Archive](https://getgrav.org/forum/archive)

#  Composer libs for plugins 

  Started by Muut Archive 12 years ago · 3 replies · 741 views    

 [12 years ago](https://getgrav.org/forum/archive/composer-libs-for-plugins-t2526#post-285 "Permalink") 

When developing plugins, if additional libraries are required using composer is there a way of getting them installed?

 [12 years ago](https://getgrav.org/forum/archive/composer-libs-for-plugins-t2526#post-286 "Permalink") 

Unfortunately we have found no good way of dynamically adding libraries to a central composer. Of course you can manually do it by adding the *require* entries and running composer update. But this is not a great solutions for plugins that need to be pluggable.

What we have done is create a separate composer/vendor setup in the plugin itself so the plugin loads it's own libraries. There is potential for conflict, but if we ever include that same library in the core of grav, it would simply be a matter of removing the reference in the plugin's composer.json.

Any thoughts on how this could be improved would be appreciated.

Cheers!

 [12 years ago](https://getgrav.org/forum/archive/composer-libs-for-plugins-t2526#post-287 "Permalink") 

I think one way to do that at this point is to create composer.json file for the plugin and then edit the main composer.json to require plugin.

<https://getcomposer.org/doc/04-schema.md#repositories>

Not a perfect solution (may cause some issues during development / with symlinks), but with script based changing the main composer.json file shouldn't really be that hard to implement.

 [12 years ago](https://getgrav.org/forum/archive/composer-libs-for-plugins-t2526#post-288 "Permalink") 

Unfortunately we would pretty much lose the GPM capabilities of just installing a plugin as needed this way though. as the main *composer update* process would need to be run after every plugin install, and this could be problematic for some people in certain hosted environments.

[Log in](https://getgrav.org/login?return=%2Fforum%2Farchive%2Fcomposer-libs-for-plugins-t2526) to reply.

###  Suggested topics

 | Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| [About the Archive category](https://getgrav.org/forum/archive/about-the-archive-category-t6942)    [Archive](https://getgrav.org/forum/archive) · by Deleted User, 9 years ago |  | 0 | 2853 | [9 years ago](https://getgrav.org/forum/archive/about-the-archive-category-t6942 "by Deleted User") |
| [Hey buddies!](https://getgrav.org/forum/archive/hey-buddies-t643)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 2 | 1870 | [9 years ago](https://getgrav.org/forum/archive/hey-buddies-t643 "by Muut Archive") |
| [There is a way to do a "if condition" in MD page?](https://getgrav.org/forum/archive/there-is-a-way-to-do-a-if-condition-in-md-page-t3377)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 2 | 5193 | [9 years ago](https://getgrav.org/forum/archive/there-is-a-way-to-do-a-if-condition-in-md-page-t3377 "by Muut Archive") |
| [Official docker image of grav (+admin +gitsync)](https://getgrav.org/forum/archive/official-docker-image-of-grav-admin-gitsync-t8519)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 1 | 4010 | [9 years ago](https://getgrav.org/forum/archive/official-docker-image-of-grav-admin-gitsync-t8519 "by Muut Archive") |
| [Weird Grav + caddy + iOS + https problem](https://getgrav.org/forum/archive/weird-grav-caddy-ios-https-problem-t7837)    [Archive](https://getgrav.org/forum/archive) · by Muut Archive, 9 years ago |  | 3 | 1958 | [9 years ago](https://getgrav.org/forum/archive/weird-grav-caddy-ios-https-problem-t7837 "by Muut Archive") |
