Set up DX Cloud
This page guides you on setting up everything you need to set up a new DX Cloud project.
Getting started: Check you have the correct prerequisites, create your project, and then get ready to deploy your DX Cloud project.
Prerequisites
There are a few things that you need before you can get started with developing for your DX Cloud project.
Java
Currently, the minimum supported Java version for DX Cloud is Java 11 (LTS).
For Java installation and version requirements, see Java Development Kit in the Magnolia product documentation.
Maven
For Maven setup with Magnolia Enterprise artifacts (including password encryption for repository credentials), see Maven in the Magnolia product documentation.
Set up credentials in Maven settings
Use the APAC or US Nexus URLs in your Maven settings.xml for optimal performance if desired. https://nexus.magnolia-cms.com/ is the default URL, optimized for Europe.
After you have set up Password Encryption above, switch to your shell and run the following command:
mvn org.sonatype.plugins:nexus-m2settings-maven-plugin:1.6.5:download -DnexusUrl=https://nexus.magnolia-cms.com -DtemplateId=magnolia-enterprise
Testing Maven settings
A simple way to test your settings: Try to build a project with Maven which is dependent on a Magnolia Enterprise module. Try to build a DX Core bundle from the Magnolia official Maven archetypes:
mvn archetype:generate -Dfilter=info.magnolia.maven.archetypes:magnolia
Mirroring
If you have your own Repository Manager, the following are the repositories you can mirror:
IDE
Make sure you have a Java IDE installed. It could be:
Create a project using the Maven archetype
Create a custom cloud bundle from the following Maven Archetypes:
mvn archetype:generate \
-DarchetypeGroupId=info.magnolia.maven.archetypes \
-DarchetypeArtifactId=magnolia-dx-core-custom-cloud-archetype \
-DarchetypeVersion=1.10 \
-DarchetypeRepository=https://nexus.magnolia-cms.com/content/repositories/magnolia.public.releases <1>
You can use the APAC or US URLs for optimal performance if desired. https://nexus.magnolia-cms.com/ is the default URL, optimized for Europe.
You will be prompted to enter the following info:
groupId: The Maven groupId of your cloud bundle (ie: info.magnolia.demo)artifactId: The Maven artifactId of your cloud bundle (ie: magnolia-demo-ecommerce)version: The Maven version of your cloud bundle (ie: 1.0-SNAPSHOT). The final version is generated on release.package: The Maven base package of your cloud bundle (usually same a thegroupId)magnolia-bundle-version: The Magnolia version to be used in your cloud bundle (ie: 6.2.24)project-name: The project name (ie: magnolia-demo-ecommerce)shortname: The name of the project to be used in the Magnolia URLs (ie: https://dev.shortname.magnolia-platform.com/author)region: The AWS region the database backup bucket is located in (ie: eu-central-1)
The command will then create the Magnolia Java Webapp project.
For the expected project layout, see Webapp deployment.
The Java webapp in DX Cloud has a typical structure.
Webapp structure example
custom
├── .gitignore
├── .gitlab-ci.yml <1>
├── .m2
│ └── settings.xml
├── README.md
├── custom-webapp
│ ├── Dockerfile
│ ├── pom.xml
│ ├── src
│ └── target
├── pom.xml
└── values.yml <2>
The .gitlab-ci.yml file ensures your development changes are automatically picked up.
The values.yml file ensures your DX Cloud application is deployed to the your cluster.
On the first level you will find the pom.xml file which automatically contains the magnolia-dx-core-custom-cloud-parent artifact.
...
<dependencyManagement>
<dependencies>
<!-- DX Core custom cloud dependency management -->
<dependency>
<groupId>info.magnolia.dx</groupId>
<artifactId>magnolia-dx-core-custom-cloud-parent</artifactId> <1>
<version>${magnolia.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
The magnolia-dx-core-custom-cloud-parent artifact.
Testing the project
Open a terminal and go to the newly created project and then execute the following Maven build command:
mvn clean package
Starting Magnolia locally
Load the project in your IDE and configure the Tomcat server with the following system variables.
-Xms1024m
-Xmx2048m
-Dmagnolia.develop=true
-Dmagnolia.superuser.enabled=true
-Dmagnolia.utf8.enabled=true
-Dmagnolia.update.auto=true
-Dmagnolia.resources.dir="/opt/magnolia/light-modules"
-Dmagnolia.repositories.home="/opt/magnolia/repositories"
-Dmagnolia.webapp="Goofy Author"
-Dmagnolia.bootstrap.license.owner="your-email@example.com"
-Dmagnolia.bootstrap.license.key="your-license-key"
Custom cloud parent project
The custom cloud parent project automatically excludes the following modules:
- Backup module: It will be part of an outside feature.
It includes the following modules:
- Instrumentation: Exposes the Magnolia metrics to the monitoring service.
- Configuration injection: Facilitates the customization of Magnolia.
Password manager key
If you are upgrading Helm to version 1.14 or later and running Magnolia 6.2.44+, you must manually move the password manager keypair properties file to the expected location for the DX Cloud Helm chart.
Instructions
- On your Author instance, move your password manager keypair properties file to the expected location (
/keys/password-app/).
mv /mgnl-home/WEB-INF/config/default/magnolia-password-manager-keypair.properties /keys/password-app/ <1>
Helm expects the file at /keys/password-app/.
- Once done, publish the key from JCR.
/modules/password-manager-core@publicKey <1>
This ensures your Public instances receive the correct key.