繁体   English   中英

Liferay 6.2 Maven主题-liferay-look-and-feel.xml呢?

[英]Liferay 6.2 maven theme - what about liferay-look-and-feel.xml?

我使用liferay的Maven原型生成主题,如下所示:

mvn archetype:generate \
-DarchetypeGroupId=com.liferay.maven.archetypes \
-DarchetypeArtifactId=liferay-theme-archetype \
-DarchetypeVersion=6.2.0

在这里看看以供参考。

奇怪的是,此过程没有给我liferay-look-and-feel.xml

现在,由于我是从Liferay 6.0迁移旧主题的,因此我试图复制liferay-look-and-feel.xml ,以适应新环境(beeing 6.2):

<?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 6.2.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_6_2_0.dtd">
<look-and-feel>
    <compatibility>
        <version>6.2.0+</version>
    </compatibility>
    <theme id="test-theme" name="Test Theme" />
</look-and-feel>

但是, mvn package似乎根本不喜欢此文件:

$ mvn package -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-theme Theme 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- liferay-maven-plugin:6.2.0-RC5:theme-merge (default) @ test-theme ---
[INFO] Parent theme group ID com.liferay.portal
[INFO] Parent theme artifact ID portal-web
[INFO] Parent theme version 6.2.10-GA1
[INFO] Parent theme ID _styled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.803s
[INFO] Finished at: Tue Feb 18 11:02:32 CET 2014
[INFO] Final Memory: 7M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.2.0-RC5:theme-merge (default) on project test-theme: www.liferay.com Nested exception: www.liferay.com -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.2.0-RC5:theme-merge (default) on project test-theme: www.liferay.com Nested exception: www.liferay.com
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: www.liferay.com Nested exception: www.liferay.com
        at com.liferay.maven.plugins.AbstractLiferayMojo.execute(AbstractLiferayMojo.java:82)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
Caused by: org.dom4j.DocumentException: www.liferay.com Nested exception: www.liferay.com
        at org.dom4j.io.SAXReader.read(SAXReader.java:484)
        at org.dom4j.io.SAXReader.read(SAXReader.java:264)
        at com.liferay.maven.plugins.util.SAXReaderUtil.read(SAXReaderUtil.java:30)
        at com.liferay.maven.plugins.ThemeMergeMojo.doExecute(ThemeMergeMojo.java:141)
        at com.liferay.maven.plugins.AbstractLiferayMojo.execute(AbstractLiferayMojo.java:75)
        ... 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

删除liferay-look-and-feel.xml会得到我想要的结果,所以我问您:如果该文件是必需的并有文档记录 ,那么liferay maven插件为什么会出现问题?

您需要在pom.xml中添加以下条目。

<properties>
    <liferay.theme.parent>classic</liferay.theme.parent>
    <liferay.theme.type>vm</liferay.theme.type>
</properties>

您可以根据需要将父主题设置为_styled,_unstyled或classic。

在liferay-look-and-feel.xml中,我们指定themeId,version等。使用maven开发插件时,我们必须在pom.xml中指定这些值。 因此,不需要liferay-look-and-feel.xml

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM