For Java projects, is there any way to mark a source directory without having a parent source directory (IE, having "com/mypackage/..." marked as source without a "src" or source folder)?

Answered

Hey guys

 

    Was wondering if you guys would have any insight on this, I'm working on a legacy project which has "com/somepackage" without being in a source folder.  The project is pretty old and still uses a make file and has been stored in version control, I don't want to change the project structure but rather change my IDE to accommodate.

I guess I could make some a dummy source folder and just symlink the source (com/some-package) and trick the IDE that way but it seems very hacky.  I'm hoping there is a more straightforward way.

 

 

2 comments
Comment actions Permalink

Yes, you can set com/mypackage as the source folder and configure com.mypackage package prefix. See Assigning a package prefix to a folder with Java sources at https://www.jetbrains.com/help/idea/2016.1/configuring-content-roots.html.

0
Comment actions Permalink

Great!  Thanks Serge, this worked for me!

 

Many thanks!

0

Please sign in to leave a comment.