0
votes

In my composer setup I load packages from 2 repos. One composer repo and a private gitlab repo. When I try to do a composer install on my local windows machine, I get the following error messages:

GitLab: The project you were looking for could not be found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ... The requested package sv-test/testextension could not be found in any version, there may be a typo in the package name.

Authentification is done via lokal ssh-key and password, that doesnt seem to be the problem. Whats wrong with my setup?

The composer.json of the project looks like this:

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://composer.typo3.org/"
        },
        {
            "type": "git",
            "url": "[email protected]:sv-test/Testproject.git"
        }
    ],
    "name": "svdev/master-dev-box",
    "description": "",
    "type": "project",
    "license": "MIT",
    "homepage": "https://www.xydevbox.de/",
    "authors": [
        {
            "name": "Sacha Vorbeck",
            "email": "[email protected]",
            "homepage": "https://www.xydevbox.de/",
            "role": "Developer"
        }
    ],
    "require": {
        "sv-testbox/testextension": "*",
        "helhum/typo3-console": "^4.5",
        "typo3/cms": "^8.7"
    },
    "config": {
        "sort-packages": true,
        "process-timeout": 2000,
        "preferred-install": {
            "typo3/cms": "source",
            "*": "dist"
        }
    },
    "extra": {
        "typo3/cms": {
            "cms-package-dir": "{$vendor-dir}/typo3/cms",
            "web-dir": "web"
        }
    }
}

The composer.json from the package to be included from the gitlab private repo looks like this:

{
  "name": "sv-testbox/testextension",
  "type": "typo3-cms-extension",
  "description": "",
  "homepage": "https://www.xydevbox.de/",
  "license": ["GPL-2.0+"],
  "keywords": ["TYPO3 CMS"],
  "version": "master",
  "dist": {
    "url": "[email protected]:sv-test/Testproject.git",
    "type": "git"
  }
}
2
If stackoverflow.com/questions/34781422/… won't help, perhaps require a version "*@dev" in order to allow for "whatever version, not only stable"NextThursday

2 Answers

1
votes

Maybe the latest composer version 1.5.2 is something for you if you take a look at the release notes

  • Fixed GitLabDriver looping endlessly in some conditions
  • Fixed GitLabDriver support for unauthenticated requests
  • Fixed GitLab zip downloads not triggering credentials prompt if unauthenticated
  • Fixed path repository support of COMPOSER_ROOT_VERSION, it now applies to all path repos within the same git repository
  • Fixed path repository handling of copies to avoid copying VCS files and others
  • Fixed sub-directory call to ignore list and create-project commands as well as calls to Composer using --working-dir
  • Fixed invalid warning appearing when calling remove on an non-stable package

https://github.com/composer/composer/releases

0
votes

Thank you Georg and NextThursday. With some help on TYPO3 slack I finally got it running. The replace part was missing. I also learned that one should not edit composer.json files manually - always use the command line options to modify it. This example: https://github.com/TYPO3-Console/TYPO3-Console/blob/master/composer.json was also helpful.

project composer.json:

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://composer.typo3.org/"
        },
        {
            "type": "vcs",
            "url": "https://github.com/svorbeck/masterconfig"
        }
    ],
    "name": "svorbeck/demo",
    "description": "",
    "type": "project",
    "license": "MIT",
    "homepage": "https://xydevbox.de/",
    "authors": [
        {
            "name": "Sacha Vorbeck",
            "email": "[email protected]",
            "role": "Developer"
        }
    ],
    "require": {
        "svorbeck/masterconfig": "dev-master",
        "typo3/cms": "^8.7"
    },
    "config": {
        "sort-packages": true,
        "process-timeout": 2000,
        "preferred-install": {
            "typo3/cms": "source",
            "svorbeck/masterconfig": "source",
            "*": "dist"
        }
    },
    "extra": {
        "typo3/cms": {
            "cms-package-dir": "{$vendor-dir}/typo3/cms",
            "web-dir": "web"
        },
        "helhum/typo3-console": {
            "install-extension-dummy": "0"
        }
    }
}

ext composer.json:

{
    "name": "svorbeck/masterconfig",
    "type": "typo3-cms-extension",
    "description": "svorbeck master configuration",
    "require": {
        "typo3/cms-core": "^8.7"
    },
    "replace": {
        "masterconfig": "self.version",
        "svorbeck/masterconfig": "self.version"
    }
}