Export to GitHub

nestorurquiza - MavenizingLiferayExtensionImplementationJARFile.wiki


In this tutorial I show how I mavenized the Liferay extension implementation JAR file (ext-impl.jar).

  1. Install necessary dependencies. Below I am showing the local installation. You should have your own company maven repository (Archiva or Artifactory can be used for example). Note that ext-service should be mavenized and make this project depending on it but for now I assumed you built it with ant. cd ~/liferay-components/liferay-portal-ext-5.2.3/modules mvn install:install-file -Dfile=portal-impl.jar -DgroupId=com.liferay -DartifactId=portal-impl -Dversion=5.2.3 -Dpackaging=jar cd ~/liferay-components/liferay-portal-dependencies-5.2.3 mvn install:install-file -Dfile=portal-service.jar -DgroupId=com.liferay -DartifactId=portal-service -Dversion=5.2.3 -Dpackaging=jar cd ~/liferay-components/liferay-portal-dependencies-5.2.3 mvn install:install-file -Dfile=portal-kernel.jar -DgroupId=com.liferay -DartifactId=portal-kernel -Dversion=5.2.3 -Dpackaging=jar cd ~/liferay-components/liferay-portal-ext-5.2.3/ext-service mvn install:install-file -Dfile=ext-service.jar -DgroupId=com.liferay -DartifactId=ext-service -Dversion=5.2.3 -Dpackaging=jar
  2. Mavenize project ``` mkdir ~/mavenized-ext-impl cd ~/mavenized-ext-impl mkdir -p src/main/java mkdir -p src/main/resources mkdir -p src/test/java mkdir -p src/test/resources cp -R ~/liferay-components/liferay-portal-ext-5.2.3/ext-impl/src/META-INF/ src/main/resources cp -R ~/liferay-components/liferay-portal-ext-5.2.3/ext-impl/src/com src/main/java/

    vi pom.xml

http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.nestorurquiza.tutorials mavenized-ext-impl ext-impl 1.0.0-SNAPSHOT javax.servlet servlet-api 2.4 provided javax.servlet.jsp jsp-api 2.1 provided commons-logging commons-logging 1.1.1 provided struts struts 1.2.9 provided javax.portlet portlet-api 2.0 provided com.liferay portal-service 5.2.3 provided com.liferay portal-kernel 5.2.3 provided com.liferay portal-impl 5.2.3 provided com.liferay ext-service 5.2.3 provided ext-impl org.apache.maven.wagon wagon-webdav 1.0-beta-2 maven-compiler-plugin 2.0.2 1.6 1.6 UTF-8 false maven-release-plugin 2.0-beta-7 http://your.repository.domain/path/to/tags scm:svn:http://your.repository.domain/path/to/trunk-or-branch/directory scm:svn:http://your.repository.domain/path/to/trunk-or-branch/directory http://your.repository.domain/path/to/trunk-or-branc/directory 1. See the final result here http://nestorurquiza.googlecode.com/svn/trunk/customizing-liferay/mavenized-ext-impl/ 1. Now you can deploy it to your server like: cp ext-impl.jar ~/glassfishv3/glassfish/domains/liferay-domain/applications/liferay-portal-5.2.3/WEB-INF/lib ``` 1. Of course you will need to restart your server.