0
votes

We are working on building an Angular application and hosting it on Liferay. I have started example Liferay portals to go. So far I have developed a Liferay portlet using Maven. I was able to build a war for it and deployed it manually by copying the war file to portal/deploy directory. Similarly, when a portlet is built using Ant, once its built, its automatically deployed in the Liferay portal.

Is there a way to auto-deploy the maven built portlet, rather than copying the war file every time? If there is a way, what setting have to be changed in the pom file?

Edit:

By adding the following to pom file auto-deploy the portlet?

<build> <plugins> <plugin> <groupId>com.liferay.maven.plugins</groupId> <artifactId>liferay-maven-plugin</artifactId> <version>${liferay.maven.plugin.version}</version> <configuration> <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir> <appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir> <appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir> <appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir> <liferayVersion>${liferay.version}</liferayVersion> <pluginType>portlet</pluginType> </configuration> <executions> <execution> <id>maven-deploy</id> <phase>install</phase> <goals> <goal>deploy</goal> </goals> </execution> </executions> </plugin> </plugins> </build>

2

2 Answers

1
votes

You could use mvn clean install liferay:deploy in maven, and it will be deployed to your Liferay server.

0
votes

Assuming you are using eclipse you can install and use the liferay sdk plugin which provides a set of options for build, the most important is

1.deploy- copys war file to deploy dir

2.direct-deploy copys all files to their locations (jar's,jsp,classes and other static content)