9
votes

After a lot of good comment about IDEA, I decided to give it a try. I downloaded the Community Edition and would like to use it for PlayFramework development.

I have followed official documentation and some other information gathered around, but I have not succeeded completely. When using a project with differents (play) modules, the different classes are not found.

For example when using Secure module, IDEA keeps complaining about not finding Secure.class. It has to be a classpath issue. I tried to attach Java source & classes ($PLAY/modules/secure/) in module settings (F4), class is still not found. Did I miss something?

BTW, I have done a play dependencies and play idealize, which seems to add another module Secure into project in IDEA.

Thanks,

3
Hmm, totally unaware for what reason, but it works again. Is there any cache system you have to clean sometimes?i.am.michiel
Hmm that's odd. I usually just do play deps --sync then play idealize. Try to do a play clean then deps then idealize. See if that does anything different. Also you may have to refresh the project by closing it and opening it back up.Drew H

3 Answers

6
votes

The answer is to run the following:

play deps
play idealize

This forces the IDEA .iml project file to be refreshed with the updated class path entries for the new module (in this case Secure).

0
votes

A issue I came across using IntelliJ and Playframework.

  • The log4j.properties file or log4j.xml file are not in classpath by default. You have to add the conf as a source folder in module settings.
0
votes

You need to add the Secure module you have created in IDEA as a dependency to the main application module:

  1. Go to File -> Project Structure
  2. Choose the main module
  3. Choose the Dependencies tab
  4. Click Add -> Module Dependency
  5. Choose the IDEA Module you created for the Play Secure module

Also make sure you have the correct source path selected for the Secure module in IDEA.