Question

In Magento 1.x we are creating Extension Package from System -> Magento Connect -> Package Extensions. After that we are going to publish the extension in Magento Connect.

I think it's an easy to understand and easy to create and publish.

In Magento 2.x how to create like above and publish the extension to MarketPlace (Magento Connect).

Could you please suggest me how to do it?

Was it helpful?

Solution

Let's say you have developped a module under app/code/Vendor/Module, here is the procedure you have to follow:

Create a composer file

Go to app/code/Vendor/Module and create the following composer.json file:

{
  "name": "vendor/module",
  "description": "Description of your Magento 2 module",
  "type": "magento2-module",
  "version": "0.1.0",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/framework": "~100.0.4"
  },
  "authors": [
    {
      "name": "Firstname Lastname",
      "email": "email@address.com",
      "homepage": "https://www.store.com/",
      "role": "Developer"
    }
  ],
  "autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "Vendor\\Module\\": ""
    }
  }
}

Zip the package

Using command line do the following:

cd /path/to/app/code/Vendor/Module
zip -r vendor_module-0.1.0.zip ./*

N.B.: this example is assuming that your module version (declared under app/code/Vendor/Module/etc/module.xml is 0.1.0, please change the version in both the composer.json and in the command that zips the package to match your version.

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top