Uploaded image for project: 'PUBLIC - Liferay BLADE'
  1. PUBLIC - Liferay BLADE
  2. BLADE-492

Service builder modules require more dependencies due to LPS-104539 changes

    Details

    • Type: Regression Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: master, 7.1, 7.0, 7.2
    • Fix Version/s: master, 7.1, 7.0, 7.2
    • Component/s: blade-samples
    • Labels:
      None

      Description

      After LPS-104539 changes, service builder modules need some additional dependencies with "Petra IO", in case they have a Blob column.

      Steps to reproduce

      1. Create a Liferay Workspace, for example with blade:
        • blade init
      2. Go to Liferay Workspace root folder and add following line to gradle.properties file:
        com.liferay.portal.tools.service.builder.version=xxx
      3. Create a service builder module
        • blade create test -t service-builder
      4. Configure the service builder entity with following modules/test/test-service/service.xml
        <service-builder  package-path="test">
            <namespace>FOO</namespace>
            <entity local-service="true" name="TestBlob" remote-service="false" uuid="false" cache-enabled="false">
                <column name="myKey" type="String" primary="true"></column>
                <column name="myBlob" type="Blob"></column>
            </entity>
        </service-builder>
      5. Edit test/test-api/bnd.bnd file and remove the -check: EXPORTS line to avoid some warnings.
      6. Execute blade gw buildService
      7. Execute blade gw jar
        • Expected behavior: generated service builder files are correctly compiled
        • Wrong behavior: generated service builder files don't compile
          [email protected] MINGW64 /c/Temp/BLADE-492/71/modules/test/test-service
          $ blade gw jar
          
          > Task :modules:test:test-service:compileJava
          C:\Temp\BLADE-492\71\modules\test\test-service\src\main\java\test\service\base\TestBlobLocalServiceBaseImpl.java:17: error: package com.liferay.petra.io does not exist
          import com.liferay.petra.io.AutoDeleteFileInputStream;
                                     ^
          C:\Temp\BLADE-492\71\modules\test\test-service\src\main\java\test\service\base\TestBlobLocalServiceBaseImpl.java:494: error: cannot find symbol
                                          inputStream = new AutoDeleteFileInputStream(
                                                            ^
            symbol:   class AutoDeleteFileInputStream
            location: class TestBlobLocalServiceBaseImpl
          Note: Some input files use unchecked or unsafe operations.
          Note: Recompile with -Xlint:unchecked for details.
          2 errors
          
          > Task :modules:test:test-service:compileJava FAILED
          
          FAILURE: Build failed with an exception.
          
          * What went wrong:
          Execution failed for task ':modules:test:test-service:compileJava'.
          > Compilation failed; see the compiler error output for details.
          
          * Try:
          Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
          
          * Get more help at https://help.gradle.org
          
          BUILD FAILED in 4s
          3 actionable tasks: 1 executed, 2 up-to-date

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lawrence.lee Lawrence Lee
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  master
                  7.1
                  7.0
                  7.2