Skip to main content
Version: 8.7.x

Set up IntelliJ IDEA

Optional

This step is optional, but Elastic Path recommends it. You can build and run Self-Managed Commerce from the command line without an IDE.

Elastic Path recommends IntelliJ IDEA.

Import the Source Code​

  1. In the IntelliJ menu, select File > Open.
  2. Go to the root directory of the source code, for example ~/git/ep-commerce.
  3. Click Open.
  4. Wait for the project to load and for indexing to complete.

Set the Project SDK​

IntelliJ must use the Java 17 JDK. If IntelliJ uses a different JDK, Java classes do not resolve and you see this error:

Unable to provision, see the following errors:

1) Error in custom provider, java.lang.TypeNotPresentException: Type org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant not present
at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:4.0.0, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
while locating org.apache.maven.AbstractMavenLifecycleParticipant annotated with @com.google.inject.name.Named(value="TychoMavenLifecycleListener")

1 error
  1. Right-click the root project, ep-commerce [commerce-parent].
  2. Click Open Module Settings.
  3. Go to Project Settings > Project.
  4. Set SDK to zulu-17.
  5. Right-click the root pom.xml and select Maven > Reload Project.

Configure Maven in IntelliJ​

  1. In the IntelliJ menu, select IntelliJ IDEA > Settings.
  2. Go to Build, Execution, Deployment > Build Tools > Maven.
  3. Set Maven home path to Bundled (Maven 3). Make sure that the Version field shows 3.9.1 or later.
  4. Go to Importing.
  5. Set VM Options for importer to -Xmx3G.
  6. Set JDK for importer to zulu-17.

Turn off Deprecation Warnings​

Deprecation warnings can cause build errors in IntelliJ.

  1. In the IntelliJ menu, select IntelliJ IDEA > Settings.
  2. Go to Build, Execution, Deployment > Compiler > Java Compiler.
  3. Under Javac Options, clear Report use of deprecated features.

Import the Code Style​

The Elastic Path code style formats code to the Elastic Path standard.

  1. In the IntelliJ menu, select IntelliJ IDEA > Settings.
  2. Go to Editor > Code Style.
  3. Click the gear icon next to the scheme and select Import Scheme > IntelliJ IDEA code style XML.
  4. Select devops/intellij/code-style.xml in the ep-commerce source code.

IntelliJ Code Style import

Install the Cucumber Plugins​

Self-Managed Commerce tests use Cucumber feature files.

  1. In the IntelliJ menu, select IntelliJ IDEA > Settings.
  2. Go to Plugins.
  3. Make sure that Cucumber for Java and Gherkin are on the Installed tab. If a plugin is missing, find it on the Marketplace tab and click Install.
  4. Select File > Invalidate Caches and click Invalidate and Restart.
  5. Select File > File Properties > Associate with File Type.
  6. Enter the file pattern *.feature, select Cucumber Scenario, and click OK.

Next Step​

Building Self-Managed Commerce.