Der_V
Der_V

Reputation: 177

Import class from Mainprojekt in subproject

I have an play application with the following structure:

-mainApp
 -app
   - controllers
   - models
   - services
   - views
 -test
 -modules
...

And i have a subproject in the modules folder. Now I want to use the class Test.class in the "services"-folder in a class of a submodule (called "listadmin"). I thought it's possible with the import:

import services.Test;

But this doesn't work. I get the error (if I compile) that the system don't know the package service. How do i import a class of the main-project in a subproject?

Thanks for help!

Upvotes: 2

Views: 434

Answers (1)

Todd O'Bryan
Todd O'Bryan

Reputation: 2260

I think the only way you can do that is to have the sub-project dependOn the main project. Of course, the main project also will dependOn the subproject, so I'm not sure what you gain by creating a sub-project. I'm having a similar issue. I'm trying to separate my big project into self-contained smaller projects, but I need some info from the big project (the main template file so my views fit in with the rest of the application, a default URL to send pages to when users don't have permission to see pages, etc.) If I can't find that someone has already asked this question, I'm going to, so keep an eye out.

Upvotes: 1

Related Questions