Pergunta

I use liferay's maven archetypes to generate a theme just like this:

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

Take a look here for reference.

What's odd, this process does not give me liferay-look-and-feel.xml.

Now since I'm migrating an old theme from Liferay 6.0, I was trying to copy over liferay-look-and-feel.xml, adopting to the new environment (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>

However, mvn package does not seem to like this file at all:

$ 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

Removing liferay-look-and-feel.xml will give me the results I want, so I ask you: if this file is necessary and documented, then why does the liferay maven plugin have a problem with it?

Foi útil?

Solução

you need to add the following entries in pom.xml.

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

you can give parent theme as _styled,_unstyled or classic depending upon your requirement.

In liferay-look-and-feel.xml we specify themeId , version etc. While plugin development using maven, we have to specify these values in pom.xml. So there is no need of liferay-look-and-feel.xml

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top