SlideShare a Scribd company logo
1 of 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

More Related Content

Viewers also liked

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
 

Viewers also liked (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
 

Recently uploaded

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Recently uploaded (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

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