This is excerpt from my composer.json file (trimmed for readability). It was created by running composer create-project drupal/drupal my_site_name 8.0.*
as described on drupal.org:
{
"name": "drupal/drupal",
"type": "project",
"require": {
"composer/installers": "^1.0.21",
"wikimedia/composer-merge-plugin": "^1.3.0"
},
"replace": {
"drupal/core": "~8.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"merge-plugin": {
"include": [
"core/composer.json"
],
"recurse": false,
"replace": false,
"merge-extra": false
}
}
}
- If I just do
composer update
- core is not updated, only packages insidevendor
dir. - If in addition to the above, I update my
composer.json
file and replace core version with~8.1
- still core not affected.
The only thing that worked for me was to:
- Remove
core
dir,vendor
andcomposer.lock
. - Edit
composer.json
and:- Remove
replace
section. - Add
"drupal/core": "~8.1"
torequire
section.
- Remove
- Run
composer install
.
That worked however every installed package complained that:
Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script
So I'm not sure if the whole process completed flawlessly. Also removing core
directory seems like a desperate move.
What is the recommended procedure of updating core to the next minor version with composer (for example 8.0 => 8.1)? Note that I am not using drupal-composer as suggested in this answer.
Update 1
After trying to use composer require --update-with-dependencies "drupal/core:8.1.*"
I got no results:
$ composer create-project drupal/drupal my_site_name 8.0.*
Installing drupal/drupal (8.0.6)
- Installing drupal/drupal (8.0.6)
Cloning c5afca05cde0c94ef4d7aff5b078be27024670d2
Created project in my_site_name
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? Y
$ cd my_site_name/
$ composer require --update-with-dependencies "drupal/core:8.1.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
I'm using composer version 1.1-dev
.