在 shopware store 上传插件(插件的基本 composer.json 文件不在预期的文件夹中)

upload plugin in shopware store(The essential composer.json file for the plugin was not in the expected folder)

我想在 Shopware 商店上传一个插件 上传并定义要求归档后,当我尝试提交我的插件进行代码审查时,我收到了一个错误

Basic plugin analysis failed.
The required composer.json file was not found
Context: [
 • reason: The essential composer.json file for the plugin was not in the expected folder
]
Documentation: https://docs.shopware.com/en/shopware-platform-dev-en/references-internals/plugins/plugin-base-class?category=shopware-platform-dev-en/references-internals/plugins

我用谷歌搜索这个错误并找到了这个问题https://forum.shopware.com/discussion/69413/json-composer-file-nicht-gefunden-beim-upload-in-den-community-store

我在 Shopware 面板中的技术名称是:

xxx46AKGoogleMapPlugin

而我的composer.json是

.
"name": "aks/google-map-plugin",
.
.
"license": "proprietary",
  "autoload": {
      "psr-4": {
        "Aks\GoogleMapPlugin\": "src/"
      }
  },
  "require": {
        "shopware/core": "6.*",
        "shopware/storefront": "6.*",
        "shopware/administration": "6.*"
  },
  "extra": {
        "shopware-plugin-class": "Aks\GoogleMapPlugin\AKGoogleMapPlugin",
.
.
.

这是我的基础 class 插件。我在需要的地方使用了 Aks\GoogleMapPlugin 命名空间

<?php declare(strict_types=1);

namespace Aks\GoogleMapPlugin;
.
.
.
class AKGoogleMapPlugin extends Plugin
{
.

。 .

我哪里错了?我的文件夹名称是 AKGoogleMapPlugin,我在 Ubuntu 中创建了 zip 文件(AKGoogleMapPlugin->composer.json,AKGoogleMapPlugin->src->AKGoogleMapPlugin.php)

如果您的技术名称是 xxx46AKGoogleMapPlugin,那么您的 shopware 插件 class 和文件夹应该完全这样命名。

您还应该考虑使用您的供应商前缀 xxx46AK 作为您的 composer 命名空间的一部分,这样您的命名空间是唯一的。

请参考这些指南:https://docs.shopware.com/en/plugin-standard-for-community-store#the-required-composer-json-file-was-not-found