Movatterモバイル変換


[0]ホーム

URL:


BloomreachBloomreach
Hippo CMS

Bloomreach Documentation version

Bloomreach.com

Develop with Eclipse

This documentation describes the use of a third-party development tool and is maintained by Bloomreach on a best-effort basis. Bloomreach cannot guarantee this documentation is up to date with the latest release of the third-party development tool. Please refer to the documentation of the third-party development tool for the latest installation, configuration, and usage instructions.

Introduction

Goal

Use the Eclipse IDE to work on Bloomreach Experience Manager implementation projects.

Background

Eclipse integrates with Maven to enable creating, building, running and debugging projects within the IDE.

This documentation has been verified using Eclipse Java EE IDE for Web Developers, version 2018-09 (4.9.0).

Eclipse Plugins

Maven Integration for Eclipse

Maven Integration for Eclipse is required to work with Bloomreach Experience Manager projects in Eclipse. It comes pre-installed with theEclipse for Java EE Developers package, which we recommend you use.

Freemarker Plugin

A Freemarker Plugin for Eclipse is available as part of the JBoss Tools Project and can be installed separately.

  1. ChooseHelp > Eclipse Marketplace.
  2. Search for "Freemarker".
  3. Under "Freemarker IDE from JBoss Tools", chooseInstall.
  4. A tree of checkboxes will appear, uncheck all (by unchecking the root) exceptFreeMarker IDE.

YEdit Plugin

It is recommended to install YEdit for editing your repository data YAML files.

  1. ChooseHelp > Eclipse Marketplace.
  2. Search for "YEdit".
  3. ChooseInstall.

Create a New Bloomreach Experience Manager Project

  1. ChooseFile > New > Maven Project.
  2. Optionally specify a non-default project location and/or a working set.
  3. ChooseNext.
    If this is the first time you create a Bloomreach Experience Manager project in Eclipse, you must first chooseAdd Archetype... and enter the Bloomreach Experience Manager Maven archetype coordinates:
    Archetype Group Id: org.onehippo.cms7
    Archetype Artifact Id: hippo-project-archetype
    Archetype Version: 13.0.0 (or the latest version)
    Repository URL:https://maven.bloomreach.com/repository/maven2/ (or https://maven.bloomreach.com/repository/maven2-enterprise/ if you hold an enterprise license)
  4. AtCatalog chooseNexus Indexer.
  5. Choose the archetype withGroup Idorg.onehippo.cms7 andArtifact Idhippo-project-archetype.

    The latest version of the archetype is automatically selected. To select an earlier version, uncheckShow the last version of Archetype only.
  6. ChooseNext.
  7. Enter aGroup Id,Artifact Id,Version andPackage for the new project.
  8. ChooseFinish to generate the project.

Import an Existing Bloomreach Experience Manager Project

  1. ChooseFile > Import....
  2. SelectMaven > Existing Maven Projects.
  3. ChooseNext.
  4. Browse to the root directory of your project.
  5. Optionally add the project to a working set.
  6. ChooseFinish to import the project.

Run or Debug a Bloomreach Experience Manager Project on a Tomcat Server within Eclipse

  1. First prepare a local Tomcat installation:
    1. Download Tomcat 9 and install it on your development machine. Do not run it yet, you will do this from within Eclipse later on.
    2. Build andrun your Bloomreach Experience Manager project from the command line. Once it is running, stop it by pressing Ctrl+C.
    3. Copy the following files from your project'starget/tomcat9x folder to your Tomcat installation (use the exact same folder hierarchy and replace existing files):
      1. common/lib/*.jar
      2. shared/lib/*.jar except your project'srepository-data-development and repository-data-site-development jars (e.g.myproject-repository-data-development-1.0.0.jar & myproject-repository-data-site-development-1.0.0.jar).
      3. conf/context.xml
      4. conf/catalina.properties
  2. Configure the Tomcat Server in Eclipse:
    1. ChooseFile > New > Other, selectServer > Server and chooseNext.
    2. SelectApache > Tomcat v9.0 Server and chooseNext.
    3. SetTomcat installation directory to the location of your local Tomcat installation prepared in step 1, and chooseNext.
    4. Select thecms,essentials andsite modules of your project in theAvailable column and add them to theConfigured column, and chooseFinish.
    5. ChooseWindow > Show View > Servers.
    6. Double-click to openTomcat v9.0 Server at localhost.
    7. UnderGeneral Information click onOpen launch configuration.
    8. Select theArguments tab and add the following arguments to those already there in theVM arguments box (use the appropriate paths for your situation):

      -Dderby.stream.error.file="/Users/hippo/apache-tomcat-9.0.13/logs/derby.log"-Dlog4j.configurationFile=file:/Users/hippo/workspace/myproject/conf/log4j2-dev.xml-Dproject.basedir=/Users/hippo/workspace/myproject-Drepo.path=/Users/hippo/workspace/myproject/storage-Xms256m -Xmx1024m
    9. UnderServer Locations select the optionUse Tomcat installation (takes control of Tomcat installation).
    10. UnderTimeouts raise theStart timeout to200.
    11. ChooseFile > Save to save the server configuration.
  3. Configure thecms application to include therepository-data-development module in its deployment assembly:
    1. Right click on your project'scms module (e.g.myproject-cms) and selectProperties.
    2. SelectDeployment Assembly.
    3. Click onAdd.
    4. SelectProject and click onNext.
    5. Select your project'srepository-data-development module (e.g.myproject-repository-data-development) and click onFinish.
    6. ClickApply and Close.
  4. Configure thesite web application to include therepository-data-site-development module in its deployment assembly:
    1. Right click on your project'swebapp module (e.g.myproject-webapp) and selectProperties.
    2. SelectDeployment Assembly.
    3. Click onAdd.
    4. SelectProject and click onNext.
    5. Select your project'srepository-data-site-development module (e.g.myproject-repository-data-site-development) and click onFinish.
    6. ClickApply and Close.
  5. Configure therepository-data-webfiles module not to be auto-redeployed by Eclipse (web files are automatically synchronized by the Bloomreach Experience Manager application):
    1. Right click on your project'srepository-data-webfiles module (e.g.myproject-repository-data-webfiles) and selectProperties.
    2. SelectDeployment Assembly.
    3. There should be one entry:src/main/resources. Remove it so the list is empty.
    4. ClickApply and Close.
  6. Configure the context root of the site webapp:
    1. Right click on your project'swebapp module (e.g.myproject-webapp) and selectProperties.
    2. SelectWeb Project Settings.
    3. ChangeContext root fromsite to your project name, e.g.myproject.
  7. To run your Bloomreach Experience Manager project on the Tomcat server click on the Run icon in theServers view.
  8. To debug your Bloomreach Experience Manager project on the Tomcat server click on the Debug icon in theServers view.
Running your Bloomreach Experience Manager project this way enables all IDE features including automatic compilation and redeployment of your code!
The above instructions are based on'Tutorial: setup Eclipse workspace for Hippo CMS' by Bart Vreeken.

Troubleshooting

If Tomcat won't start because of:

java.lang.NoClassDefFoundError: Lorg/slf4j/Logger

Then you either did not copy the shared folder correctly, or you did not copy the conf/catalina.properties correctly.

Debug a Bloomreach Experience Manager Project Running Outside Eclipse

If you choose torun your Bloomreach Experience Manager project from the command line, you can still use Eclipse for debugging by attaching its debugger to the running application.

  1. ChooseRun > Debug Configurations...
  2. SelectRemote Java Application and click on theNew launch configuration icon in the top left corner of the dialog.
  3. Enter aName for this debug configuration.
  4. On theConnect tab, atProject browse to the project you want to debug. Typically this is thewebapp module, e.g.myproject-webapp.
  5. Make surePort is set to8000.
  6. ChooseApply to save the debug configuration.
  7. ChooseDebug to attach de Eclipse debugger to the running application.

If you now set breakpoints in your code Eclipse will open the debug perspective when your application executes that code.

Did you find this page helpful?
How could this documentation serve you better?
Cheers!
On this page
    Did you find this page helpful?
    How could this documentation serve you better?
    Cheers!

    [8]ページ先頭

    ©2009-2025 Movatter.jp