Uploaded image for project: 'PUBLIC - Liferay Maven'
  1. PUBLIC - Liferay Maven
  2. MAVEN-88

liferay:build-css fails when portal.poperties is in the themes classpath / resources folder

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.2.0 GA1, 6.1.30 EE GA3
    • Fix Version/s: 6.2.0 GA1
    • Component/s: Plugins
    • Labels:
      None

      Description

      When using the 6.2.0-M6 plugin version to build a theme for 6.1.1, liferay:build-css fails when the theme contains a portal.properties file.

      Caused by: java.lang.ExceptionInInitializerError
              at com.liferay.portal.util.PortalImpl.<clinit>(PortalImpl.java:6345)
              at com.liferay.portal.tools.SassToCssBuilder._initUtil(SassToCssBuilder.java:165)
              at com.liferay.portal.tools.SassToCssBuilder.<init>(SassToCssBuilder.java:117)
              at com.liferay.portal.tools.SassToCssBuilder.main(SassToCssBuilder.java:88)
              ... 28 more
      Caused by: java.lang.NullPointerException
              at com.liferay.portal.util.PropsValues.<clinit>(PropsValues.java:1239)
              ... 32 more
      

      I believe the wrong portal.properties is used.

      Using getToolsClassLoader() instead of getProjectClassLoader() in SassToCssBuilder seems to fix the issue.

      see https://github.com/schup/liferay-maven-support/commit/aac1e66f989e06d200ced480991db599ae0334f0

      An example theme is attached.

      mvn archetype:generate  -Pliferay611-patched -DarchetypeGroupId=com.liferay.maven.archetypes -DarchetypeArtifactId=liferay-theme-archetype -DarchetypeVersion=6.2.0-M6 -DgroupId=net.schup.lr.theme -DartifactId=61-test-theme -Dversion=1.0.0-SNAPSHOT
      

      ... add the portal properties (src/main/resources)
      run

      mvn -X -P liferay611-patched  clean install liferay:build-css
      

      liferay.maven.plugin.version is specified in the pom.xml as 6.2.0-M6

        <profile>
                  <id>liferay611-patched</id>
                  <activation>
                      <activeByDefault>false</activeByDefault>
                  </activation>
                  <properties>
      
                      <appserver.id>tomcat7x</appserver.id>
                      <tomcat.version>7.0.40</tomcat.version>
                      <liferay.version>6.1.1</liferay.version>
      
                      <liferay.home>\\liveraydev\opt\liferay-portal-6.1.1-patched</liferay.home>
                      <appserver.home>${liferay.home}\tomcat-${tomcat.version}</appserver.home>
      
                      <maven.tomcat.home>${appserver.home}</maven.tomcat.home>
                      <liferay.webapps.dir>${appserver.home}/webapps</liferay.webapps.dir>
                      <liferay.auto.deploy.dir>${liferay.home}/deploy</liferay.auto.deploy.dir>
                      <liferay.app.server.deploy.dir>${liferay.home}/deploy</liferay.app.server.deploy.dir>
                      <liferay.app.server.lib.global.dir>${appserver.home}/lib/ext</liferay.app.server.lib.global.dir>
                      <liferay.app.server.portal.dir>${liferay.webapps.dir}/ROOT</liferay.app.server.portal.dir>
                      <liferay.app.server.lib.portal.dir>${liferay.app.server.portal.dir}/WEB-INF/lib</liferay.app.server.lib.portal.dir>
      
                  </properties>
              </profile>
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 18 weeks, 1 day ago

                Packages

                Version Package
                6.2.0 GA1