SlideShare una empresa de Scribd logo
1 de 5
HowTo: Using Liferay Maven Plugin module with
Liferay Portal 6.2 GA2 -v6.2.1
Liferay Portal plugins can be created, built and packaged for Liferay Portal 6.2 GA2 using the Liferay Maven Plugin module and the Liferay Maven
SDK.
The Liferay Maven Plugin module contains the Maven archetypes for Liferay Portal plugins and the Liferay Portal theme builder.
The Liferay Maven SDK contains the Liferay Portal artefacts (i.e. libraries).
To use the latest Liferay Maven Plugin module, consider one of these approaches:
1. Use Maven Central Repository
Update Maven project definition (POM)
Update Maven settings file with Liferay version and Maven plugin module properties.
If you wish to use <liferay.version>6.2.1</liferay-version> or <liferay-version>6.2.1</liferay-version> you must already have a repository available
and referenced containing these artefacts with the version number as 6.2.1 in your build.username.properties file.
2. Build From Source & Install in Local Repository
Download Liferay Maven packages:
liferay-portal-maven-6.2-ce-ga2-20140326112342532.zip from http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.2.1
%20GA2/
liferay-maven-support-6.2.1.zip from https://github.com/liferay/liferay-maven-support/archive/6.2.1.zip
Extract downloaded zip files
Install liferay portal artifacts to your local ~/.m2 directory
Install liferay-maven-support artifacts to your local ~/.m2 directory
Verify liferay maven artifacts installation in your .m2 directory:
The and folder should be in ~/.m2/repository/com/liferay directory.maven portal
The archetype-catalog.xml should be in ~/.m2 directory.
3. Create Liferay Plugin by Using Maven
Creating liferay plugin (e.g. portlet, theme, layout, hook, web, ext plugins) using liferay-maven-sdk is intended to be as simple as using Liferay
SDK but in addition it does not limits to a specific folder. You can use maven command line or Liferay IDE
3.1 Using Maven Command Line
NOTE: These property names are based on the Liferay Portal plugin project definition (POM) generated using the Liferay Portal plugin
archetypes.
<?xml version="1.0"?>
<project . . . >
<-- other elements removed for clarity -->
<properties>
<-- other properties removed for clarity -->
<liferay-maven-plugin.version>6.2.1</liferay-maven-plugin.version>
<liferay.version>6.2.1</liferay.version>
</properties>
</project>
$>cd /{your_extracted_directory}/liferay-portal-maven-6.2-ce-ga2
$>ant install
$>cd /{your_extracted_directory}/liferay-maven-support-6.2.1
$>mvn clean install
1.
2.
3.
4.
5.
1.
2.
1.
2.
1.
2.
3.
4.
1.
2.
3.
1.
2.
The maven command line below is used to create a liferay plugin:
<liferay-plugin-archetype>: It can be:
liferay-portlet-archetype (Liferay portlet archetype)
liferay-theme-archetype (Liferay theme archetype)
liferay-layouttpl-archetype (Liferay layout archetype)
liferay-hook-archetype (Liferay hook archetype)
liferay-web-archetype (Liferay web archetype)
liferay-ext-archetype (Liferay extension archetype)
liferay-servicebuilder-archetype (Liferay Service Builder archetype)
<your-liferay-plugin-name>: You have to follow the plugin name rules below
Liferay Portlet: The portlet is standard web application with these rules:
It contains liferay-plugin-package.properties
It contains liferay-portlet.xml
It contains liferay-display.xml
It contains portlet.xml
The war file name contains “ ” string-portlet
Liferay Theme: The theme is standard web application with these rules:
It contains liferay-plugin-package.properties
The war file name contains “ ” string-theme
Liferay Layout: The layout is standard web application with these rules:
It contains liferay-plugin-package.properties
The war file name contains “ ” string-layouttpl
Liferay Hook: The hook is standard web application with these rules:
It contains liferay-plugin-package.properties
It contains liferay-hook.xml
The war file name contains “ ” string-hook
The war file name doesn’t contain “-portlet” string
Liferay Web: The web plugin is standard web application with these rules:
It requires web.xml and liferay-plugin-package.properties files.
It contains liferay-plugin-package.properties
The war file name contains “ ” string-web
Liferay Service Builder: The service builder is generated with rules:
Create a project.{domain}-portlet-service
Create a project. This project have dependency with {domain-portlet-service} project.{domain}-portlet
Compile & Deploy Liferay Maven Plugin
Go to sample-portlet directory and run
This will compile any classes and packages the portlet war file in target directory.
To deploy the portlet into your Liferay bundle you can run
3.2 Using Liferay IDE (Eclipse Based)
Note: make sure that you already install Liferay maven local repository.
Step 1: Create Maven Project by using: File -> New -> Maven Project
$> mvn archetype:generate -DarchetypeArtifactId= -DarchetypeGroupId=com.liferay.maven.archetypes<liferay-plugin-archetype>
-DarchetypeVersion=6.2.1 -DartifactId= -DgroupId= -Dversion=1.0-SNAPSHOT<your-liferay-plugin-name> <your-package-name>
$> mvn clean package
$> mvn clean package liferay:deploy
Step 2: Use default value and click on "Next" button
Step 3: Select "Default Local" for Catalog, and select created archetype (e.g: liferay-portlet-archetype)
Step 4: input required information (e.g. group id, artifact id, version, and package,..)
Note: artifact id needs to follow liferay plugin name rules (e.g. the liferay portlet will contain "-portlet" string)
Related articles
HowTo: Using Liferay Maven Plugin module with Liferay Portal 6.2 GA2 -v6.2.1
HowTo: Fix Liferay XML Library Conflict on AMP - WebLogic Platform

Más contenido relacionado

Destacado

Ahlan Ramadan presentation
Ahlan Ramadan presentationAhlan Ramadan presentation
Ahlan Ramadan presentation
bintMahmood
 
Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.
zitamaria
 

Destacado (20)

Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applications
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay way
 
Alfresco P Tardif V1 0 Mars 2009
Alfresco   P Tardif V1 0   Mars 2009Alfresco   P Tardif V1 0   Mars 2009
Alfresco P Tardif V1 0 Mars 2009
 
Web Apps for the Masses
Web Apps for the MassesWeb Apps for the Masses
Web Apps for the Masses
 
สายตาสั้น
สายตาสั้นสายตาสั้น
สายตาสั้น
 
Esalter web-cirilica
Esalter web-cirilicaEsalter web-cirilica
Esalter web-cirilica
 
WordCamp GR 2012 Web Apps for the Masses
WordCamp GR 2012 Web Apps for the MassesWordCamp GR 2012 Web Apps for the Masses
WordCamp GR 2012 Web Apps for the Masses
 
EvalInvStrats_web
EvalInvStrats_webEvalInvStrats_web
EvalInvStrats_web
 
Ahlan Ramadan presentation
Ahlan Ramadan presentationAhlan Ramadan presentation
Ahlan Ramadan presentation
 
สตอก
สตอกสตอก
สตอก
 
สตอก
สตอกสตอก
สตอก
 
Esalter web-latinica
Esalter web-latinicaEsalter web-latinica
Esalter web-latinica
 
Sms obaveštenja - prezentacija
Sms obaveštenja  - prezentacijaSms obaveštenja  - prezentacija
Sms obaveštenja - prezentacija
 
Esalter latinica
Esalter latinicaEsalter latinica
Esalter latinica
 
My presentation
My presentationMy presentation
My presentation
 
Esalter cirilica
Esalter cirilicaEsalter cirilica
Esalter cirilica
 
Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.
 
Esalter web-madjarski
Esalter web-madjarskiEsalter web-madjarski
Esalter web-madjarski
 
Tec1
Tec1Tec1
Tec1
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Using liferay maven plugin with liferay 6.2 ga2 v6.2.1

  • 1. HowTo: Using Liferay Maven Plugin module with Liferay Portal 6.2 GA2 -v6.2.1 Liferay Portal plugins can be created, built and packaged for Liferay Portal 6.2 GA2 using the Liferay Maven Plugin module and the Liferay Maven SDK. The Liferay Maven Plugin module contains the Maven archetypes for Liferay Portal plugins and the Liferay Portal theme builder. The Liferay Maven SDK contains the Liferay Portal artefacts (i.e. libraries). To use the latest Liferay Maven Plugin module, consider one of these approaches: 1. Use Maven Central Repository Update Maven project definition (POM) Update Maven settings file with Liferay version and Maven plugin module properties. If you wish to use <liferay.version>6.2.1</liferay-version> or <liferay-version>6.2.1</liferay-version> you must already have a repository available and referenced containing these artefacts with the version number as 6.2.1 in your build.username.properties file. 2. Build From Source & Install in Local Repository Download Liferay Maven packages: liferay-portal-maven-6.2-ce-ga2-20140326112342532.zip from http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.2.1 %20GA2/ liferay-maven-support-6.2.1.zip from https://github.com/liferay/liferay-maven-support/archive/6.2.1.zip Extract downloaded zip files Install liferay portal artifacts to your local ~/.m2 directory Install liferay-maven-support artifacts to your local ~/.m2 directory Verify liferay maven artifacts installation in your .m2 directory: The and folder should be in ~/.m2/repository/com/liferay directory.maven portal The archetype-catalog.xml should be in ~/.m2 directory. 3. Create Liferay Plugin by Using Maven Creating liferay plugin (e.g. portlet, theme, layout, hook, web, ext plugins) using liferay-maven-sdk is intended to be as simple as using Liferay SDK but in addition it does not limits to a specific folder. You can use maven command line or Liferay IDE 3.1 Using Maven Command Line NOTE: These property names are based on the Liferay Portal plugin project definition (POM) generated using the Liferay Portal plugin archetypes. <?xml version="1.0"?> <project . . . > <-- other elements removed for clarity --> <properties> <-- other properties removed for clarity --> <liferay-maven-plugin.version>6.2.1</liferay-maven-plugin.version> <liferay.version>6.2.1</liferay.version> </properties> </project> $>cd /{your_extracted_directory}/liferay-portal-maven-6.2-ce-ga2 $>ant install $>cd /{your_extracted_directory}/liferay-maven-support-6.2.1 $>mvn clean install
  • 2. 1. 2. 3. 4. 5. 1. 2. 1. 2. 1. 2. 3. 4. 1. 2. 3. 1. 2. The maven command line below is used to create a liferay plugin: <liferay-plugin-archetype>: It can be: liferay-portlet-archetype (Liferay portlet archetype) liferay-theme-archetype (Liferay theme archetype) liferay-layouttpl-archetype (Liferay layout archetype) liferay-hook-archetype (Liferay hook archetype) liferay-web-archetype (Liferay web archetype) liferay-ext-archetype (Liferay extension archetype) liferay-servicebuilder-archetype (Liferay Service Builder archetype) <your-liferay-plugin-name>: You have to follow the plugin name rules below Liferay Portlet: The portlet is standard web application with these rules: It contains liferay-plugin-package.properties It contains liferay-portlet.xml It contains liferay-display.xml It contains portlet.xml The war file name contains “ ” string-portlet Liferay Theme: The theme is standard web application with these rules: It contains liferay-plugin-package.properties The war file name contains “ ” string-theme Liferay Layout: The layout is standard web application with these rules: It contains liferay-plugin-package.properties The war file name contains “ ” string-layouttpl Liferay Hook: The hook is standard web application with these rules: It contains liferay-plugin-package.properties It contains liferay-hook.xml The war file name contains “ ” string-hook The war file name doesn’t contain “-portlet” string Liferay Web: The web plugin is standard web application with these rules: It requires web.xml and liferay-plugin-package.properties files. It contains liferay-plugin-package.properties The war file name contains “ ” string-web Liferay Service Builder: The service builder is generated with rules: Create a project.{domain}-portlet-service Create a project. This project have dependency with {domain-portlet-service} project.{domain}-portlet Compile & Deploy Liferay Maven Plugin Go to sample-portlet directory and run This will compile any classes and packages the portlet war file in target directory. To deploy the portlet into your Liferay bundle you can run 3.2 Using Liferay IDE (Eclipse Based) Note: make sure that you already install Liferay maven local repository. Step 1: Create Maven Project by using: File -> New -> Maven Project $> mvn archetype:generate -DarchetypeArtifactId= -DarchetypeGroupId=com.liferay.maven.archetypes<liferay-plugin-archetype> -DarchetypeVersion=6.2.1 -DartifactId= -DgroupId= -Dversion=1.0-SNAPSHOT<your-liferay-plugin-name> <your-package-name> $> mvn clean package $> mvn clean package liferay:deploy
  • 3. Step 2: Use default value and click on "Next" button Step 3: Select "Default Local" for Catalog, and select created archetype (e.g: liferay-portlet-archetype)
  • 4. Step 4: input required information (e.g. group id, artifact id, version, and package,..) Note: artifact id needs to follow liferay plugin name rules (e.g. the liferay portlet will contain "-portlet" string)
  • 5. Related articles HowTo: Using Liferay Maven Plugin module with Liferay Portal 6.2 GA2 -v6.2.1 HowTo: Fix Liferay XML Library Conflict on AMP - WebLogic Platform