I’m giving you fair warning. I was recently reading the famous poem by Edgar Allen Poe, The Raven. So, naturally, I interwove our documentation on Maven with references to the poem, sometimes accurately, and other times adapted for my own narrative. I hope you enjoy reading it as much as I enjoyed writing it. Either way, you can let us know what you think by leaving a comment. If you want to find out how our fictional protagonists cat fares (introduced in a moment), read through our Maven tutorials and you’ll discover her fate.

“Once upon a midnight dreary, while I pondered weak and weary…”

Here’s the scene–you’re sitting in a luxurious armchair next to a dancing fire, hot beverage in hand. Shadows dance on the tapestry-covered wall, and your cat Lenore II is purring softly from her favorite perch atop the mantle.

“Ah, distinctly I remember it was in the bleak December…”

At least you’re passing this cold December night in grand style (in front of your computer customizing Liferay Portal, of course).

“Eagerly I wished the morrow;–vainly I had sought to borrow From Liferay surcease of sorrow–sorrow for my last Lenore–”

We’re sorry to hear your previous cat, the original Lenore, has passed away. Just take good care of Lenore II, would you?

“And the silken sad uncertain rustling of each purple curtain Thrilled me–filled me with *Ant*astic terrors never felt before;”

Okay, now you’re being melodramatic; nobody can disdain Apache Ant that vehemently. What about customizing Liferay Portal using the Ant-based Plugins SDK could make you feel sadness and terror?

“Deep into that darkness peering, long I stood there wondering, fearing…”

We get it! You don’t want to use our Ant-based Plugins SDK. Give us surcease from the melodrama, okay?

“Open here I flung the shutter, when, with many a flirt and flutter, In there stepped a stately Maven of the saintly days of yore.”

So, you’d rather use Apache Maven to develop your Liferay plugins?

“But Apache Maven still beguiling all my sad soul into smiling…”

Edgar Allen Poe liked Maven too, so you’re in good company. Trust us; we know. But if your soul was made sad because you thought you had to use Liferay’s Ant-based Plugins SDK to develop your plugins, Apache Maven will make your sad soul smile. And while you’re at it, take care of Lenore II for all of us animal lovers, would you?

As an alternative to developing plugins using the Plugins SDK, you can leverage the Apache Maven build management framework. Here’s a list of some exciting Maven features:

  • Offers a simple build process.
  • Features a project object model.
  • Has a defined project life cycle.
  • Provides a dependency management system.

Maven’s core installation is lightweight; there are core plugins for compiling source code and creating distributions, and there is an abundance of non-core plugins, letting you extend Maven easily for your customizations.

Many developers are switching from Ant to Maven because it offers a common interface for project builds. Maven’s universal directory structure makes it easier for you to understand another developer’s project more quickly. With Maven, there’s a simple process to build, install, and deploy project artifacts.

Maven uses a project object model (POM) to describe a software project. The POM is specified as XML in a file named pom.xml. Think of pom.xml as a blueprint for your entire project; it describes your project’s directories, required plugins, build sequence, and dependencies. The POM is your project’s sole descriptive declaration. Once you create the pom.xml file and invoke the build process, Maven does the rest, downloading your project’s inferred dependencies and building your project artifacts. If you’re not already familiar with how Maven works, you can get familiar with Maven’s project object model by reading Sonatype’s documentation for it at http://www.sonatype.com/books/mvnref-book/reference/pom-relationships.html.

Maven provides a clear definition of a project’s structure and manages a project from a single piece of information–its POM. Understanding a Maven project can be much easier than understanding an Ant-based project’s various build files. Maven forces projects to conform to a standard build process, whereas Ant projects can be built differently from project to project. Also, Maven provides an easy way to share artifacts (e.g., JARs, WARs, etc.) across projects via public repositories.

There are disadvantages to using Maven. You might find the Maven project structure too restrictive, or decide that reorganizing your projects to work with Maven is too cumbersome. Maven is intended primarily for Java-based projects, so it can be difficult to manage your project’s non-Java source code. Consider Maven’s advantages and disadvantages, then decide how you want to manage your projects. After you’re finished reading about Maven here, you can read an in-depth book about Maven at Maven: The Complete Reference by Sonatype, Inc. at http://www.sonatype.com/books/mvnref-book/reference/.

Liferay provides Maven archetypes to help you build plugins of various types, including Liferay portlets, themes, hooks, layout templates, web plugins, and more. You can also install and deploy Liferay artifacts to your repositories. You’ll dive into these topics in the Maven tutorials.

Setting Up Maven

This tutorial explains how to install and configure Maven and Nexus. Nexus is a Maven repository management server. Using Nexus for Maven repository management is convenient but not required. Once...

Read More

Installing and Managing Liferay Maven Artifacts

To create Liferay plugins using Maven, you’ll need the archives required by Liferay (e.g., required JAR and WAR files). This won’t be problem–Liferay provides them as Maven artifacts. This tutorial...

Read More

Using Maven From Liferay IDE

Wouldn’t it be nice if you could manage your Liferay Maven projects from Liferay IDE? You can! Liferay IDE 2.0 introduces the Maven project configurator (m2e-liferay), or the added support of...

Read More

Using Liferay Maven Parent Plugin Projects

Maven supports project inheritance. You can create a parent project that contains properties that child projects inherit. This saves time, since you don’t need to specify those properties in each...

Read More

Deploying Liferay Plugins with Maven

With Maven, it’s easy to deploy plugins to a Liferay Portal instance. This tutorial explain the process. Just follow these steps: Make sure you’ve specified the Liferay specific properties (the...

Read More

Creating Liferay Maven Plugins from Liferay IDE

Liferay offers many archetypes to help create Maven projects for multiple plugin types. These types include portlet, theme, hook, and layout template plugins. To make sure that you can find the...

Read More

Creating Liferay Maven Plugins from the Command Line

To learn how to use Liferay IDE to create Liferay Maven plugins, please refer to the Creating Liferay Maven Plugins from the Command Line tutorial. This tutorial explains how to use Maven...

Read More

Developing Liferay Portlets with Maven

This tutorial explains how to create Liferay portlet plugins using Maven and the anatomy of the Liferay Maven portlet plugin project. Creating a Portlet Plugin To create your Liferay portlet plugin...

Read More

Developing Liferay Theme Plugins with Maven

Lets use the style of Egar Allen Poe’s poem The Raven to help us explain Liferay theme development with Maven. To recap, since our narrative is a bit different than Poe’s original, so far we have...

Read More

Developing Liferay Hook Plugins with Maven

Hooks are the optimal plugin type for customizing Liferay’s core features. Creating a hook plugin with Maven is very similar to creating a portlet plugin with Maven. This tutorial explains how to...

Read More

Developing Liferay Layout Template Plugins with Maven

You can create layout templates to customize the display of portlets on your page and to embed commonly used portlets. The introduction to the themes tutorial described a nice scene where you’re...

Read More

Developing Liferay Faces Portlets with Maven

If you’re unfamiliar with the Liferay Faces project, it’s important to know that Liferay Faces is an umbrella project that provides support for the JavaServer Faces (JSF) standard in Liferay...

Read More

Developing Liferay Plugins with Additional Maven Archetypes

Liferay provides more archetypes than just the ones for portlets, hooks, themes, and layout templates. The Liferay team has been busy expanding the list of archetypes available for Liferay app...

Read More

Adding Properties to a Maven Project in Liferay IDE

When working with Maven projects in Liferay IDE, you may encounter situations where your project is missing required Maven properties. Maven properties go missing when a Maven profile ID isn’t...

Read More

Setting Up Liferay Maven Facets in Existing Liferay Maven Plugin Projects

Liferay Maven plugin projects created with Liferay IDE (2.0 Milestone 1 and newer) have all the required Liferay facets, including the new m2e-liferay plugin. The m2e-liferay plugin provides a...

Read More

Building Liferay Maven Artifacts from Source

You can download the Liferay Maven artifacts if you’re just interested in using the artifacts for a specific release. However, if you’d like to use the very latest Liferay CE Maven artifacts, you...

Read More
0 (0 Votes)
Using Front-End Development Code Assist Features in IDE Previous