SlideShare a Scribd company logo
1 of 26
Download to read offline
Developing Liferay Plugins with
Maven
Mika Koivisto
Senior Software Engineer
Agenda
•   Quick Introduction to Maven
•   Liferay Maven Support
•   Demo
•   Future Plans
Quick Introduction to Maven
• Project management tool (build, test, report, assemble,
    release)
•   Small core expandable with plugins
•   Convention over configuration
•   Dependency management
•   Common lifecycle
Typical Ant build.xml
<project name="my-project" default="dist" basedir=".">
    <property name="src" location="src/main/java"/>
    <property name="build" location="target/classes"/>
    <property name="dist" location="target"/>

    <target name="init">
        <tstamp/>
        <mkdir dir="${build}"/>
    </target>

    <target name="compile" depends="init" description="compile the source " >
        <javac srcdir="${src}" destdir="${build}"/>
    </target>

    <target name="dist" depends="compile">
        <mkdir dir="${dist}/lib"/>

       <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
    </target>

    <target name="clean">
        <delete dir="${build}"/>
        <delete dir="${dist}"/>
    </target>
</project>
Same in Maven
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.liferay.sample</groupId>
    <artifactId>my-project</artifactId>
    <version>1.0-SNAPSHOT</version>
</project>
The Project Object Model
•   Analogous to Makefile or build.xml
•   Versioned <major>.<minor>.<increment>-<qualifier>
•   Packaging (pom, jar, war, ejb, ear, etc.)
•   Inheritance
•   Sub-modules
•   Dependencies
•   Profiles
•   Properties
Dependency Management
• Declarative
• Transitive
• Identified by: groupId, artifactId, version and type
  combination
• Scoped: compile, provided, runtime, test or system
Build Lifecycle
•   Build-in lifecycles: default, clean and site
•   Lifecycles have phases
•   Goals are attached to phases
•   Common phases:
    •   clean
    •   compile
    •   test
    •   package
    •   install
    •   deploy
Repositories
• Place where all artifacts are stored
• Local
  • Located in USER_HOME/.m2/repository
  • Cached copy of downloaded artifacts
  • Contains locally installed artifacts
• Remote
  • Central
  • Internal or external
  • Proxy or Cache
What is Artifact?
• Product of build
• Described by pom.xml
• Identified with combination of groupId, artifactId, version
  and qualifier
What is Archetype?
• Project template
• Available for various project types
• Run mvn archetype:generate to create interactively or
  specify with parameters
   mvn archetype:generate 
      -DarchetypeArtifactId=liferay-portlet-archetype 
      -DarchetypeGroupId=com.liferay.maven.archetypes 
      -DarchetypeVersion=6.1.0 
      -DgroupId=com.liferay.sample 
      -DartifactId=sample-portlet 
      -Dversion=1.0-SNAPSHOT 
      -DinteractiveMode=false
Liferay Maven Support
• Alternative to ant based plugins sdk
• Compatible with both Liferay 6.1 CE and EE
• CE Portal Artifacts published to Maven Central
  Repository
• EE Portal Artifacts downloadable from Customer Portal
• Liferay Maven Plugin and Archetypes published to Maven
  Central Repository for both CE and EE
Liferay Portal Artifacts
• GroupId: com.liferay.portal
• ArtifactId:
  • portal-client
  • portal-impl
  • portal-service
  • portal-web
  • support-tomcat
  • util-bridges
  • util-java
  • util-taglib
Liferay Maven Plugin
• GroupId: com.liferay.maven.plugins
• ArtifactId: liferay-maven-plugin
• Brings features from Plugins SDK to Maven
  • Service Builder
  • Theme diffs
  • Direct Deployment
Liferay Maven Plugin Goals
•   liferay:build-ext
•   liferay:build-lang
•   liferay:build-service
•   liferay:build-thumbnail
•   liferay:build-wsdd
•   liferay:deploy
•   liferay:direct-deploy
•   liferay:theme-merge
Liferay Archetypes
• GroupId: com.liferay.maven.archetypes
• ArtifactId:
  • liferay-ext-archetype
  • liferay-hook-archetype
  • liferay-layouttpl-archetype
  • liferay-portlet-archetype
  • liferay-servicebuilder-archetype
  • liferay-theme-archetype
  • liferay-web-archetype
Demo
Parent Project
• Vaguely equivalent to plugins sdk instance
• Includes all the project modules such as:
  • Portlets
  • Themes
  • Layouts
• Contains common project properties such as used Liferay
  version
Sample Parent Project Pom
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	     <modelVersion>4.0.0</modelVersion>
	     <groupId>com.liferay.sample</groupId>
	     <artifactId>helloworld-project</artifactId>
	     <version>1.0-SNAPSHOT</version>
	     <packaging>pom</packaging>
	     <properties>
	     	     <liferay.version>6.1.10</liferay.version>
	     	     <liferay.auto.deploy.dir>/opt/liferay-portal-6.1.10-ee-ga1/deploy</liferay.auto.deploy.dir>
	     </properties>

</project>
Theme Module
• Merges with parent theme
     during packaging
• Parent theme defined in
     pom.xml
• Parent can be built-in theme
     or any war artifact
• Deploy with
mvn liferay:deploy
or
mvn liferay:direct-deploy -DdeployDir=/

opt/liferay/tomcat/webapps
Service Builder Module
• Creates separate portlet and
     service api sub projects
• Build service from -portlet
mvn liferay:build-service

• Deploy from -portlet
mvn liferay:deploy
or
mvn liferay:direct-deploy -DdeployDir=/

opt/liferay/tomcat/webapps
Ext Plugin Module
• Similar structure to plugins
   sdk but mavenized
• Build service from -ext-impl
mvn liferay:build-service
-DserviceFileName=src/main/resources/
com/liferay/sample/service.xml

• Deploy from -ext
mvn liferay:build-service
-DserviceFileName=src/main/resources/
com/liferay/sample/service.xml
Maven Best Practices
• Setup internal repository and maven proxy
  • Reduces build time by caching dependencies
  • Increases build stability and repeatability
  • Allows enforcing company policies
• Never use 3rd party SNAPHOT dependencies
• Declare all your dependencies and don’t rely on transitive
  dependencies for classes you use
Future Plans
• IDE integration
  • Liferay IDE
  • Liferay Developer Studio
• More archetypes (liferay faces, spring mvc, etc.)
• Liferay Bundle Builder
Contributing
• Github project
  https://github.com/liferay/liferay-maven-support
• JIRA
  http://issues.liferay.com/browse/MAVEN
Contact

 Email: mika.koivisto@liferay.com
 Twitter: @koivimik
 Github: mikakoivisto

More Related Content

What's hot

Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwalratneshsinghparihar
 
Customizing CKAN
Customizing CKANCustomizing CKAN
Customizing CKANOKCon2013
 
Guide to web application development
Guide to web application developmentGuide to web application development
Guide to web application developmentFingent Corporation
 
Object Storage Overview
Object Storage OverviewObject Storage Overview
Object Storage OverviewCloudian
 
User Focused Security at Netflix: Stethoscope
User Focused Security at Netflix: StethoscopeUser Focused Security at Netflix: Stethoscope
User Focused Security at Netflix: StethoscopeJesse Kriss
 
아두이노 & 라즈베리파이
아두이노 & 라즈베리파이아두이노 & 라즈베리파이
아두이노 & 라즈베리파이JongyoonWon1
 
Website Evaluation Lesson
Website Evaluation Lesson Website Evaluation Lesson
Website Evaluation Lesson J V
 
A Reference architecture for the Internet of things
A Reference architecture for the Internet of things A Reference architecture for the Internet of things
A Reference architecture for the Internet of things WSO2
 
Clova ai-business-day-session-2
Clova ai-business-day-session-2Clova ai-business-day-session-2
Clova ai-business-day-session-2Clova Platform
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first courseVlad Posea
 
Web application development with Django framework
Web application development with Django frameworkWeb application development with Django framework
Web application development with Django frameworkflapiello
 
android architecture
android architectureandroid architecture
android architectureAashita Gupta
 
mLearn Project 2012 Full Report
mLearn Project 2012 Full ReportmLearn Project 2012 Full Report
mLearn Project 2012 Full ReportmLearn
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unitgowher172236
 
Android : Architecture & Components
Android : Architecture & ComponentsAndroid : Architecture & Components
Android : Architecture & ComponentsAkash Bisariya
 
Introduction to Azure Cloud Storage
Introduction to Azure Cloud StorageIntroduction to Azure Cloud Storage
Introduction to Azure Cloud StorageGanga R Jaiswal
 

What's hot (20)

Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Django app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh AgarwalDjango app deployment in Azure By Saurabh Agarwal
Django app deployment in Azure By Saurabh Agarwal
 
Customizing CKAN
Customizing CKANCustomizing CKAN
Customizing CKAN
 
Guide to web application development
Guide to web application developmentGuide to web application development
Guide to web application development
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Object Storage Overview
Object Storage OverviewObject Storage Overview
Object Storage Overview
 
User Focused Security at Netflix: Stethoscope
User Focused Security at Netflix: StethoscopeUser Focused Security at Netflix: Stethoscope
User Focused Security at Netflix: Stethoscope
 
Asp.Net Tutorials
Asp.Net TutorialsAsp.Net Tutorials
Asp.Net Tutorials
 
아두이노 & 라즈베리파이
아두이노 & 라즈베리파이아두이노 & 라즈베리파이
아두이노 & 라즈베리파이
 
Website Evaluation Lesson
Website Evaluation Lesson Website Evaluation Lesson
Website Evaluation Lesson
 
A Reference architecture for the Internet of things
A Reference architecture for the Internet of things A Reference architecture for the Internet of things
A Reference architecture for the Internet of things
 
Clova ai-business-day-session-2
Clova ai-business-day-session-2Clova ai-business-day-session-2
Clova ai-business-day-session-2
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first course
 
Web application development with Django framework
Web application development with Django frameworkWeb application development with Django framework
Web application development with Django framework
 
IoT Cloud Overview
IoT Cloud OverviewIoT Cloud Overview
IoT Cloud Overview
 
android architecture
android architectureandroid architecture
android architecture
 
mLearn Project 2012 Full Report
mLearn Project 2012 Full ReportmLearn Project 2012 Full Report
mLearn Project 2012 Full Report
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
 
Android : Architecture & Components
Android : Architecture & ComponentsAndroid : Architecture & Components
Android : Architecture & Components
 
Introduction to Azure Cloud Storage
Introduction to Azure Cloud StorageIntroduction to Azure Cloud Storage
Introduction to Azure Cloud Storage
 

Viewers also liked

Liferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful DeploymentLiferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful Deploymentrivetlogic
 
J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014Nguyen Tung
 
Architecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionArchitecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionNguyen Tung
 
Liferay Portal Introduction
Liferay Portal IntroductionLiferay Portal Introduction
Liferay Portal IntroductionNguyen Tung
 
OOD Principles and Patterns
OOD Principles and PatternsOOD Principles and Patterns
OOD Principles and PatternsNguyen Tung
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay wayriround
 
SaaS Introduction-May2014
SaaS Introduction-May2014SaaS Introduction-May2014
SaaS Introduction-May2014Nguyen Tung
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice ArchitectureNguyen Tung
 
Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applicationsSerge Huber
 
Maven plugin guide using Modello Framework
Maven plugin guide using Modello FrameworkMaven plugin guide using Modello Framework
Maven plugin guide using Modello Frameworkfulvio russo
 
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
 
7 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 2016
7 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 20167 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 2016
7 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 2016Sébastien Le Marchand
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiRafik HARABI
 
Chatbot in Sale Management
Chatbot in Sale ManagementChatbot in Sale Management
Chatbot in Sale ManagementVõ Duy Tuấn
 
Introduction to Portlets Using Liferay Portal
Introduction to Portlets Using Liferay PortalIntroduction to Portlets Using Liferay Portal
Introduction to Portlets Using Liferay Portalrivetlogic
 
Présentation Ippon DGA Liferay Symposium 2011
Présentation Ippon DGA Liferay Symposium 2011Présentation Ippon DGA Liferay Symposium 2011
Présentation Ippon DGA Liferay Symposium 2011Ippon
 

Viewers also liked (20)

Liferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful DeploymentLiferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful Deployment
 
J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014
 
Architecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionArchitecture Patterns - Open Discussion
Architecture Patterns - Open Discussion
 
Liferay Portal Introduction
Liferay Portal IntroductionLiferay Portal Introduction
Liferay Portal Introduction
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
OOD Principles and Patterns
OOD Principles and PatternsOOD Principles and Patterns
OOD Principles and Patterns
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay way
 
SAML and Liferay
SAML and LiferaySAML and Liferay
SAML and Liferay
 
SaaS Introduction-May2014
SaaS Introduction-May2014SaaS Introduction-May2014
SaaS Introduction-May2014
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applications
 
Maven plugin guide using Modello Framework
Maven plugin guide using Modello FrameworkMaven plugin guide using Modello Framework
Maven plugin guide using Modello Framework
 
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
 
7 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 2016
7 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 20167 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 2016
7 plugins de la communauté à ne pas manquer ! - Liferay France Symposium 2016
 
Portal Presention
Portal PresentionPortal Presention
Portal Presention
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
 
Chatbot in Sale Management
Chatbot in Sale ManagementChatbot in Sale Management
Chatbot in Sale Management
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Introduction to Portlets Using Liferay Portal
Introduction to Portlets Using Liferay PortalIntroduction to Portlets Using Liferay Portal
Introduction to Portlets Using Liferay Portal
 
Présentation Ippon DGA Liferay Symposium 2011
Présentation Ippon DGA Liferay Symposium 2011Présentation Ippon DGA Liferay Symposium 2011
Présentation Ippon DGA Liferay Symposium 2011
 

Similar to Developing Liferay Plugins with Maven

Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in MuleShahid Shaik
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to MavenSperasoft
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 OverviewMike Ensor
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomavenManav Prasad
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.Fazreil Amreen Abdul Jalil
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenArnaud Héritier
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentationArnaud Héritier
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 

Similar to Developing Liferay Plugins with Maven (20)

Maven
MavenMaven
Maven
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
4 maven junit
4 maven junit4 maven junit
4 maven junit
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomaven
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.
 
Maven basic concept
Maven basic conceptMaven basic concept
Maven basic concept
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
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
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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
 
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
 
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!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
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
 
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
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
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?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Developing Liferay Plugins with Maven

  • 1. Developing Liferay Plugins with Maven Mika Koivisto Senior Software Engineer
  • 2. Agenda • Quick Introduction to Maven • Liferay Maven Support • Demo • Future Plans
  • 3. Quick Introduction to Maven • Project management tool (build, test, report, assemble, release) • Small core expandable with plugins • Convention over configuration • Dependency management • Common lifecycle
  • 4. Typical Ant build.xml <project name="my-project" default="dist" basedir="."> <property name="src" location="src/main/java"/> <property name="build" location="target/classes"/> <property name="dist" location="target"/> <target name="init"> <tstamp/> <mkdir dir="${build}"/> </target> <target name="compile" depends="init" description="compile the source " > <javac srcdir="${src}" destdir="${build}"/> </target> <target name="dist" depends="compile"> <mkdir dir="${dist}/lib"/> <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/> </target> <target name="clean"> <delete dir="${build}"/> <delete dir="${dist}"/> </target> </project>
  • 5. Same in Maven <project> <modelVersion>4.0.0</modelVersion> <groupId>com.liferay.sample</groupId> <artifactId>my-project</artifactId> <version>1.0-SNAPSHOT</version> </project>
  • 6. The Project Object Model • Analogous to Makefile or build.xml • Versioned <major>.<minor>.<increment>-<qualifier> • Packaging (pom, jar, war, ejb, ear, etc.) • Inheritance • Sub-modules • Dependencies • Profiles • Properties
  • 7. Dependency Management • Declarative • Transitive • Identified by: groupId, artifactId, version and type combination • Scoped: compile, provided, runtime, test or system
  • 8. Build Lifecycle • Build-in lifecycles: default, clean and site • Lifecycles have phases • Goals are attached to phases • Common phases: • clean • compile • test • package • install • deploy
  • 9. Repositories • Place where all artifacts are stored • Local • Located in USER_HOME/.m2/repository • Cached copy of downloaded artifacts • Contains locally installed artifacts • Remote • Central • Internal or external • Proxy or Cache
  • 10. What is Artifact? • Product of build • Described by pom.xml • Identified with combination of groupId, artifactId, version and qualifier
  • 11. What is Archetype? • Project template • Available for various project types • Run mvn archetype:generate to create interactively or specify with parameters mvn archetype:generate -DarchetypeArtifactId=liferay-portlet-archetype -DarchetypeGroupId=com.liferay.maven.archetypes -DarchetypeVersion=6.1.0 -DgroupId=com.liferay.sample -DartifactId=sample-portlet -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
  • 12. Liferay Maven Support • Alternative to ant based plugins sdk • Compatible with both Liferay 6.1 CE and EE • CE Portal Artifacts published to Maven Central Repository • EE Portal Artifacts downloadable from Customer Portal • Liferay Maven Plugin and Archetypes published to Maven Central Repository for both CE and EE
  • 13. Liferay Portal Artifacts • GroupId: com.liferay.portal • ArtifactId: • portal-client • portal-impl • portal-service • portal-web • support-tomcat • util-bridges • util-java • util-taglib
  • 14. Liferay Maven Plugin • GroupId: com.liferay.maven.plugins • ArtifactId: liferay-maven-plugin • Brings features from Plugins SDK to Maven • Service Builder • Theme diffs • Direct Deployment
  • 15. Liferay Maven Plugin Goals • liferay:build-ext • liferay:build-lang • liferay:build-service • liferay:build-thumbnail • liferay:build-wsdd • liferay:deploy • liferay:direct-deploy • liferay:theme-merge
  • 16. Liferay Archetypes • GroupId: com.liferay.maven.archetypes • ArtifactId: • liferay-ext-archetype • liferay-hook-archetype • liferay-layouttpl-archetype • liferay-portlet-archetype • liferay-servicebuilder-archetype • liferay-theme-archetype • liferay-web-archetype
  • 17. Demo
  • 18. Parent Project • Vaguely equivalent to plugins sdk instance • Includes all the project modules such as: • Portlets • Themes • Layouts • Contains common project properties such as used Liferay version
  • 19. Sample Parent Project Pom <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.liferay.sample</groupId> <artifactId>helloworld-project</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <properties> <liferay.version>6.1.10</liferay.version> <liferay.auto.deploy.dir>/opt/liferay-portal-6.1.10-ee-ga1/deploy</liferay.auto.deploy.dir> </properties> </project>
  • 20. Theme Module • Merges with parent theme during packaging • Parent theme defined in pom.xml • Parent can be built-in theme or any war artifact • Deploy with mvn liferay:deploy or mvn liferay:direct-deploy -DdeployDir=/ opt/liferay/tomcat/webapps
  • 21. Service Builder Module • Creates separate portlet and service api sub projects • Build service from -portlet mvn liferay:build-service • Deploy from -portlet mvn liferay:deploy or mvn liferay:direct-deploy -DdeployDir=/ opt/liferay/tomcat/webapps
  • 22. Ext Plugin Module • Similar structure to plugins sdk but mavenized • Build service from -ext-impl mvn liferay:build-service -DserviceFileName=src/main/resources/ com/liferay/sample/service.xml • Deploy from -ext mvn liferay:build-service -DserviceFileName=src/main/resources/ com/liferay/sample/service.xml
  • 23. Maven Best Practices • Setup internal repository and maven proxy • Reduces build time by caching dependencies • Increases build stability and repeatability • Allows enforcing company policies • Never use 3rd party SNAPHOT dependencies • Declare all your dependencies and don’t rely on transitive dependencies for classes you use
  • 24. Future Plans • IDE integration • Liferay IDE • Liferay Developer Studio • More archetypes (liferay faces, spring mvc, etc.) • Liferay Bundle Builder
  • 25. Contributing • Github project https://github.com/liferay/liferay-maven-support • JIRA http://issues.liferay.com/browse/MAVEN
  • 26. Contact Email: mika.koivisto@liferay.com Twitter: @koivimik Github: mikakoivisto