SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

스타트업을 위한 Confluent 웨비나 3탄
스타트업을 위한 Confluent 웨비나 3탄스타트업을 위한 Confluent 웨비나 3탄
스타트업을 위한 Confluent 웨비나 3탄confluent
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesMichal Cwienczek
 
Concept, construct and variable by sajjad ahmad-upm
Concept, construct and  variable by sajjad ahmad-upmConcept, construct and  variable by sajjad ahmad-upm
Concept, construct and variable by sajjad ahmad-upmSajjad Ahmad
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREAraf Karsh Hamid
 
Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...
Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...
Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...Amazon Web Services
 
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...Vietnam Open Infrastructure User Group
 
DevSecOps: Security With DevOps
DevSecOps: Security With DevOpsDevSecOps: Security With DevOps
DevSecOps: Security With DevOpsKnoldus Inc.
 
SIAM and DevOps - Getting the Best of Both Worlds
SIAM and DevOps - Getting the Best of Both WorldsSIAM and DevOps - Getting the Best of Both Worlds
SIAM and DevOps - Getting the Best of Both WorldsScopism
 
Azure Container Apps
Azure Container AppsAzure Container Apps
Azure Container AppsKen Sykora
 
Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현confluent
 
RedHat Certification Track
RedHat Certification TrackRedHat Certification Track
RedHat Certification Trackssuser113f26
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache KafkaChhavi Parasher
 
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...StreamNative
 
Ensuring a Quality Order Management Implementation
Ensuring a Quality Order Management ImplementationEnsuring a Quality Order Management Implementation
Ensuring a Quality Order Management ImplementationPerficient, Inc.
 
Meetup: Streaming Data Pipeline Development
Meetup:  Streaming Data Pipeline DevelopmentMeetup:  Streaming Data Pipeline Development
Meetup: Streaming Data Pipeline DevelopmentTimothy Spann
 
Axon Framework, Exploring CQRS and Event Sourcing Architecture
Axon Framework, Exploring CQRS and Event Sourcing ArchitectureAxon Framework, Exploring CQRS and Event Sourcing Architecture
Axon Framework, Exploring CQRS and Event Sourcing ArchitectureAshutosh Jadhav
 

Tendances (20)

스타트업을 위한 Confluent 웨비나 3탄
스타트업을 위한 Confluent 웨비나 3탄스타트업을 위한 Confluent 웨비나 3탄
스타트업을 위한 Confluent 웨비나 3탄
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Ms project training ver 01
Ms project training ver 01Ms project training ver 01
Ms project training ver 01
 
Concept, construct and variable by sajjad ahmad-upm
Concept, construct and  variable by sajjad ahmad-upmConcept, construct and  variable by sajjad ahmad-upm
Concept, construct and variable by sajjad ahmad-upm
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...
Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...
Four Strategies to Create a DevOps Culture & System that Favors Innovation & ...
 
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
Room 3 - 2 - Trần Tuấn Anh - Defending Software Supply Chain Security in Bank...
 
DevSecOps: Security With DevOps
DevSecOps: Security With DevOpsDevSecOps: Security With DevOps
DevSecOps: Security With DevOps
 
SIAM and DevOps - Getting the Best of Both Worlds
SIAM and DevOps - Getting the Best of Both WorldsSIAM and DevOps - Getting the Best of Both Worlds
SIAM and DevOps - Getting the Best of Both Worlds
 
Azure Container Apps
Azure Container AppsAzure Container Apps
Azure Container Apps
 
Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현
 
RedHat Certification Track
RedHat Certification TrackRedHat Certification Track
RedHat Certification Track
 
Aws migration case study_blr_meetup
Aws migration case study_blr_meetupAws migration case study_blr_meetup
Aws migration case study_blr_meetup
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache Kafka
 
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
 
Ensuring a Quality Order Management Implementation
Ensuring a Quality Order Management ImplementationEnsuring a Quality Order Management Implementation
Ensuring a Quality Order Management Implementation
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Meetup: Streaming Data Pipeline Development
Meetup:  Streaming Data Pipeline DevelopmentMeetup:  Streaming Data Pipeline Development
Meetup: Streaming Data Pipeline Development
 
Axon Framework, Exploring CQRS and Event Sourcing Architecture
Axon Framework, Exploring CQRS and Event Sourcing ArchitectureAxon Framework, Exploring CQRS and Event Sourcing Architecture
Axon Framework, Exploring CQRS and Event Sourcing Architecture
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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...Miguel Araújo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Dernier (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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