Module version in composer.json












0















I'm running the static tests on one of my modules and on magento version 2.3 it reports an inconsistency:




Version must not be specified in the root and package composer JSON files in Git
Failed asserting that object of class "stdClass" does not have attribute "version".




This does not happen for magento 2.2.

After some digging around I found that there is this test MagentoTestIntegrityComposerTest::assertNoVersionSpecified()



/**
* Version must not be specified in the root and package composer JSON files in Git.
*
* All versions are added by tools during release publication by version setter tool.
*
* @param StdClass $json
*/
private function assertNoVersionSpecified(StdClass $json)
{
$errorMessage = 'Version must not be specified in the root and package composer JSON files in Git';
$this->assertObjectNotHasAttribute('version', $json, $errorMessage);
}


On the other hand, the official docs state that the version should be specified in composer.json: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/versioning/



I need a confirmation that the composer.json should not contain the module version anymore.

In case the answer is Yes for the question above, I could use an explanation on how does magento know the version of the modules installed via composer if the version is missing from composer.json.










share|improve this question



























    0















    I'm running the static tests on one of my modules and on magento version 2.3 it reports an inconsistency:




    Version must not be specified in the root and package composer JSON files in Git
    Failed asserting that object of class "stdClass" does not have attribute "version".




    This does not happen for magento 2.2.

    After some digging around I found that there is this test MagentoTestIntegrityComposerTest::assertNoVersionSpecified()



    /**
    * Version must not be specified in the root and package composer JSON files in Git.
    *
    * All versions are added by tools during release publication by version setter tool.
    *
    * @param StdClass $json
    */
    private function assertNoVersionSpecified(StdClass $json)
    {
    $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git';
    $this->assertObjectNotHasAttribute('version', $json, $errorMessage);
    }


    On the other hand, the official docs state that the version should be specified in composer.json: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/versioning/



    I need a confirmation that the composer.json should not contain the module version anymore.

    In case the answer is Yes for the question above, I could use an explanation on how does magento know the version of the modules installed via composer if the version is missing from composer.json.










    share|improve this question

























      0












      0








      0








      I'm running the static tests on one of my modules and on magento version 2.3 it reports an inconsistency:




      Version must not be specified in the root and package composer JSON files in Git
      Failed asserting that object of class "stdClass" does not have attribute "version".




      This does not happen for magento 2.2.

      After some digging around I found that there is this test MagentoTestIntegrityComposerTest::assertNoVersionSpecified()



      /**
      * Version must not be specified in the root and package composer JSON files in Git.
      *
      * All versions are added by tools during release publication by version setter tool.
      *
      * @param StdClass $json
      */
      private function assertNoVersionSpecified(StdClass $json)
      {
      $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git';
      $this->assertObjectNotHasAttribute('version', $json, $errorMessage);
      }


      On the other hand, the official docs state that the version should be specified in composer.json: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/versioning/



      I need a confirmation that the composer.json should not contain the module version anymore.

      In case the answer is Yes for the question above, I could use an explanation on how does magento know the version of the modules installed via composer if the version is missing from composer.json.










      share|improve this question














      I'm running the static tests on one of my modules and on magento version 2.3 it reports an inconsistency:




      Version must not be specified in the root and package composer JSON files in Git
      Failed asserting that object of class "stdClass" does not have attribute "version".




      This does not happen for magento 2.2.

      After some digging around I found that there is this test MagentoTestIntegrityComposerTest::assertNoVersionSpecified()



      /**
      * Version must not be specified in the root and package composer JSON files in Git.
      *
      * All versions are added by tools during release publication by version setter tool.
      *
      * @param StdClass $json
      */
      private function assertNoVersionSpecified(StdClass $json)
      {
      $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git';
      $this->assertObjectNotHasAttribute('version', $json, $errorMessage);
      }


      On the other hand, the official docs state that the version should be specified in composer.json: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/versioning/



      I need a confirmation that the composer.json should not contain the module version anymore.

      In case the answer is Yes for the question above, I could use an explanation on how does magento know the version of the modules installed via composer if the version is missing from composer.json.







      magento2.2 composer magento2.3 semantic-versioning






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      MariusMarius

      164k28312663




      164k28312663






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257681%2fmodule-version-in-composer-json%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257681%2fmodule-version-in-composer-json%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          An IMO inspired problem

          Management

          Has there ever been an instance of an active nuclear power plant within or near a war zone?