title: Installing A Custom Composer Package from GitLab
body: <p>I've created a simple test wordpress plugin. The plugin consists of a single php file (kreplach.php) and a composer.json:</p>
  
  <h1>kreplach.php</h1>
  
  <pre><code>&lt;?php
      /*
      Plugin Name: kreplach
      Plugin URI: http://gitlab.example.com/sales/kreplach
      Description: just a test
      Author: Foo Bartok
      Version: 1.0
      Author URI: http://example.com
      */
  ?&gt;
  </code></pre>
  
  <h1>composer.json</h1>
  
  <pre><code>{
      "license": "MIT",
      "name": "sales/kreplach",
      "type": "wordpress-plugin",
      "description": "just a test",
      "authors": [
          {
              "name": "Foo Bartok",
              "email": "foo@example.com",
              "homepage": "example.com"
          }
      ],
      "require": {
          "composer/installers": "*"
      }
  }
  </code></pre>
  
  <p>On my dev server I have the following composer.json</p>
  
  <h1>Server's composer.json</h1>
  
  <pre><code>{
      "repositories": [
          {
              "type": "composer",
              "url": "https://wpackagist.org"
          },
          {
              "type": "vcs",
              "url": "git@gitlab.example.com:sales/kreplach.git"
          }
      ],
      "require": {
          "php": "&gt;=5.4",
          "wpackagist-plugin/akismet": "*",
          "wpackagist-plugin/contact-form-7": "*",
          "wpackagist-plugin/wordpress-importer": "*",
          "sales/kreplach": "master",
          "johnpbloch/wordpress": "4.*",
          "composer/installers": "*"
      },
      "extra": {
          "wordpress-install-dir": "wp"
      }
  }
  </code></pre>
  
  <h2>What I think SHOULD happen:</h2>
  
  <ol>
  <li>Composer looks through the git repo for composer.json</li>
  <li>Composer matches the name "sales/kreplach" found in the build host's composer.json</li>
  <li>Composer copies the contents of the master branch into <code>wp-content/plugins/kreplach</code> on my build host.</li>
  <li>My fake plug-in does nothing, as designed.</li>
  </ol>
  
  <h2>What actually happens:</h2>
  
  <p>Bitter, bitter failure.</p>
  
  <pre><code>Loading composer repositories with package information Updating dependencies (including require-dev)
  Your requirements could not be resolved to an installable set of packages.
  
    Problem 1
      - The requested package sales/kreplach could not be found in any version, there may be a typo in the package name.
  
  Potential causes:
   - A typo in the package name
   - The package is not available in a stable-enough version according to your minimum-stability setting
       see &lt;https://getcomposer.org/doc/04-schema.md#minimum-stability&gt; for more details.
  
  Read &lt;https://getcomposer.org/doc/articles/troubleshooting.md&gt; for further common problems.
  </code></pre>
  
  <p>I have tested cloning the <code>sales/kreplach</code> repo onto the same host I'm attempting to install the plugin on.</p>
  
  <p>To make sure that composer is actually reading the composer.json file from the git repo, I introduced a typo (yeah, totally on purpose, like) which threw a "hey, this json file is broken, Foam Head" error. </p>
  
  <p>My version of gitlab is omnibus edition 8.6.4 (installed today).</p>
  
  <p>I have successfully done this same sort of trick with pip/requirements.txt to install custom python modules, so I'm not unused to following directions. Am I missing a step, or some sort of non-obvious (to me at least) nomenclature?</p>