Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-67794

Liferay Portal cannot be built from source when path to source location contains spaces

    Details

    • Branch Version/s:
      7.0.x
    • Backported to Branch:
      Committed

      Description

      {markdown}
      Steps to reproduce:

      1. Create a directory with spaces in the name:

      mkdir ~/tmp/liferay\ source

      2. Navigate into the directory:

      cd ~/tmp/liferay source

      3. Clone the Liferay Portal source:

      git clone https://github.com/liferay/liferay-portal.git --depth 1

      4. Navigate to the portal source directory:

      cd liferay-portal

      5. Create your *`app.server.${yourname}.properties`* file:

      echo "app.server.parent.dir=$HOME/tmp/portals/liferay-portal" > \
      "app.server.$(whoami).properties"

      6. Build the portal:

      ant clean all

      If the bug still exists, the portal will fail to build, and the following error will appear in the console:{markdown}
      [propertyfile] Updating property file: /Users/kylestiemann/tmp/liferay source/liferay-portal/tools/sdk/build.${env.COMPUTERNAME}.properties
           [copy] Copying 1 file to /Users/kylestiemann/tmp/liferay source/liferay-portal/tools/sdk
           [copy] Copying 1 file to /Users/kylestiemann/tmp/liferay source/liferay-portal/tools/sdk
         [delete] Deleting: /Users/kylestiemann/tmp/liferay source/liferay-portal/.gradle/gradle.properties
      [propertyfile] Updating property file: /Users/kylestiemann/tmp/liferay source/liferay-portal/.gradle/gradle.properties
           [exec] Error: Could not find or load main class source.liferay-portal..gradle
      
      BUILD FAILED
      /Users/kylestiemann/tmp/liferay source/liferay-portal/build.xml:34: The following error occurred while executing this line:
      /Users/kylestiemann/tmp/liferay source/liferay-portal/build-common.xml:1038: The following error occurred while executing this line:
      /Users/kylestiemann/tmp/liferay source/liferay-portal/build-common.xml:647: exec returned: 1
      
      {markdown}
      If the bug is fixed the portal will build correctly, and the built bundle will appear in the *`~/tmp/portals/liferay-portal`* directory.

      In order to workaround this issue, make sure none of the directory names in the path to the portal source contain spaces. For example, changing *`liferay source/`* to *`liferay-source/`* in the above "Steps to reproduce", will fix the issue.

      This issue was first reported in the comments on my blog: https://web.liferay.com/web/kyle.stiemann/blog/-/blogs/how-can-i-build-liferay-7-0-from-source-{markdown}

        Attachments

          Activity

            People

            Assignee:
            andrea.digiorgi Andrea Di Giorgi (Inactive)
            Reporter:
            kyle.stiemann Kyle Stiemann (Inactive)
            Participants of an Issue:
            Recent user:
            Michael Saechang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              5 years, 9 weeks, 5 days ago

                Packages

                Version Package
                7.0.X EE
                Master