protected function scanPackages()
    {
        $rootPackage = $this->composer->getPackage();
        if ($rootPackage) {
            $extra = $rootPackage->getExtra();
            foreach ($this->managers as $manager) {
                $var = $manager->getName() . '-asset-library';
                if (isset($extra['asset-installer-paths'][$var])) {
                    $manager->setDestination($extra['asset-installer-paths'][$var]);
                }
            }
        }
        foreach ($this->getPackages() as $package) {
            if ($package instanceof \Composer\Package\CompletePackageInterface) {
                $this->scanAssetDependencies($package);
            }
        }
        foreach ($this->getPackages() as $package) {
            if ($package instanceof \Composer\Package\CompletePackageInterface) {
                foreach ($this->managers as $manager) {
                    $manager->scanPackage($package);
                }
            }
        }
    }