Foros de discusión

Liferay 6 theme using Liferay maven theme archetype.

thumbnail
Baptiste Grenier, modificado hace 13 años.

Liferay 6 theme using Liferay maven theme archetype.

Regular Member Mensajes: 100 Fecha de incorporación: 30/06/09 Mensajes recientes
Hi,
I am creating a theme using the liferay maven theme archetype, but I am not sure that I use it exactly as I should.
Using the SDK Plugins it was required to make the changes into a _diffs dir but using maven it seems that I have to copy the modified files directly to src/main/webapp/.
Then I run
mvn clean liferay:theme-merge package liferay:deploy
to generate and deploy the theme.
Is it the way to go? If not how should exactly the maven theme archetype be used?
jonathan doklovic, modificado hace 13 años.

RE: Liferay 6 theme using Liferay maven theme archetype.

Junior Member Mensajes: 25 Fecha de incorporación: 13/04/10 Mensajes recientes
I just did this myself.

Essentially you're on the right track... run merge-theme and then copy everything in your _diffs folder to the webapp folder.

I don't know if it's the "right" way, but the maven tools provided fall pretty short as far as doing things "the maven way".

Here's what I do in my pom:


<build>
        <plugins>
            <plugin>
                <groupid>com.liferay.maven.plugins</groupid>
                <artifactid>liferay-maven-plugin</artifactid>
                <configuration>
                    <liferayversion>${liferay.version}</liferayversion>
                    <autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
                </configuration>
                <executions>
                    <execution>
                        <id>deploy-plugin</id>
                        <phase>install</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>merge-theme</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>theme-merge</goal>
                        </goals>
                        <configuration>
                            <liferayversion>${liferay.version}</liferayversion>
                            <parenttheme>classic</parenttheme>
                            <webappdirectory>${basedir}/src/main/webapp/</webappdirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactid>maven-resources-plugin</artifactid>
                <executions>
                    <execution>
                        <id>copy-diffs</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputdirectory>${basedir}/src/main/webapp/</outputdirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/src/main/webapp/_diffs/</directory>
                                    <filtering>false</filtering>
                                    <includes>
                                        <include>**/*</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
thumbnail
Baptiste Grenier, modificado hace 13 años.

RE: Liferay 6 theme using Liferay maven theme archetype.

Regular Member Mensajes: 100 Fecha de incorporación: 30/06/09 Mensajes recientes
Hi,
Thanks for your answer, but what is the interest of having the _diffs folder?

I just put directly the files into src/main/webapp/ and I do not need to copy them explicitly.
jonathan doklovic, modificado hace 13 años.

RE: Liferay 6 theme using Liferay maven theme archetype.

Junior Member Mensajes: 25 Fecha de incorporación: 13/04/10 Mensajes recientes
Right, I was just following the way Liferay SDK does it.

In fact though, I've switched to doing the following:

1. choose a theme to start with.
2. copy all of it's content to src/main/webapp
3. edit as needed.

No extra gaols in my pom, and no need to copy anything around.
thumbnail
Baptiste Grenier, modificado hace 13 años.

RE: Liferay 6 theme using Liferay maven theme archetype.

Regular Member Mensajes: 100 Fecha de incorporación: 30/06/09 Mensajes recientes
So we are almost doing the same: I just copy the files that I want to modify to src/main/webapp and all the unmodified files are added during the theme merge.
Juraj Lonc, modificado hace 12 años.

RE: Liferay 6 theme using Liferay maven theme archetype.

New Member Mensajes: 9 Fecha de incorporación: 3/12/11 Mensajes recientes
A little bit old thread but I have to comment (for future generations emoticon )

Yes, you are doing it correctly. It is a good idea to copy ONLY the files you want to modify.
It is much easier then to update parent theme (because someone something fixed in parent theme or so).