2

I generated classes from wsdl file in build folder of the Gradle project in Intellij. But I have some compilation errors when I try to create an object from generated classes. Because it is obvious that I cannot give a reference in src folder for classes outside of src folder. How can I do this?

EDIT-1: My project has a root module that has 2 inner modules is placed on src folder of root module. "gen" class has generated classes and I want to use them in "main" module in src folder. But, how? enter image description here

EDIT-2: About Peter's recommendation, I am sharing the print screen. I cannot reach outside of src folder! enter image description here

séan35
  • 966
  • 2
  • 13
  • 37

1 Answers1

2

Go to the project structure (Ctrl+Alt+Shift+S or File->Project Structure), select module and select the module of your concern.

Then click the sources tab and turn your generation folder into a source code folder. There is a row of buttons: Mark as:Mark folder as source folder

I would expect that your build folder is already marked as excluded but you can have a source folder inside an excluded folder.

Peter
  • 4,752
  • 2
  • 20
  • 32
  • Thank u for your contribution, but still having a problem. Hierarchy of my project modules are told in edit part of the question. I've just added it. Please, check it. – séan35 Mar 28 '17 at 12:43
  • please check two photos on my question – séan35 Mar 28 '17 at 12:50
  • 1
    Another solution is to add the source folder to your gradle setup. see [http://stackoverflow.com/questions/31077844/add-another-java-source-directory-to-gradle-script] – Peter Apr 28 '17 at 10:09