4
votes

I have been having trouble deploying liferay portlets and themes from the command line with ant deploy;

sample execution:

pwd: C:\liferay-plugins-sdk\themes

create.bat deep-blue "Deep Blue"

cd deep-blue-theme

ant deploy

-> Buildfile: C:\liferay-plugins-sdk\themes\deep-blue-theme\build.xml

-> compile:

-> BUILD FAILED

-> C:\liferay-plugins-stk\themes\build-common-theme.xml:172: C:\liferay-plugins-sdk\themes\deep-blue-theme\liferay-portal-6.0.6 omcat-6.0.29webappsROOT\html\themes_unstyled does not exist.

the problem appears to be with the bold section and how the path is obviously incorrect; where is this directory being set?

edit:

the problem was my app.server.dir in build.{username}.properties

3

3 Answers

6
votes

The error is a result of the ant build not being able to find a Liferay installation (which contains items needed by the SDK).

By default, the build properties in the SDK are set up on the assumption that your setup looks like this:

- Your Development Directory
  - bundles
    - data
    - deploy
    - license
    - tomcat-6.0.29
  - liferay-plugins-sdk

Where bundles contains a Liferay bundle distribution, including the bundled Tomcat server.

You can see this setup in the build.properties file at the root level of your SDK.

#
# Specify the paths to an unzipped Tomcat bundle.
#
app.server.type=tomcat
app.server.dir=${project.dir}/../bundles/tomcat-6.0.29
app.server.deploy.dir=${app.server.dir}/webapps
app.server.lib.global.dir=${app.server.dir}/lib/ext
app.server.portal.dir=${app.server.dir}/webapps/ROOT

The recommended way to change this is not to edit this section of build.properties, but to create overriding entries in a new file, called build.username.properties. (where username is your user name on your computer account).

6
votes

As you say in the comment to kirkz's answer, you have already set your build.connor.properties: You obviously have used backslash in there. Here \t is short for the tab character. This explains what you see: ...liferay-portal-6.0.6 omcat... (there's a tab between 6.0.6 and omcat)

Do only use forward-slash in properties files (when you refer to file names, no matter if you're on windows or on any other platforms)

1
votes

I think to solve this issue just for now. To check weather you are getting unsuccessful build or not you can try this solution:

I have just used the static liferay path in this solution.

<elseif>
            <equals arg1="${theme.parent}" arg2="classic" />
            <then>
                <copy todir="docroot" overwrite="true">
                    <fileset
                        dir="C:/Liferay/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/ROOT/html/themes/classic"
                        excludes="_diffs/**,templates/**"
                    />
                </copy>

                <copy todir="docroot/templates" overwrite="true">
                    <fileset
                        dir="C:/Liferay/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/ROOT/html/themes/classic/templates"
                        includes="*.${theme.type}"
                    />
                </copy>
            </then>
        </elseif>

After setting up this code in your build-common-theme.xml file you will NOT get omcat-6.0.29webappsROOT\html\themes_unstyled error at least.