spaulg / composer-maven-plugin

Composer maven plugin
1 stars 1 forks source link

Launch a composer update XXX from the plugin #2

Open asicfr opened 7 years ago

asicfr commented 7 years ago

Hello, I use jour maven plugin and i want to force a composer update on one dependency during the build. Is it possible ? Thanks

spaulg commented 7 years ago

Hi,

Not currently. The plugin is purely a simple wrapper that runs the composer.phar file for install or update of all dependencies.

Regards, Simon

dpalic commented 7 years ago

Hi Simon, would appreciate the same feature to have not to mess around with binaries in my repository. Also from perspective of clean software engineering a "download" of composer.phar

So my suggestion would be to have to behaviours:

  1. download latest composer.phar if ommiting <composerPharPath>
  2. if provided <version>1.5.1</version> in <configuration>
    • in case of provided <composerPharPath> verify if the binary is really the expected version
    • in case of no <composerPharPath> download the corresponding composerPhar from website as maven resource

The URLs for the download are pretty simple: https://getcomposer.org/download/ https://getcomposer.org/composer.phar (latest) https://getcomposer.org/download/1.4.3/composer.phar (1.4.3)

So your plugin would be still backward compatible, with minor version check improvement. And you would have a new big feature with a automatic dependency handling which we all enjoy and like from maven. (see also gulp, npm, bower plugins, which do exactly the same behaviour)

I am willing to help to contribute, if you give prior permission, that the feature would be integrated. (of course after your QA)

spaulg commented 7 years ago

Hi @dpalic

The plugin already handles the automatic download of the composer library. Check out AbstractComposerMojo.java, methods runComposer & installComposer. The only aspect of your request it doesn't do is it downloads the latest version only. Admittedly, it could also do with caching the phar file downloaded. Feel free to raise a PR to introduce these features if you wish.

What @asicfr wants to achieve is to install/update individual PHP dependencies that are managed by composer, and not composer itself.

Regards Simon