Lifeary ant部署失败

4

我一直在尝试使用ant deploy命令行部署liferay portlets和themes,但是遇到了问题;

示例执行:

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 不存在。

问题似乎出现在加粗的部分以及路径明显不正确;这个目录在哪里设置?

编辑:

问题出在我的build.{username}.properties文件中app.server.dir的设置上。

3个回答

6
根据你在kirkz回答中的评论,你已经设置了build.connor.properties:显然你在其中使用了反斜杠。这里的 \t 是制表符的简写。这就解释了你所看到的: ...liferay-portal-6.0.6 omcat...(6.0.6和omcat之间有一个制表符)。
在属性文件中只使用正斜杠(当引用文件名时,无论你是在Windows还是其他平台)。

啊哇,谢谢,我没有完全弄清楚问题,但是我彻底放弃了我的文件版本,并使用复制粘贴重新开始,结果它起作用了。 - COner

6

这个错误是由于ant构建无法找到Liferay安装文件(其中包含SDK所需的项目)导致的。

默认情况下,SDK中的构建属性假定您的设置如下:

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

这里的bundles包含了Liferay捆绑的Tomcat服务器等Liferay分发版。

你可以在SDK根目录下的build.properties文件中看到这个设置。

#
# 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

更改此设置的推荐方法不是编辑 build.properties 的这一部分,而是在一个新文件中创建覆盖条目,称为 build.username.properties。(其中 username 是您计算机帐户的用户名)。

我最初应该包含我的build.conor.properties文件: app.server.dir=C:\liferay-portal-6.0.6\tomcat-6.0.29auto.deploy.dir=C:\liferay-portal-6.0.6\deployapp.server.lib.portal.dir=C:\liferay-portal-6.0.6\tomcat-6.0.29\webapps\ROOT\WEB-INF\libapp.server.portal.dir=C:\liferay-portal-6.0.6\tomcat-6.0.29\webapps\ROOT - COner

1

我认为暂时解决这个问题的方法是:检查你是否得到了失败的构建,你可以尝试以下解决方案:

在这个解决方案中,我只是使用了静态的 liferay 路径。

<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>

在您的build-common-theme.xml文件中设置此代码后,您将至少不会收到omcat-6.0.29webappsROOT\html\themes_unstyled错误。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接