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

Compare with Current View Page History

Version 1 Next »


Create a Magnolia webapp project from a template:

mvn archetype:generate -DarchetypeGroupId=info.magnolia.maven.archetypes -DarchetypeArtifactId=magnolia-project-archetype -DarchetypeVersion=RELEASE

ghost@theMachine pscu % mvn archetype:generate -DarchetypeGroupId=info.magnolia.maven.archetypes -DarchetypeArtifactId=magnolia-project-archetype -DarchetypeVersion=RELEASE
[INFO] Scanning for projects...
Downloading from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/apache/maven/plugins/maven-metadata.xml
Downloading from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/sonatype/plugins/maven-metadata.xml
Downloading from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/codehaus/mojo/maven-metadata.xml
Downloaded from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/apache/maven/plugins/maven-metadata.xml (14 kB at 30 kB/s)
Downloaded from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/sonatype/plugins/maven-metadata.xml (5.0 kB at 10 kB/s)
Downloaded from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/codehaus/mojo/maven-metadata.xml (24 kB at 45 kB/s)
Downloading from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml
Downloaded from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml (1.1 kB at 20 kB/s)
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.2.0:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.2.0:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.2.0:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [info.magnolia.maven.archetypes:magnolia-project-archetype:1.1.0 -> https://nexus.magnolia-cms.com/content/groups/staff] found in catalog remote
Downloading from magnolia-project-archetype-repo: https://nexus.magnolia-cms.com/content/groups/staff/info/magnolia/maven/archetypes/magnolia-project-archetype/maven-metadata.xml
Downloading from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/info/magnolia/maven/archetypes/magnolia-project-archetype/maven-metadata.xml
Downloaded from magnolia.nexus: https://nexus.magnolia-cms.com/content/groups/staff/info/magnolia/maven/archetypes/magnolia-project-archetype/maven-metadata.xml (688 B at 3.0 kB/s)
[WARNING] Could not transfer metadata info.magnolia.maven.archetypes:magnolia-project-archetype/maven-metadata.xml from/to magnolia-project-archetype-repo (https://nexus.magnolia-cms.com/content/groups/staff): authentication failed for https://nexus.magnolia-cms.com/content/groups/staff/info/magnolia/maven/archetypes/magnolia-project-archetype/maven-metadata.xml, status: 401 Unauthorized
[WARNING] info.magnolia.maven.archetypes:magnolia-project-archetype/maven-metadata.xmlfailed to transfer from https://nexus.magnolia-cms.com/content/groups/staff during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of magnolia-project-archetype-repo has elapsed or updates are forced. Original error: Could not transfer metadata info.magnolia.maven.archetypes:magnolia-project-archetype/maven-metadata.xml from/to magnolia-project-archetype-repo (https://nexus.magnolia-cms.com/content/groups/staff): authentication failed for https://nexus.magnolia-cms.com/content/groups/staff/info/magnolia/maven/archetypes/magnolia-project-archetype/maven-metadata.xml, status: 401 Unauthorized


Set your project properties (these can be whatever you want):

Define value for property 'groupId': com.pscu
Define value for property 'artifactId': test
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' com.pscu: :
Define value for property 'magnolia-bundle-version': 6.2.11
Define value for property 'project-name' test: :
Confirm properties configuration:
groupId: com.pscu
artifactId: test
version: 1.0-SNAPSHOT
package: com.pscu
magnolia-bundle-version: 6.2.11
project-name: test
 Y: :

[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: magnolia-project-archetype:RELEASE
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.pscu
[INFO] Parameter: artifactId, Value: test
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.pscu
[INFO] Parameter: packageInPathFormat, Value: com/pscu
[INFO] Parameter: magnolia-bundle-version, Value: 6.2.11
[INFO] Parameter: package, Value: com.pscu
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: com.pscu
[INFO] Parameter: project-name, Value: test
[INFO] Parameter: artifactId, Value: test
[INFO] Parent element not overwritten in /Users/ghost/pscu/test/test-webapp/pom.xml
[INFO] Project created from Archetype in dir: /Users/ghost/pscu/test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:47 min
[INFO] Finished at: 2021-09-02T13:20:23+02:00
[INFO] ------------------------------------------------------------------------
ghost@theMachine pscu %

Edit the POM files as follows:

  • for the parent POM, choose option B
  • for the webapp POM, choose option iv

    Here's a patch file, if it helps: diff.patch.


Build the project:


If you encounter any build problems, try renaming your $HOME/.m2/settings.xml and then using this one instead.  You'll have to rename it to settings.xml.

mvn clean install

If you are using Eclipse, there are some additional steps you must take before running the project

  1. cd training-webapp 
  2. mvn war:inplace 
  3. You MUST use a v7 of Tomcat - v8.x and v9.x DO NOT WORK with Eclipse.  For example: https://tomcat.apache.org/download-70.cgi#7.0.93


Run the project:

  • Instructions for IntelliJ

    Import the maven project

    1. Click Import Project.
    2. Browse to the folder where your parent pom is.  Click Open.
    3. Check Search for projects recursively. Click Next.
    4. Nothing to change on Select profiles. Click Next.
    5. For Select Maven projects to import, click Unselect all, then check: com.magnolia-cms:training:1.0-SNAPSHOT.
    6. Nothing else to change ... just keep clicking Next.
    7. Click OK.
    8. Click Finish.

    Configure the server

    1. From the Run menu, select Edit Configurations...
    2. Add a new local Tomcat Server configuration.

      You may to select xx items more from the bottom of the list if you don't see a tomcat option.


    3. On Run/Debug Configurations define the following:
      1. Uncheck 'After launch'
    4. Click Fix button. Select training-webapp:war exploded.
    5. On the Deployment tab set the Application context: training
    6. Click Apply then click OK
    7. Run it!
    8. Install it!

    1. Enter the License Information (see below)
  • Instructions for Eclipse

    Import the maven project

    1. Browse to the folder above where your parent pom is.  For example, if your parent pom is in ~/eclipse-training/training, browse to ~/eclipse-training.  Click Launch.
    2. From the Project Explorer, right-click, and select Import > Import.
    3. Select Import Existing Maven Projects.
    4. Select the training project as the Root Directory and click Finish.

    Configure the server

    1. On the Servers tab, click the link to create a new server.

    2. For server type, select an installed Tomcat - For example, v7.0.  Remember: v8.x and v9.x will NOT WORK WITH ECLIPSE.

    1. Browser to the tomcat server and click Finish.

    2. Double-click on the server you just created to open the Overview - change the Timeouts from 45 to 450 and 15 to 150 and Check Serve modules without publishing.


    1. Save the configuration (Ctrl-s or so).
    2. Right click the server configuration and Select Add and Remove, select training-webapp, click Add and then Finish.

    1. Run it!
    2. Install it!
    3. Enter the License Information (see below)



License Information:

License owner: training-prodyna@magnolia-cms.com
License key:
LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tClZlcnNpb246IEJDUEcgdjEuNTgKCm93SjRuSnZBeTh6RXhDaWIrdkg3dFNBbkRzYlRCNWlUdUhQVDgzSnlNcE5UODRwVFk4b01ueW1IcDZZb3VLVW0KS1JpWkt4aVlXNW1ZV0ptYUtEaTdoaWdZR1JoYWNwV2xGaFZuNXVjVjIwYWI2Um5vR2VpWWc4aG9ydnp5dk5RaQoyNUtpeE15OHpMeDAzWUtpL0pUS3ZFU0gzTVQwdlB5Y3pFVGQ1TnhpdmVUOFhLN1Vpb0xNb3NRU29BbTJJT04wCkRVeDBqUTI0Y3ZOVFNuTlNpMjFUODBwU2l3cUtNb3RUdVZKVE1rdkE5aURFUUthbXBSYURyRS9NMFVGUzJ6R0gKaFltUmlZR05sUW5rZmdZdVRnR1lCMjJ0bVA4S1B3L3M2SGZ2K2FlMjRadWVSTzFjc2I2RzQwL2Z4RHlmL0haeQpSTVh5Z2l6RERaZk1YcDB5My95YWdUVlEvV2loY2UyRlR0WU1tL3JvOUpXaG1kVi9IZHVmMWQ0N2JsVDVUVHMrCk1VNDNnTVdFOTFQZXVkaDRwUzFOVEJPdHQ5UndOYjR0ZmQ5ZzZEOUxObkRYdnBXZnpING5palgwbm5qd3lxcHAKOTdTbnVvc1dTRzYzbFFRQUtEeVE5QT09Cj03bURNCi0tLS0tRU5EIFBHUCBNRVNTQUdFLS0tLS0K


  • No labels