Migrate to Google Cloud Tools for IntelliJ

This document describes how to migrate your IntelliJ-based App Engine project to Cloud Tools for IntelliJ.

Before you begin

  • If your project is Maven or Gradle based and uses the older App Engine SDK based plugins (e.g. com.google.appengine.appengine-maven-plugin and com.google.appengine:gradle-appengine-plugin), you should first migrate to the new Cloud SDK based Maven and Gradle plugins.

  • The new plugin does not support Datanucleus enhancement. If you depend on this feature, you will have to manually configure Datanucleus (JDO, JPA) enhancement for your project to migrate to Cloud Tools for IntelliJ. You should use Objectify as your ORM layer when reading/writing to Cloud Datastore.

  • Install the latest Google Cloud SDK

  • Install the App Engine Java component by running the following command locally in your terminal:

      gcloud components install app-engine-java
    

Install the new plugin

To install the plugin, do the following:

  1. From inside IDEA, open File > Settings. Or, on Mac OS X, open IntelliJ IDEA > Preferences.
  2. In the navigation pane, select Plugins.
  3. Click Browse repositories.
  4. In the dialog that opens, select Google Cloud Tools.
  5. Click Install.
  6. Click Close.
  7. Click OK in the Settings dialog.
  8. Click Restart.
  9. Configure the Cloud SDK location:
    1. Open File > Settings or on Mac OS X open IntelliJ IDEA > Preferences.
    2. Choose Google > Cloud SDK or Other Settings > Google > Cloud SDK.
    3. Browse to the location where you installed the Cloud SDK. If you aren't sure where you installed it, you can run gcloud info to display its location if you used the interactive installer or added it to your environment's PATH variable.
  10. Configure the project JDK:
    1. Open File > Project Structure or on Mac OS X open IntelliJ IDEA > Project Structure.
    2. Choose Project Settings > Project.
    3. If the Project SDK is missing, click New... and choose a JDK.

Configure IntelliJ and your project

After installing the plugin, configure IntelliJ and your project to use the new plugin as follows:

  1. When notified that the new plugin conflicts with the existing App Engine integration, accept the prompt to disable the old plugin.

    Screenshot showing notification that the plugin conflicts and the
 prompt to disable it.

  2. Restart IntelliJ.

  3. When notified that your project is in an old format, click the option to Convert your project to the new format.

    Screenshot showing notification that the project is in old format and
 the prompt to convert it.

  4. You should delete your existing App Engine Server and Cloud instances and recreate them using the new Cloud SDK.

    1. Navigate to Settings -> Build, Execution, Deployment -> Application Servers.

    2. Select your AppEngine Dev instances and click Delete (-).

    3. Click Add (+) and select Google App Engine Dev Server. Make sure it’s configured with the path to your Cloud SDK directory.

      Screenshot showing list of app servers and the
 icon to delete and add them.

    4. Navigate to Settings -> Build, Execution, Deployment -> Clouds.

    5. Select your Google App Engine cloud instances and click Delete (-).

    6. Click Add (+) to configure an App Engine cloud deployment target.

      Screenshot showing list of cloud instances and
 the icons to delete and add them.

  5. If you have any App Engine local server run configurations, then you must update them to use the newly configured Application Server.

  6. Navigate to Tools -> Google Cloud Tools to see the list of actions available to you for running and deploying your application, or view the documentation for more information.

  7. For Maven or Gradle-based projects, ensure that you are using the latest version of the Gradle and Maven App Engine plugins.

Configuring native IntelliJ projects

For native IntelliJ projects only (i.e., projects that have manually configured project settings with the old App Engine facet and are not synced from Gradle or Maven), update your App Engine dependencies.

Your App Engine dependencies are still configured as ‘External Libraries’ and provided by your old App Engine SDK installation. If you delete your App Engine SDK installation, your application will not compile.

Screenshot showing list of external libraries.

To remove this dependency on the old App Engine SDK, configure your App Engine API dependencies using the App Engine Facet library import feature as follows:

  1. Users of the old plugin’s Datanucleus JDO/JPA enhancement feature need to port their applications to Maven or Gradle as Datanucleus enhancement is not supported by the Cloud Tools for IntelliJ plugin.

  2. From the IntelliJ Project Structure UI, navigate to your App Engine Standard module’s dependencies tab.

  3. Remove all App Engine related libraries.

    Screenshot showing list of external libraries and
 the icons to delete them.

  4. In the same Project Structure UI, navigate to your App Engine module’s Google App Engine facet.

  5. In the Libraries panel, select the App Engine dependencies you are using.

    Screenshot showing list of libraries available for selection.

    This action will automatically retrieve these dependencies from Maven Central and add them to your module classpath.

  6. Run locally and deploy to verify your new configuration is working.

  7. At this point, you can safely delete your old App Engine SDK.

What's next

  • Explore the plugin code and report issues on GitHub.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Tools for IntelliJ