1

I am developing a plugin for IntelliJ as part of a larger research team. The logic for the plugin was developed and tested as a Java project in IntelliJ IDEA. Now the time has come to develop the front end, and the module is not configured as a plugin. How should I go about converting the Java project to a plugin project?

It is not reasonable to start the project over as a plugin project, because it has complex dependencies on several other modules.

This is a similar question to how to import existing plugins, but is different because the code is not a plugin yet.

These are the steps I have followed so far:

  1. Create a new action class (that extends AnAction) to be the main class for the plugin.

  2. Create a run configuration for the plugin. I get this error: Run Configuration Error: No plugin module specified for configuration

  3. Follow the instructions given by OpherV in the question I linked to above to change type="JAVA_MODULE" to type="PLUGIN_MODULE" in the .iml file.

The third step did not resolve the "Run Configuration Error: No plugin module specified for configuration issue." What additional steps are needed?

I am using IntelliJIDEA (Community Edition) 14.1.4 Build #IC-141.1532 on OSX 10.11.1.

Community
  • 1
  • 1
pillravi
  • 4,035
  • 5
  • 19
  • 33

1 Answers1

2

I was able to successfully convert the project into a plugin by following these additional steps:

  1. Create a META-INF directory in the root of the project. Inside of this directory create the plugin.xml file. In plugin.xml, register your action. See the IntelliJ code samples for examples of what this file should look like.

  2. Right-click on your project root in the project view (Cmd-1 if it’s not open already) and choose “Open Module Settings” (Cmd-down). This will open Project Structure > Modules > Dependencies.

    5.1. Alternately, you can get here by opening the Project Structure with Cmd-; and then choosing Modules and picking your project from the list and going to the Dependencies tab.

  3. Make sure the module SDK is the IntelliJ Community Edition instead of the normal Java 1.8 (or whichever version you have). (I noticed that this changed a line in the .iml file, but you should change the SDK here so you can create it as described here.)

  4. At the bottom of the dependencies window, there is a plus. Click it, and follow the instructions given by samkass in the answer to this question, which I will reiterate here with more context-specificity for ease of following them:

    7.1. Once you have clicked on the plus button, select “Jars or directories…”

    7.2. Navigate to the META-INF folder, select it, and click OK

    7.3. In the dialog that comes up, select “classes” and NOT “jar directory”

    7.4. Make sure you’re using that Module in your run target

Once I followed all of these steps, the "Run Configuration Error: No plugin module specified for configuration issue" went away and the Run Configuration I had created worked. I ran it and my action was available in the Refactoring menu as I had registered it in plugin.xml.

Community
  • 1
  • 1
pillravi
  • 4,035
  • 5
  • 19
  • 33