简体   繁体   中英

Creating a source package folder in a CounterClockWise project programmatically

I have an existing java project and in that project there is a procedure that should programmatically create packages with source files inside them. It uses the standard File.mkdir() method to create all the unexisting directories for the package and then creates and writes the source files in there.

All works fine except that only the top folder created for a package path is marked by Eclipse as a package. The lower level folders remain just folders. For example, if I create a directory structure for package "org.prj.hey.this.is.cool", where "org.prj" is the existing path for my main project package, it then creates the rest of the path "/hey/this/is/cool" and only "hey" becomes an Eclipse package. I have found no way to make Eclipse recognize the "this", "is" and "cool" folders as packages. I haven't found any clues on this in the .project and .classpath files either..

So how do I make the whole branch of created folders be recognized by Eclipse as packages?

UPDATE:

(screenshot)

在此处输入图片说明

Found out that the issue is due to the file extension (see the picture). Is there any way to make Eclipse recognize .clj files as source files?

Problem exists in your current eclipse workspace buildpath configuration. Perform rightclick on your project name, then "Build path->configure build path..." and add newly created dirs to your current build path in SOURCE tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM