Monday, February 24, 2014

Build Magnolia Project

Build Magnolia Project

Step by step tutorial about creating Magnolia project with Eclipse. I referred an excellent article by GJoseph at dev.magnolia-cms.com for this and took help from Peter Phillips from http://forum.magnolia-cms.com/

STEP #1 Configure Eclipse Preferences


  1. Window → Preferences → Maven → Archtypes
  2. Click AddRemoteCatalog 
  3. enter http://nexus.magnolia-cms.com/content/groups/public/ and magnolia-cms

 


Step#2 – Create New Maven Project

  1. select magnolia-project-archtype
  2. Set groupid and artifactid as appropriate













Step#3 – Modify pom files and build

In parent pom add the following to repository
            <repository>
               <id>vaadin-addons</id>
               <url>http://maven.vaadin.com/vaadin-addons</url>
            </repository>
In web app pom add the following to dependencies
    <dependency>
      <groupId>info.magnolia</groupId>
      <artifactId>magnolia-module-legacy-admininterface</artifactId>
      <version>5.2.2</version>
    </dependency>
    <dependency>
      <groupId>info.magnolia</groupId>
      <artifactId>magnolia-module-standard-templating-kit</artifactId>
      <version>2.7.2</version>
       <type>jar</type>
    </dependency>
    <dependency>
      <groupId>info.magnolia.dam</groupId>
      <artifactId>magnolia-dam</artifactId>
      <version>1.2.2</version>
    </dependency>
    <dependency>
      <groupId>info.magnolia</groupId>
      <artifactId>magnolia-module-form</artifactId>
      <version>2.2.2</version>
    </dependency>
    <dependency>
       <groupId>info.magnolia</groupId>
       <artifactId>magnolia-theme-pop</artifactId>
       <version>2.7.2</version>
    </dependency>
    <dependency>
      <groupId>info.magnolia.themes.blue</groupId>
      <artifactId>magnolia-theme-blue</artifactId>
      <version>1.0.0-SNAPSHOT</version>
    </dependency>

Right click parent app and click Run As → Maven install
This will take some time as dependencies will be downloaded. When I tried on pathetic internet connection speed, it took nearly three hours



After completing download and build you get some thing like this

[INFO] Installing C:\Users\XXX\mgnl\app1\app1-webapp\target\app1-webapp-0.0.1-SNAPSHOT.war to C:\Users\XXX\.m2\repository\learn\mgnl\handson\app1-webapp\0.0.1-SNAPSHOT\app1-webapp-0.0.1-SNAPSHOT.war
[INFO] Installing C:\Users\XXX\mgnl\app1\app1-webapp\pom.xml to C:\Users\XXX\.m2\repository\learn\mgnl\handson\app1-webapp\0.0.1-SNAPSHOT\app1-webapp-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] app1 (parent pom) ................................. SUCCESS [2.010s]
[INFO] app1-webapp: webapp ............................... SUCCESS [55.493s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

You will get the war file in your local repository as well as project work space

Step#4 – Deploy war in tomcat

Copy C:\Users\XXX\mgnl\app1\app1-webapp\target\app1-webapp-0.0.1-SNAPSHOT.war to path\to\tomcat\webapps\app1.war
OR
If tomcat is already running open manager page and deploy the war
Start tomcat startup.bat
Once tomcat is started, browse to http://localhost:8080/app1 this will lead to Magnolia installation page




Step#5 – Install modules

Click start install, after successful installation you should get a page as below. Clicking Start up Magnolia takes to admin central login page. Login with superuser.





2 comments:

  1. when i tried to add the remote catalog ,it is showing as empty

    ReplyDelete
  2. I created a maven project!! whenever I deploy the war file ,it asks for installation.This happens whenever I deploy the WAR file.Kindly let me know a solution.

    ReplyDelete