SlideShare uma empresa 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

Mais conteúdo relacionado

Destaque

Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applicationsSerge Huber
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay wayriround
 
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 2009tardifpa
 
Web Apps for the Masses
Web Apps for the MassesWeb Apps for the Masses
Web Apps for the MassesDavid Tufts
 
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 MassesDavid Tufts
 
Ahlan Ramadan presentation
Ahlan Ramadan presentationAhlan Ramadan presentation
Ahlan Ramadan presentationbintMahmood
 
Sms obaveštenja - prezentacija
Sms obaveštenja  - prezentacijaSms obaveštenja  - prezentacija
Sms obaveštenja - prezentacijanemanjakovacevic
 
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
 

Destaque (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

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Último (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

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