Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

New developers can start here. Step-by-step on how to create a new project and import it into Eclipse IDE.

Prerequisites

  • Java 8 JDK Installed
  • Maven Installed
    • Suggested Maven 3.3+
    • settings.xml created (See Maven setup).

Create the project

New Magnolia projects start with the archetype.

From the command line run:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/

Choose archetype:
1: An archetype to create STK Theme modules
2: An archetype to create a Magnolia project (a parent pom and a webapp)
3: An archetype to create basic Magnolia modules
4: An archetype to create a Magnolia module to be hosted on the Magnolia Forge
5: An archetype to create Magnolia modules using Blossom

Each archetype can have it's own set of versions.

Choose info.magnolia.maven.archetypes:magnolia-project-archetype version:
1: 1.1.0
2: 1.2.0
3: 1.2.1
4: 1.2.2
5: 1.2.3-SNAPSHOT

Define the project:

groupIdcom.mycompany.webapps
artifactIdmagnolia-cms
version5.6-SNAPSHOT
packagecom.mycompany.webapps (press enter key to accept)
magnolia-version5.6
project-namemagnolia-cms


Webapp types

  • Community or Enterprise
  • Enterprise Std or Enterprise pro
  • Empty Webapp

parent pom
<!-- Option A -->
<!-- Importing dependencyManagement of CE bundle. -->
<!--
<dependency>
   <groupId>info.magnolia.bundle</groupId>
   <artifactId>magnolia-bundle-parent</artifactId>
   <version>${magnoliaVersion}</version>
   <type>pom</type>
   <scope>import</scope>
</dependency>
-->

<!-- Option B -->
<!-- If you want to use the Enterprise Edition. -->
<dependency>
    <groupId>info.magnolia.eebundle</groupId>
    <artifactId>magnolia-enterprise-bundle-parent</artifactId>
    <version>${magnoliaVersion}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>
webapp pom
<!-- option i - magnolia-empty-webapp -->
<!-- Dependencies versions are already imported by parent pom. Requires "Option A" in the parent pom. -->
<!--
<dependency>
    <groupId>info.magnolia</groupId>
    <artifactId>magnolia-empty-webapp</artifactId>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>info.magnolia</groupId>
    <artifactId>magnolia-empty-webapp</artifactId>
    <type>war</type>
</dependency>
-->

<!-- option ii - magnolia-community-webapp -->
<!-- Dependencies versions are already imported by parent pom. Requires "Option A" in the parent pom. -->
<!--
<dependency>
    <groupId>info.magnolia.bundle</groupId>
    <artifactId>magnolia-community-webapp</artifactId>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>info.magnolia.bundle</groupId>
    <artifactId>magnolia-community-webapp</artifactId>
    <type>war</type>
</dependency>
-->

<!-- option iii - magnolia-enterprise-standard-webapp -->
<!-- Dependencies versions are already imported by parent pom. Requires "Option B" in the parent pom. -->
<dependency>
    <groupId>info.magnolia.eebundle</groupId>
    <artifactId>magnolia-enterprise-standard-webapp</artifactId>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>info.magnolia.eebundle</groupId>
    <artifactId>magnolia-enterprise-standard-webapp</artifactId>
    <type>war</type>
</dependency>

<!-- option iv - magnolia-enterprise-pro-webapp -->
<!-- Dependencies versions are already imported by parent pom. Requires "Option B" in the parent pom. -->
<!--
<dependency>
    <groupId>info.magnolia.eebundle</groupId>
    <artifactId>magnolia-enterprise-pro-webapp</artifactId>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>info.magnolia.eebundle</groupId>
    <artifactId>magnolia-enterprise-pro-webapp</artifactId>
    <type>war</type>
</dependency>
-->

Build the project

From the command line use maven to build the project. Execute the clean install from within the project directory.

mvn clean install

Eclipse users also need to explode the war file.

mvn war:inplace

Import the project


  • No labels