Applying the Maven-based approach to create a custom webapp with STK with Magnolia's magnolia-enterprise-pro-webapp
, this tutorial explains how to create custom webapps which include the Standard Templating Kit (STK). We recommend using Maven to handle module dependencies. However, you can can adapt a webapp manually by adding JAR files. We will explain this in the second part of the tutorial.
Using Maven to generate the webapp
We assume that you have at least a basic knowledge of Maven. where you add (and probably exclude) other modules. The page creating a custom bundle explains a scenario which starts with the Magnolia empty-webapp
. In this tutorial you will create a custom webapp based on the magnolia-enterprise-pro-webapp
.
Maven setup
Since you will build a webapp based on the magnolia-enterprise-pro-webapp
, make sure you have the proper Maven settings providing access to the Magnolia enterprise
repository.
Click here to expand to follow the test scenario
To check your settings, follow these steps:
open a terminal, change to a temporary directory and clone the documentation-check-maven-settings
module from magnolia git:
mkdir tmp
cd tmp/
git clone https://git.magnolia-cms.com/git/documentation/documentation-check-maven-settings.git
Alternatively the documentation-check-maven-settings
Project is available here: https://git.magnolia-cms.com/users/cmeier/repos/documentation-check-maven-settings/browse (You maybe need to ask Christoph Meierfor permission
)
The git
command should produce the following (or a similar) output:
Cloning into 'documentation-check-maven-settings'...
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 15 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (15/15), done.
Checking connectivity... done.
Now change into the cloned module and build the project with the -U option:
cd documentation-check-maven-settings/
mvn clean install -U
Maven will print out all the downloaded artifacts. At the end it should display the "BUILD SUCCESS" message:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.467 s
[INFO] Finished at: 2014-12-11T11:54:27+01:00
[INFO] Final Memory: 22M/184M
[INFO] ------------------------------------------------------------------------
If you couldn't build documentation-check-maven-settings
, please read Maven setup and modify your settings accordingly. If you were successful, read on. 
Creating a custom bundle using a Maven archetype
In this section, you will:
- Run a Maven command to produce an archetype.
- Adapt the result from step 1 to make sure that the webapp inherits from the
magnolia-enterprise-pro-webapp
. - Add the STK modules.
- Set the pro widgetset
- Build the webapp with Maven.
Step 1: Using the Maven archetype command
Open a shell and move to a working directory of your choice. Run the following command:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/
During the execution of the command, you will be prompted to choose options or add values. Here is an overview of the parameters which you have to decide for:
Parameter | Value used in this tutorial | Meaning |
---|
Choose a number or apply filter | 2
= An archetype to create a Magnolia project (a parent pom and a webapp). | This creates an archetype for a Magnolia webapp. Just enter the number. We will not apply the filter option here. |
Choose archetype version | Always choose the latest. | The version of the archetype script. Please note that upon entering 2 in the previous step, the prompt will in fact read as follows: Choose info.magnolia.maven.archetypes:magnolia-project-archetype version:
|
groupId | org.example | The Maven groupId of this project. We use org.example . Use a value reflecting your requirements. |
artifactID | custom-stk-project | The Maven artifact id. We use custom-stk-project . Use a value reflecting your requirements. |
version | 1.0-SNAPSHOT | The initial Maven version of this new project. It is a common practice to start with 1.0-SNAPSHOT . |
package | org.example.magnolia.webapp.stk | The package name for the Java package which will be created. Use a value reflecting your requirements. |
magnolia-bundle-version
| | The Magnolia bundle version. We recommend using the latest version. If you rely on an older branch, you may have to adapt the version of the STK modules added. |
project-name | custom-stk-project | The name of the Magnolia module. We recommend using the same name as in the groupId parameter. |
The command will summarize all the relevant parameters you have entered. To confirm the values press Y
. :
custom-stk-project/
├── custom-stk-project-webapp/
│ ├── pom.xml
│ └── src/
└── pom.xml
(The stk-example-project/stk-example-project-webapp/src
folder contains more files than shown above, but you may ignore them in the context of the present topic.)
Now it's time to have a look at the two pom files. You will edit them both in the next step.
In the following file, study especially the dependencyManagement/dependencies
section, which specifies modules versions.
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>custom-stk-project</artifactId>
<name>custom-stk-project (parent pom)</name>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<magnoliaBundleVersion>5.4.16</magnoliaBundleVersion>
<javaVersion>1.8</javaVersion>
</properties>
<!-- Fill the following in, so you can use the release plugin -->
<scm>
<connection/>
<developerConnection/>
<url/>
</scm>
<dependencyManagement>
<dependencies>
<!-- Option A -->
<!-- Importing dependencyManagement of CE bundle. -->
<dependency>
<groupId>info.magnolia.bundle</groupId>
<artifactId>magnolia-bundle-parent</artifactId>
<version>${magnoliaBundleVersion}</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>${magnoliaBundleVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
</configuration>
</plugin>
</plugins>
<!-- default resources configuration which will filter your module descriptors -->
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>META-INF/magnolia/*</include>
</includes>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>magnolia.public</id>
<url>https://nexus.magnolia-cms.com/content/groups/public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<!-- IF YOU NEED MODULES FROM THE ENTERPRISE VERSION, UNCOMMENT THE FOLLOWING REPOSITORY -->
<!--
<repository>
<id>magnolia.enterprise.releases</id>
<url>https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
-->
<repository>
<id>vaadin-addons</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<modules>
<module>custom-stk-project-webapp</module>
</modules>
</project>

In the following file, study especially the
dependencies
section. It specifies which modules will form part of the webapp.
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.example</groupId>
<artifactId>custom-stk-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>custom-stk-project-webapp</artifactId>
<name>custom-stk-project: webapp</name>
<packaging>war</packaging>
<dependencies>
<!--
Add your project specific dependencies here:
A custom webapp typically is based on a magnolia webapp. The most simple and reduced bundle to start with is the "magnolia-empty-webapp" (see "option i" below).
To see a complete list of preconfigured Magnolia webapps, have a look at https://documentation.magnolia-cms.com/display/DOCS/Bundles+and+webapps
=> Please just use one of the four below listed options!
Make sure to use the appropriate option (A or B) in the parent 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>war</type>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-empty-webapp</artifactId>
<type>pom</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>war</type>
</dependency>
<dependency>
<groupId>info.magnolia.bundle</groupId>
<artifactId>magnolia-community-webapp</artifactId>
<type>pom</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>war</type>
</dependency>
<dependency>
<groupId>info.magnolia.eebundle</groupId>
<artifactId>magnolia-enterprise-standard-webapp</artifactId>
<type>pom</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>war</type>
</dependency>
<dependency>
<groupId>info.magnolia.eebundle</groupId>
<artifactId>magnolia-enterprise-pro-webapp</artifactId>
<type>pom</type>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!-- exclude jars copied "physically" from the webapp overlay - so we only get those resolved by Maven's dependency management -->
<dependentWarExcludes>WEB-INF/lib/*.jar</dependentWarExcludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Step 2: Overlaying magnolia-enterprise-pro-webapp
In this step you will make sure that your webapp inherits from the magnolia-enterprise-pro-webapp
. Maven will create the so-called Overlay. You must adapt both the version management section and and the module management sections. You have to edit both pom files shown above.
Adapting the version management section
In custom-stk-project/pom.xml edit the dependencyManagement/dependencies
section. Delete the section marked as "Option A" and uncomment "Option B". Keep the block marked as "TEST". When done, the dependency management section should look like this:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>info.magnolia.eebundle</groupId>
<artifactId>magnolia-enterprise-bundle-parent</artifactId>
<version>${magnoliaBundleVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
The pom imports the version management section of
magnolia-enterprise-bundle-parent
. In step 3 you will also specify the version of the STK modules in the section.
Adapting the module management section
In custom-stk-project/custom-stk-project-webapp/pom.xml edit the dependencies
section. Uncomment the section marked as "option iv", delete the options i, ii and iii. The dependencies
section should then look as follows:
<dependencies>
<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>
</dependencies><!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Log in - Magnolia Bitbucket</title><script>
These dependencies will instruct Maven to merge the artifacts from
magnolia-enterprise-pro-webapp
into the project. In step 3 you will add the STK modules to the webapp.
Step 3: Adding the STK modules
Here are the modules which you have to add to enable the standard templating kit:
magnolia-module-standard-templating-kit | The module which contains the templates. | Required |
magnolia-theme-pop | A theme. | Required when using the demo project, see the next row. |
magnolia-demo-project | A demo project based on the STK templates and the pop theme. | Optional |
Be aware that the above modules have transient dependendencies to other Magnolia modules, for example to magnolia-module-public-user-registration
and magnolia-module-device-detection
. These dependencies are handled by Maven automatically. Now let's edit the pom files again.
Editing custom-stk-project/pom.xml
Add the following snippet to the dependencyManagement/dependencies
section:
Please note that the version
tags of the added dependencies do not contain the value but a variable instead. Set this variable in the properties
section at the beginning of the file.
Click here to see the complete file
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Log in - Magnolia Bitbucket</title><script>
window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};window.WRM._unparsedErrors=window.WRM._unparsedErrors||{};
WRM._unparsedData["com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:user-keyboard-shortcuts-enabled.data"]="true";
WRM._unparsedData["com.atlassian.analytics.analytics-client:programmatic-analytics-init.programmatic-analytics-data-provider"]="false";
WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\u0022\u0022";
WRM._unparsedData["com.atlassian.plugins.atlassian-clientside-extensions-runtime:runtime.atlassianDevMode"]="false";
WRM._unparsedData["com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:date-format-preference.data"]="\u0022\u0022";
WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:bitbucket.global.theme.data"]="false";
WRM._unparsedData["com.atlassian.analytics.analytics-client:policy-update-init.policy-update-data-provider"]="false";
WRM._unparsedData["com.atlassian.bitbucket.plugins.bitbucket-slack-server-integration-plugin:slack-link-error-resources.slack-link-error"]="{}";
WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:user.time.zone.onboarding.data"]="true";
if(window.WRM._dataArrived)window.WRM._dataArrived();</script>
<link rel="stylesheet" href="/s/c2e7fb6cb0fa3d99cfd1ed5573a5b732-CDN/-327823861/fdb5904/n1cn5w/a93e8b54a53a5453c42e8c7cfb35551a/_/download/contextbatch/css/_super/batch.css" data-wrm-key="_super" data-wrm-batch-type="context" media="all">
<link rel="stylesheet" href="/s/c3b4ddaba8d3dce9466950696444d252-CDN/-327823861/fdb5904/n1cn5w/80af30e6da65e29f7038393c9f70794e/_/download/contextbatch/css/bitbucket.page.login,-_super/batch.css" data-wrm-key="bitbucket.page.login,-_super" data-wrm-batch-type="context" media="all">
<link rel="stylesheet" href="/s/bf2916eb93ea7ba6a84c3be046c95434-CDN/-327823861/fdb5904/n1cn5w/d519805ac2904ed3b4db29856f637561/_/download/contextbatch/css/bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super/batch.css?slack-enabled=true" data-wrm-key="bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super" data-wrm-batch-type="context" media="all">
<script src="/s/6dcf9aa9352e12dc8dc168ef3f3260eb-CDN/-327823861/fdb5904/n1cn5w/a93e8b54a53a5453c42e8c7cfb35551a/_/download/contextbatch/js/_super/batch.js?locale=en-US" data-wrm-key="_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script src="/s/82aa06bf515f7a4d5c2ce5cd6bfc4c66-CDN/-327823861/fdb5904/n1cn5w/80af30e6da65e29f7038393c9f70794e/_/download/contextbatch/js/bitbucket.page.login,-_super/batch.js?locale=en-US" data-wrm-key="bitbucket.page.login,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script src="/s/da1cafd0ec4c647be47bd070d1c2e7b9-CDN/-327823861/fdb5904/n1cn5w/d519805ac2904ed3b4db29856f637561/_/download/contextbatch/js/bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super/batch.js?locale=en-US&slack-enabled=true" data-wrm-key="bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<meta name="application-name" content="Bitbucket"><link rel="shortcut icon" type="image/x-icon" href="/s/-327823861/fdb5904/n1cn5w/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:favicon/favicon.ico" /><link rel="search" href="https://git.magnolia-cms.com/plugins/servlet/opensearch-descriptor" type="application/opensearchdescription+xml" title="Bitbucket code search"/></head><body class="aui-page-focused aui-page-focused-small aui-page-size-small bitbucket-theme user-login"><script type="text/javascript">require('@bitbucket/internal/feature/theme').init();</script><ul id="assistive-skip-links" class="assistive"><li><a href="#content">Skip to content</a></li></ul><div id="page"><!-- start #header --><header id="header" role="banner"><section class="notifications"></section><nav class="aui-header aui-dropdown2-trigger-group" aria-label="site"><div class="aui-header-inner"><div class="aui-header-before"><button class=" aui-dropdown2-trigger app-switcher-trigger aui-dropdown2-trigger-arrowless" aria-controls="app-switcher" aria-haspopup="true" role="button" data-aui-trigger href="#app-switcher"><span class="aui-icon aui-icon-small aui-iconfont-appswitcher">Linked Applications</span></button><div id="app-switcher" class="aui-dropdown2 aui-style-default" role="menu" hidden data-is-user-admin="false" data-is-switcher="true"><div class="app-switcher-loading">Loading…</div></div></div><div class="aui-header-primary"><span id="logo" class="aui-header-logo bitbucket-header-logo"><a href="https://git.magnolia-cms.com"><img src="/s/-327823861/fdb5904/n1cn5w/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:bitbucket-logo/images/logo/bitbucket.svg" alt="Bitbucket"/></a></span><ul class="aui-nav"></ul></div><div class="aui-header-secondary"><ul class="aui-nav"><li class=" help-link"title="Help"><a class=" aui-dropdown2-trigger aui-dropdown2-trigger-arrowless" aria-controls="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" aria-haspopup="true" role="button" tabindex="0" data-aui-trigger><span class="aui-icon aui-icon-small aui-icon-small aui-iconfont-question-filled">Help</span></a><div id="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" class="aui-dropdown2 aui-style-default" role="menu" hidden data-aui-dom-container="body"><div class="aui-dropdown2-section help-items-section"><ul class="aui-list-truncate" role="presentation"><li role="presentation"><a href="https://docs.atlassian.com/bitbucketserver/docs-0814/Bitbucket+Data+Center+and+Server+documentation?utm_campaign=in-app-help&amp;utm_medium=in-app-help&amp;utm_source=stash" title="Go to the online documentation for Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:general-help">Online help</a></li><li role="presentation"><a href="https://www.atlassian.com/git?utm_campaign=learn-git&utm_medium=in-app-help&utm_source=stash" title="Learn about Git commands & workflows" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:learn-git">Learn Git</a></li><li role="presentation"><a href="/getting-started"class="getting-started-page-link" title="Overview of Bitbucket features" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:getting-started-page-help-link">Welcome to Bitbucket</a></li><li role="presentation"><a href="/#"class="keyboard-shortcut-link" title="Discover keyboard shortcuts in Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:keyboard-shortcuts-help-link">Keyboard shortcuts</a></li><li role="presentation"><a href="https://go.atlassian.com/bitbucket-server-whats-new?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" title="Learn about what's new in Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:whats-new-link">What's new</a></li><li role="presentation"><a href="https://go.atlassian.com/bitbucket-server-community?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" title="Explore the Atlassian community" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:community-link">Community</a></li><li role="presentation"><a href="/about" title="About Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:about">About</a></li></ul></div></div></li><li class=" alerts-menu"title="View system alerts"><a href="#alerts" id="alerts-trigger"class="alerts-menu" title="View system alerts" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:global-alerts-menu-item">Alerts</a></li></ul></div></div> <!-- End .aui-header-inner --></nav> <!-- End .aui-header --></header><!-- End #header --><!-- Start #content --><section id="content" role="main" tabindex="-1" data-timezone="-120" ><div class="aui-page-panel content-body" ><div class="aui-page-panel-inner"><main role="main" id="main" class="aui-page-panel-content" ><h2>Log in</h2><form class="aui top-label prevent-double-submit " action="/j_atl_security_check" method="post" accept-charset="UTF-8"><div class="field-group"><label for="j_username" >Username</label><input class="text long-field" type="text" id="j_username" name="j_username" autofocus accesskey="u"/></div><div class="field-group"><label for="j_password" >Password</label><input class="text long-field" type="password" id="j_password" name="j_password" accesskey="p"/></div><div class="aui-group"><fieldset class="group checkbox"><div class="checkbox"><input class="checkbox" type="checkbox" id="_atl_remember_me" name="_atl_remember_me" checked="checked" accesskey="r"/><label for="_atl_remember_me" >Keep me logged in</label></div></fieldset></div><div class="aui-group"><input name="next" type="hidden" value="/projects/DOCUMENTATION/repos/custom-stk-project/raw/pom.xml?at=refs%2Fheads%2F5.4.x"/><input name="queryString" type="hidden" value="next=%2Fprojects%2FDOCUMENTATION%2Frepos%2Fcustom-stk-project%2Fraw%2Fpom.xml%3Fat%3Drefs%252Fheads%252F5.4.x"/><input class="aui-button aui-button-primary" type="submit" id="submit" name="submit" value="Log in" accesskey="s"/><a id="forgot" class="aui-button aui-button-link" name="forgot" href="/passwordreset" autocomplete="off" tabindex="0">Unable to access your account?</a></div></form></main></div></div></section><!-- End #content --><!-- Start #footer --><footer id="footer" role="contentinfo"><section class="notifications"></section><section class="footer-body"><ul><li data-key="footer.license.message">Git repository management for enterprise teams powered by <a href="https://www.atlassian.com/software/bitbucket/">Atlassian Bitbucket</a></li></ul><ul><li>Atlassian Bitbucket <span title="fdb5904e84ca72e8d62953007cf5cf6cfcdfebd8" id="product-version" data-commitid="fdb5904e84ca72e8d62953007cf5cf6cfcdfebd8" data-system-build-number="fdb5904"> v8.14.0</span></li><li data-key="footer.links.documentation"><a href="https://docs.atlassian.com/bitbucketserver/docs-0814/Bitbucket+Data+Center+and+Server+documentation?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Documentation</a></li><li data-key="footer.links.jac"><a href="https://jira.atlassian.com/browse/BSERV?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Request a feature</a></li><li data-key="footer.links.about"><a href="/about">About</a></li><li data-key="footer.links.contact.atlassian"><a href="https://www.atlassian.com/company/contact?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Contact Atlassian</a></li></ul><div id="footer-logo"><a href="https://www.atlassian.com/" target="_blank">Atlassian</a></div></section></footer><!-- End #footer --></div><script>require('bitbucket/internal/layout/base/base').onReady(null, "Magnolia Bitbucket" ); require('bitbucket/internal/widget/keyboard-shortcuts/keyboard-shortcuts').onReady();</script><script type="text/javascript">require('bitbucket/internal/page/login/login').onReady();</script></body></html>
Editing custom-stk-project/custom-stk-project-webapp/pom.xml
Add the following snippet to the dependencies
section:
Click here to see the complete file
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Log in - Magnolia Bitbucket</title><script>
window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};window.WRM._unparsedErrors=window.WRM._unparsedErrors||{};
WRM._unparsedData["com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:user-keyboard-shortcuts-enabled.data"]="true";
WRM._unparsedData["com.atlassian.analytics.analytics-client:programmatic-analytics-init.programmatic-analytics-data-provider"]="false";
WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\u0022\u0022";
WRM._unparsedData["com.atlassian.plugins.atlassian-clientside-extensions-runtime:runtime.atlassianDevMode"]="false";
WRM._unparsedData["com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:date-format-preference.data"]="\u0022\u0022";
WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:bitbucket.global.theme.data"]="false";
WRM._unparsedData["com.atlassian.analytics.analytics-client:policy-update-init.policy-update-data-provider"]="false";
WRM._unparsedData["com.atlassian.bitbucket.plugins.bitbucket-slack-server-integration-plugin:slack-link-error-resources.slack-link-error"]="{}";
WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:user.time.zone.onboarding.data"]="true";
if(window.WRM._dataArrived)window.WRM._dataArrived();</script>
<link rel="stylesheet" href="/s/c2e7fb6cb0fa3d99cfd1ed5573a5b732-CDN/-327823861/fdb5904/n1cn5w/a93e8b54a53a5453c42e8c7cfb35551a/_/download/contextbatch/css/_super/batch.css" data-wrm-key="_super" data-wrm-batch-type="context" media="all">
<link rel="stylesheet" href="/s/c3b4ddaba8d3dce9466950696444d252-CDN/-327823861/fdb5904/n1cn5w/80af30e6da65e29f7038393c9f70794e/_/download/contextbatch/css/bitbucket.page.login,-_super/batch.css" data-wrm-key="bitbucket.page.login,-_super" data-wrm-batch-type="context" media="all">
<link rel="stylesheet" href="/s/bf2916eb93ea7ba6a84c3be046c95434-CDN/-327823861/fdb5904/n1cn5w/d519805ac2904ed3b4db29856f637561/_/download/contextbatch/css/bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super/batch.css?slack-enabled=true" data-wrm-key="bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super" data-wrm-batch-type="context" media="all">
<script src="/s/6dcf9aa9352e12dc8dc168ef3f3260eb-CDN/-327823861/fdb5904/n1cn5w/a93e8b54a53a5453c42e8c7cfb35551a/_/download/contextbatch/js/_super/batch.js?locale=en-US" data-wrm-key="_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script src="/s/82aa06bf515f7a4d5c2ce5cd6bfc4c66-CDN/-327823861/fdb5904/n1cn5w/80af30e6da65e29f7038393c9f70794e/_/download/contextbatch/js/bitbucket.page.login,-_super/batch.js?locale=en-US" data-wrm-key="bitbucket.page.login,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script src="/s/da1cafd0ec4c647be47bd070d1c2e7b9-CDN/-327823861/fdb5904/n1cn5w/d519805ac2904ed3b4db29856f637561/_/download/contextbatch/js/bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super/batch.js?locale=en-US&slack-enabled=true" data-wrm-key="bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<meta name="application-name" content="Bitbucket"><link rel="shortcut icon" type="image/x-icon" href="/s/-327823861/fdb5904/n1cn5w/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:favicon/favicon.ico" /><link rel="search" href="https://git.magnolia-cms.com/plugins/servlet/opensearch-descriptor" type="application/opensearchdescription+xml" title="Bitbucket code search"/></head><body class="aui-page-focused aui-page-focused-small aui-page-size-small bitbucket-theme user-login"><script type="text/javascript">require('@bitbucket/internal/feature/theme').init();</script><ul id="assistive-skip-links" class="assistive"><li><a href="#content">Skip to content</a></li></ul><div id="page"><!-- start #header --><header id="header" role="banner"><section class="notifications"></section><nav class="aui-header aui-dropdown2-trigger-group" aria-label="site"><div class="aui-header-inner"><div class="aui-header-before"><button class=" aui-dropdown2-trigger app-switcher-trigger aui-dropdown2-trigger-arrowless" aria-controls="app-switcher" aria-haspopup="true" role="button" data-aui-trigger href="#app-switcher"><span class="aui-icon aui-icon-small aui-iconfont-appswitcher">Linked Applications</span></button><div id="app-switcher" class="aui-dropdown2 aui-style-default" role="menu" hidden data-is-user-admin="false" data-is-switcher="true"><div class="app-switcher-loading">Loading…</div></div></div><div class="aui-header-primary"><span id="logo" class="aui-header-logo bitbucket-header-logo"><a href="https://git.magnolia-cms.com"><img src="/s/-327823861/fdb5904/n1cn5w/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:bitbucket-logo/images/logo/bitbucket.svg" alt="Bitbucket"/></a></span><ul class="aui-nav"></ul></div><div class="aui-header-secondary"><ul class="aui-nav"><li class=" help-link"title="Help"><a class=" aui-dropdown2-trigger aui-dropdown2-trigger-arrowless" aria-controls="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" aria-haspopup="true" role="button" tabindex="0" data-aui-trigger><span class="aui-icon aui-icon-small aui-icon-small aui-iconfont-question-filled">Help</span></a><div id="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" class="aui-dropdown2 aui-style-default" role="menu" hidden data-aui-dom-container="body"><div class="aui-dropdown2-section help-items-section"><ul class="aui-list-truncate" role="presentation"><li role="presentation"><a href="https://docs.atlassian.com/bitbucketserver/docs-0814/Bitbucket+Data+Center+and+Server+documentation?utm_campaign=in-app-help&amp;utm_medium=in-app-help&amp;utm_source=stash" title="Go to the online documentation for Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:general-help">Online help</a></li><li role="presentation"><a href="https://www.atlassian.com/git?utm_campaign=learn-git&utm_medium=in-app-help&utm_source=stash" title="Learn about Git commands & workflows" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:learn-git">Learn Git</a></li><li role="presentation"><a href="/getting-started"class="getting-started-page-link" title="Overview of Bitbucket features" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:getting-started-page-help-link">Welcome to Bitbucket</a></li><li role="presentation"><a href="/#"class="keyboard-shortcut-link" title="Discover keyboard shortcuts in Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:keyboard-shortcuts-help-link">Keyboard shortcuts</a></li><li role="presentation"><a href="https://go.atlassian.com/bitbucket-server-whats-new?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" title="Learn about what's new in Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:whats-new-link">What's new</a></li><li role="presentation"><a href="https://go.atlassian.com/bitbucket-server-community?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" title="Explore the Atlassian community" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:community-link">Community</a></li><li role="presentation"><a href="/about" title="About Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:about">About</a></li></ul></div></div></li><li class=" alerts-menu"title="View system alerts"><a href="#alerts" id="alerts-trigger"class="alerts-menu" title="View system alerts" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:global-alerts-menu-item">Alerts</a></li></ul></div></div> <!-- End .aui-header-inner --></nav> <!-- End .aui-header --></header><!-- End #header --><!-- Start #content --><section id="content" role="main" tabindex="-1" data-timezone="-120" ><div class="aui-page-panel content-body" ><div class="aui-page-panel-inner"><main role="main" id="main" class="aui-page-panel-content" ><h2>Log in</h2><form class="aui top-label prevent-double-submit " action="/j_atl_security_check" method="post" accept-charset="UTF-8"><div class="field-group"><label for="j_username" >Username</label><input class="text long-field" type="text" id="j_username" name="j_username" autofocus accesskey="u"/></div><div class="field-group"><label for="j_password" >Password</label><input class="text long-field" type="password" id="j_password" name="j_password" accesskey="p"/></div><div class="aui-group"><fieldset class="group checkbox"><div class="checkbox"><input class="checkbox" type="checkbox" id="_atl_remember_me" name="_atl_remember_me" checked="checked" accesskey="r"/><label for="_atl_remember_me" >Keep me logged in</label></div></fieldset></div><div class="aui-group"><input name="next" type="hidden" value="/projects/DOCUMENTATION/repos/custom-stk-project/raw/custom-stk-project-webapp/pom.xml?at=refs%2Fheads%2F5.4.x"/><input name="queryString" type="hidden" value="next=%2Fprojects%2FDOCUMENTATION%2Frepos%2Fcustom-stk-project%2Fraw%2Fcustom-stk-project-webapp%2Fpom.xml%3Fat%3Drefs%252Fheads%252F5.4.x"/><input class="aui-button aui-button-primary" type="submit" id="submit" name="submit" value="Log in" accesskey="s"/><a id="forgot" class="aui-button aui-button-link" name="forgot" href="/passwordreset" autocomplete="off" tabindex="0">Unable to access your account?</a></div></form></main></div></div></section><!-- End #content --><!-- Start #footer --><footer id="footer" role="contentinfo"><section class="notifications"></section><section class="footer-body"><ul><li data-key="footer.license.message">Git repository management for enterprise teams powered by <a href="https://www.atlassian.com/software/bitbucket/">Atlassian Bitbucket</a></li></ul><ul><li>Atlassian Bitbucket <span title="fdb5904e84ca72e8d62953007cf5cf6cfcdfebd8" id="product-version" data-commitid="fdb5904e84ca72e8d62953007cf5cf6cfcdfebd8" data-system-build-number="fdb5904"> v8.14.0</span></li><li data-key="footer.links.documentation"><a href="https://docs.atlassian.com/bitbucketserver/docs-0814/Bitbucket+Data+Center+and+Server+documentation?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Documentation</a></li><li data-key="footer.links.jac"><a href="https://jira.atlassian.com/browse/BSERV?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Request a feature</a></li><li data-key="footer.links.about"><a href="/about">About</a></li><li data-key="footer.links.contact.atlassian"><a href="https://www.atlassian.com/company/contact?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Contact Atlassian</a></li></ul><div id="footer-logo"><a href="https://www.atlassian.com/" target="_blank">Atlassian</a></div></section></footer><!-- End #footer --></div><script>require('bitbucket/internal/layout/base/base').onReady(null, "Magnolia Bitbucket" ); require('bitbucket/internal/widget/keyboard-shortcuts/keyboard-shortcuts').onReady();</script><script type="text/javascript">require('bitbucket/internal/page/login/login').onReady();</script></body></html>
Since you are creating a webapp based on the EE pro webapp, you have to make sure that the webapp is configured to use the pro widgetset (see Magnolia widgetsets).
Go to the custom-stk-project-webapp/src/main/webapp/WEB-INF/config/default
folder or create the folder if it doesn't exist yet. Create the magnolia.properties
file there:
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Log in - Magnolia Bitbucket</title><script>
window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};window.WRM._unparsedErrors=window.WRM._unparsedErrors||{};
WRM._unparsedData["com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:user-keyboard-shortcuts-enabled.data"]="true";
WRM._unparsedData["com.atlassian.analytics.analytics-client:programmatic-analytics-init.programmatic-analytics-data-provider"]="false";
WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\u0022\u0022";
WRM._unparsedData["com.atlassian.plugins.atlassian-clientside-extensions-runtime:runtime.atlassianDevMode"]="false";
WRM._unparsedData["com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:date-format-preference.data"]="\u0022\u0022";
WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:bitbucket.global.theme.data"]="false";
WRM._unparsedData["com.atlassian.analytics.analytics-client:policy-update-init.policy-update-data-provider"]="false";
WRM._unparsedData["com.atlassian.bitbucket.plugins.bitbucket-slack-server-integration-plugin:slack-link-error-resources.slack-link-error"]="{}";
WRM._unparsedData["com.atlassian.bitbucket.server.feature-wrm-data:user.time.zone.onboarding.data"]="true";
if(window.WRM._dataArrived)window.WRM._dataArrived();</script>
<link rel="stylesheet" href="/s/c2e7fb6cb0fa3d99cfd1ed5573a5b732-CDN/-327823861/fdb5904/n1cn5w/a93e8b54a53a5453c42e8c7cfb35551a/_/download/contextbatch/css/_super/batch.css" data-wrm-key="_super" data-wrm-batch-type="context" media="all">
<link rel="stylesheet" href="/s/c3b4ddaba8d3dce9466950696444d252-CDN/-327823861/fdb5904/n1cn5w/80af30e6da65e29f7038393c9f70794e/_/download/contextbatch/css/bitbucket.page.login,-_super/batch.css" data-wrm-key="bitbucket.page.login,-_super" data-wrm-batch-type="context" media="all">
<link rel="stylesheet" href="/s/bf2916eb93ea7ba6a84c3be046c95434-CDN/-327823861/fdb5904/n1cn5w/d519805ac2904ed3b4db29856f637561/_/download/contextbatch/css/bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super/batch.css?slack-enabled=true" data-wrm-key="bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super" data-wrm-batch-type="context" media="all">
<script src="/s/6dcf9aa9352e12dc8dc168ef3f3260eb-CDN/-327823861/fdb5904/n1cn5w/a93e8b54a53a5453c42e8c7cfb35551a/_/download/contextbatch/js/_super/batch.js?locale=en-US" data-wrm-key="_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script src="/s/82aa06bf515f7a4d5c2ce5cd6bfc4c66-CDN/-327823861/fdb5904/n1cn5w/80af30e6da65e29f7038393c9f70794e/_/download/contextbatch/js/bitbucket.page.login,-_super/batch.js?locale=en-US" data-wrm-key="bitbucket.page.login,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<script src="/s/da1cafd0ec4c647be47bd070d1c2e7b9-CDN/-327823861/fdb5904/n1cn5w/d519805ac2904ed3b4db29856f637561/_/download/contextbatch/js/bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super/batch.js?locale=en-US&slack-enabled=true" data-wrm-key="bitbucket.layout.focused,bitbucket.layout.base,atl.general,bitbucket.internal.feature.theme,-_super" data-wrm-batch-type="context" data-initially-rendered></script>
<meta name="application-name" content="Bitbucket"><link rel="shortcut icon" type="image/x-icon" href="/s/-327823861/fdb5904/n1cn5w/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:favicon/favicon.ico" /><link rel="search" href="https://git.magnolia-cms.com/plugins/servlet/opensearch-descriptor" type="application/opensearchdescription+xml" title="Bitbucket code search"/></head><body class="aui-page-focused aui-page-focused-small aui-page-size-small bitbucket-theme user-login"><script type="text/javascript">require('@bitbucket/internal/feature/theme').init();</script><ul id="assistive-skip-links" class="assistive"><li><a href="#content">Skip to content</a></li></ul><div id="page"><!-- start #header --><header id="header" role="banner"><section class="notifications"></section><nav class="aui-header aui-dropdown2-trigger-group" aria-label="site"><div class="aui-header-inner"><div class="aui-header-before"><button class=" aui-dropdown2-trigger app-switcher-trigger aui-dropdown2-trigger-arrowless" aria-controls="app-switcher" aria-haspopup="true" role="button" data-aui-trigger href="#app-switcher"><span class="aui-icon aui-icon-small aui-iconfont-appswitcher">Linked Applications</span></button><div id="app-switcher" class="aui-dropdown2 aui-style-default" role="menu" hidden data-is-user-admin="false" data-is-switcher="true"><div class="app-switcher-loading">Loading…</div></div></div><div class="aui-header-primary"><span id="logo" class="aui-header-logo bitbucket-header-logo"><a href="https://git.magnolia-cms.com"><img src="/s/-327823861/fdb5904/n1cn5w/1.0/_/download/resources/com.atlassian.bitbucket.server.bitbucket-webpack-INTERNAL:bitbucket-logo/images/logo/bitbucket.svg" alt="Bitbucket"/></a></span><ul class="aui-nav"></ul></div><div class="aui-header-secondary"><ul class="aui-nav"><li class=" help-link"title="Help"><a class=" aui-dropdown2-trigger aui-dropdown2-trigger-arrowless" aria-controls="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" aria-haspopup="true" role="button" tabindex="0" data-aui-trigger><span class="aui-icon aui-icon-small aui-icon-small aui-iconfont-question-filled">Help</span></a><div id="com.atlassian.bitbucket.server.bitbucket-server-web-fragments-help-menu" class="aui-dropdown2 aui-style-default" role="menu" hidden data-aui-dom-container="body"><div class="aui-dropdown2-section help-items-section"><ul class="aui-list-truncate" role="presentation"><li role="presentation"><a href="https://docs.atlassian.com/bitbucketserver/docs-0814/Bitbucket+Data+Center+and+Server+documentation?utm_campaign=in-app-help&amp;utm_medium=in-app-help&amp;utm_source=stash" title="Go to the online documentation for Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:general-help">Online help</a></li><li role="presentation"><a href="https://www.atlassian.com/git?utm_campaign=learn-git&utm_medium=in-app-help&utm_source=stash" title="Learn about Git commands & workflows" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:learn-git">Learn Git</a></li><li role="presentation"><a href="/getting-started"class="getting-started-page-link" title="Overview of Bitbucket features" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:getting-started-page-help-link">Welcome to Bitbucket</a></li><li role="presentation"><a href="/#"class="keyboard-shortcut-link" title="Discover keyboard shortcuts in Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:keyboard-shortcuts-help-link">Keyboard shortcuts</a></li><li role="presentation"><a href="https://go.atlassian.com/bitbucket-server-whats-new?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" title="Learn about what's new in Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:whats-new-link">What's new</a></li><li role="presentation"><a href="https://go.atlassian.com/bitbucket-server-community?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" title="Explore the Atlassian community" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:community-link">Community</a></li><li role="presentation"><a href="/about" title="About Bitbucket" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:about">About</a></li></ul></div></div></li><li class=" alerts-menu"title="View system alerts"><a href="#alerts" id="alerts-trigger"class="alerts-menu" title="View system alerts" data-web-item-key="com.atlassian.bitbucket.server.bitbucket-server-web-fragments:global-alerts-menu-item">Alerts</a></li></ul></div></div> <!-- End .aui-header-inner --></nav> <!-- End .aui-header --></header><!-- End #header --><!-- Start #content --><section id="content" role="main" tabindex="-1" data-timezone="-120" ><div class="aui-page-panel content-body" ><div class="aui-page-panel-inner"><main role="main" id="main" class="aui-page-panel-content" ><h2>Log in</h2><form class="aui top-label prevent-double-submit " action="/j_atl_security_check" method="post" accept-charset="UTF-8"><div class="field-group"><label for="j_username" >Username</label><input class="text long-field" type="text" id="j_username" name="j_username" autofocus accesskey="u"/></div><div class="field-group"><label for="j_password" >Password</label><input class="text long-field" type="password" id="j_password" name="j_password" accesskey="p"/></div><div class="aui-group"><fieldset class="group checkbox"><div class="checkbox"><input class="checkbox" type="checkbox" id="_atl_remember_me" name="_atl_remember_me" checked="checked" accesskey="r"/><label for="_atl_remember_me" >Keep me logged in</label></div></fieldset></div><div class="aui-group"><input name="next" type="hidden" value="/projects/DOCUMENTATION/repos/custom-stk-project/raw/custom-stk-project-webapp/src/main/webapp/WEB-INF/config/default/magnolia.properties?at=refs%2Fheads%2F5.4.x"/><input name="queryString" type="hidden" value="next=%2Fprojects%2FDOCUMENTATION%2Frepos%2Fcustom-stk-project%2Fraw%2Fcustom-stk-project-webapp%2Fsrc%2Fmain%2Fwebapp%2FWEB-INF%2Fconfig%2Fdefault%2Fmagnolia.properties%3Fat%3Drefs%252Fheads%252F5.4.x"/><input class="aui-button aui-button-primary" type="submit" id="submit" name="submit" value="Log in" accesskey="s"/><a id="forgot" class="aui-button aui-button-link" name="forgot" href="/passwordreset" autocomplete="off" tabindex="0">Unable to access your account?</a></div></form></main></div></div></section><!-- End #content --><!-- Start #footer --><footer id="footer" role="contentinfo"><section class="notifications"></section><section class="footer-body"><ul><li data-key="footer.license.message">Git repository management for enterprise teams powered by <a href="https://www.atlassian.com/software/bitbucket/">Atlassian Bitbucket</a></li></ul><ul><li>Atlassian Bitbucket <span title="fdb5904e84ca72e8d62953007cf5cf6cfcdfebd8" id="product-version" data-commitid="fdb5904e84ca72e8d62953007cf5cf6cfcdfebd8" data-system-build-number="fdb5904"> v8.14.0</span></li><li data-key="footer.links.documentation"><a href="https://docs.atlassian.com/bitbucketserver/docs-0814/Bitbucket+Data+Center+and+Server+documentation?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Documentation</a></li><li data-key="footer.links.jac"><a href="https://jira.atlassian.com/browse/BSERV?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Request a feature</a></li><li data-key="footer.links.about"><a href="/about">About</a></li><li data-key="footer.links.contact.atlassian"><a href="https://www.atlassian.com/company/contact?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash" target="_blank">Contact Atlassian</a></li></ul><div id="footer-logo"><a href="https://www.atlassian.com/" target="_blank">Atlassian</a></div></section></footer><!-- End #footer --></div><script>require('bitbucket/internal/layout/base/base').onReady(null, "Magnolia Bitbucket" ); require('bitbucket/internal/widget/keyboard-shortcuts/keyboard-shortcuts').onReady();</script><script type="text/javascript">require('bitbucket/internal/page/login/login').onReady();</script></body></html>
Step 5: Building the webapp with Maven
Now you are ready to build the webapp with Maven. Open a shell, go to the custom-stk-project/custom-stk-project-webapp/
directory and execute:
Alternatively, go to the
custom-stk-project/
directory and execute:
mvn clean install -am -pl custom-stk-project-webapp
Either way should result in:
Congratulations! Your webapp is finished.

You can start it from your IDE for further development.
For a production environment consider using a different persistence layer instead of the embedded H2. When deploying the webapp as WAR you should at least change the path to the repository. You can also add another module to your project to create an artifact which bundles Tomcat or another servlet container with your webapp.
Adapting a webapp manually
This section explains how you can adapt a webapp by adding (and removing) JAR files to make sure it contains the STK modules. The aim is, again, to end up with an enterprise PRO webapp with the STK modules.
The base artifact: magnolia-enterprise-pro-demo-bundle
Start with a preconfigured artifact provided by Magnolia. This time take a complete bundle which comes together with Tomcat. Tomcat bundles are first-choice artifacts for quick testing scenarios or for users who do not want to invest in custom Maven setups.
Download
, copy it to a folder of your choice, unzip it, but do not start the bundle yet.
Adapting webapps/magnoliaAuthor/WEB-INF/lib
Open the magnolia-enterprise-<x.y>/apache-tomcat-7.0.64/webapps/magnoliaAuthor/WEB-INF/lib
folder. It contains the JAR files whose content you will adapt. Note that the webapps
folder – at this moment, before the bundle has been started for the first time – contains only one complete webapp: magnoliaAuthor
. During the first start, the start script will copy the WEB-INF
folder to the magnoliaPublic
folder. That's why both webapps will contain the same modules (and JAR files).
Be aware of transient dependencies
Magnolia modules often have dependencies to other Magnolia modules or to modules provided by third-party providers. When manually tailoring a webapp, you have to make sure that the library files for the dependent modules are also provided.
Removing travel-demo's JAR files
Since we start with magnolia-enterprise-pro-demo-bundle
, we have to get rid of the Magnolia travel demo modules. The bundle cannot contain both demo projects. Therefore, remove the following JAR files from the webapps/magnoliaAuthor/WEB-INF/lib
folder (all JAR files beginning with magnolia-travel*
):
( x.y
is a placehol.)
Adding STK module's JAR files
Now add the following JAR files to the webapps/magnoliaAuthor/WEB-INF/lib
folder:
Starting the bundle
Now the bundle is ready to be started the first time.
With CLI
Go to the parent directory of the
apache-tomcat
directory and execute the Magnolia CLI
start
command:
When starting for the first time, Magnolia runs a web update and automatically installs all its modules.
Without CLI
Open a shell and go to the bin directory of your Magnolia Tomcat bundle. If you installed the bundle from a ZIP file,
cd
to
magnolia-x.y/apache-tomcat-x.y/bin. If you installed the Magnolia bundle with
Magnolia CLI jumpstart,
cd
to
apache-tomcat/bin.
Execute the start command:
./magnolia_control.sh start
Note: If you get an error due to a low "max open files" limit, try executing the command with the --ignore-open-files-limit
option:
./magnolia_control.sh start --ignore-open-files-limit
Detailed instructions:
Mac OS X
- Open a terminal window in Applications > Utilities > Terminal.
Go to the Magnolia installation directory
cd /Applications/magnolia-x.y/apache-tomcat/bin
Start Magnolia.
./magnolia_control.sh start && tail -f ../logs/catalina.out
The first part of the startup command ./magnolia_control.sh start
launches Magnolia. The second part && tail -f ../logs/catalina.out
displays log messages written to /apache-tomcat/logs/catalina.out
log file. This makes it easier to troubleshoot startup errors.
Magnolia reports startup information. If startup fails, look for the reason in the report. In a successful startup the last line reads:
INFO: Server startup in 12345 ms
.
Windows
- Open a command prompt and go to the Magnolia installation directory.
(To do this, type cd C:\Users\<username>\magnolia-x.y\apache-tomcat\bin
) - Type
magnolia_control.bat start
and press ENTER.
Magnolia reports startup information in a new Tomcat window. If startup fails, look for the reason in the report. In a successful startup the last line reads: INFO: Server startup in 12345 ms
Linux
- Open a terminal window.
- Go to the Magnolia installation directory:
cd /home/<your account>/magnolia-x.y/apache-tomcat/bin
Your path may be different. - Start Magnolia:
./magnolia_control.sh start && tail -f ../logs/catalina.out
The first part of the startup command ./magnolia_control.sh start
launches Magnolia. The second part && tail -f ../logs/catalina.out
displays log messages written to /apache-tomcat/logs/catalina.out
log file. This makes it easier to troubleshoot startup errors.
Magnolia reports startup information. If startup fails, look for the reason in the report. In a successful startup the last line reads:
INFO: Server startup in 12345 ms
Solaris
- Open a terminal window.
- Go to the Magnolia installation directory:
cd /home/userAccount/magnolia-x.y/apache-tomcat/bin
Your path may be different. - Start Magnolia:
./magnolia_control.sh start && tail -f ../logs/catalina.out
The first part of the startup command ./magnolia_control.sh start
launches Magnolia. The second part && tail -f ../logs/catalina.out
displays log messages written to /apache-tomcat/logs/catalina.out
log file. This makes it easier to troubleshoot startup errors.
Magnolia reports startup information. If startup fails, look for the reason in the report. In a successful startup the last line reads:
INFO: Server startup in 12345 ms
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))