sonatype-nexus-community / nexus-repository-composer

Composer support for the Nexus Repository Manager (work in progress!)
Eclipse Public License 1.0
210 stars 82 forks source link

Virtual package support #19

Open AleksSem opened 6 years ago

AleksSem commented 6 years ago

I`m trying ti install "geocoder-php/common-http": "4.0.0" through composer proxy.

I got an error:

Problem 1

  • Installation request for geocoder-php/common-http 4.0.0 -> satisfiable by geocoder-php/common-http[4.0.0].
  • geocoder-php/common-http 4.0.0 requires psr/http-message-implementation ^1.0 -> no matching package found.

After this error i`m trying to add "guzzlehttp/psr7" which implements Virutal package "psr/http-message-implementation" but error stays.

Everything works fine with original http://packagist.org

Can you please help to solve this issue or provide some fix for nexus composer?

Thank you.

fjmilens3 commented 6 years ago

I'm not sure when I'll have time to look at this, but I can take a look as time permits. Two questions:

  1. Are you accessing Composer proxy through a group?
  2. Can you provide a (minimal) composer.json that displays this behavior so we can use it during our testing?
jonasGossiaux commented 5 years ago

bump

tiaguinho commented 4 years ago

The package "nexmo/client": 1.8.1 returns the following error:

  Problem 1
    - nexmo/client 1.8.1 requires php-http/client-implementation ^1.0 -> no matching package found.
    - nexmo/client 1.8.0 requires php-http/client-implementation ^1.0 -> no matching package found.
AleksSem commented 4 years ago

The package "nexmo/client": 1.8.1 returns the following error:

  Problem 1
    - nexmo/client 1.8.1 requires php-http/client-implementation ^1.0 -> no matching package found.
    - nexmo/client 1.8.0 requires php-http/client-implementation ^1.0 -> no matching package found.

I find ugly hack for this issue: You can add to your composer.json (that means your project provides implementation), but be careful because composer stops handle this dependency.

"provide": {
  "php-http/client-implementation": "^1.0"
},
tiaguinho commented 4 years ago

Works!

Thanks @AleksSem !

theravel commented 4 years ago

This bug makes usage of this project completely impossible, it has critical priority

theravel commented 4 years ago

I'm not sure when I'll have time to look at this, but I can take a look as time permits. Two questions:

  1. Are you accessing Composer proxy through a group?
  2. Can you provide a (minimal) composer.json that displays this behavior so we can use it during our testing?

@fjmilens3 this is an example:

{
    "require": {
        "sentry/sentry-symfony": "^3.4"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://artifacts.company.org/repository/composer-group"
        },
        {
            "packagist.org": false
        }
    ]
}
DKarakis commented 4 years ago

hey @theravel just add this under the autoload-dev to get sentry working.


  "provide": {
        "php-http/client-implementation": "1.0",
        "php-http/async-client-implementation": "1.0",
        "psr/http-client-implementation": "1.0",
    "psr/http-message-implementation": "1.0"
      }, 
XilefNori commented 4 years ago

It would be very nice if you will fix this bug. Please.

FloSew commented 4 years ago

It will be greatly appreciated to fix this please !

eplightning commented 4 years ago

I need to do more research but this seems to be some kind of composer bug actually. Nexus doesn't strip "provide" metadata from packages it hosts, but for some reason composer completely ignores it.

EDIT: Well nvm, composer has it implemented very weird but the issue is on the Nexus side of things.

func0der commented 3 years ago

Do we have an update on this issue?

j3ouz4n commented 3 years ago

Hi, we have a similar issue with our nexus :