How to add a directory with recursive search to class path?

I have a bunch of .jars I need to add to my project that are delivered in a directory tree structure. Right now I'm adding each directory individually as a dependency as part of a library component -- I don't see any way in the UI to include recursive subdirs as part of the classpath as well.

This isn't great but it's OK.

However, I was editing the .xml file that defines the library and I noticed these lines:

    <jarDirectory url="file://$JBOSS_DIST$/modules/javax/annotation/api/main" recursive="false" />
    <jarDirectory url="file://$JBOSS_DIST$/modules/javax/ejb/api/main" recursive="false" />


It sounds like changing recursive="false" to "true" will do what I want.. is this a supported feature? I don't see it in the UI, and I'm worried that even if it does happen to work now, it will get broken in the future, or the setting will get overwritten if I modify the library using the UI after changing the file on disk.

Thanks.
4 comments
Comment actions Permalink

Hello Phil,

Yes, it is a supported feature; it's called 'jar directories' in the UI.

I have a bunch of .jars I need to add to my project that are delivered
in a directory tree structure. Right now I'm adding each directory
individually as a dependency as part of a library component -- I don't
see any way in the UI to include recursive subdirs as part of the
classpath as well.

This isn't great but it's OK.

However, I was editing the .xml file that defines the library and I
noticed these lines:

<jarDirectory
url="file://$JBOSS_DIST$/modules/javax/annotation/api/main"
recursive="false" />
<jarDirectory url="file://$JBOSS_DIST$/modules/javax/ejb/api/main"
recursive="false" />
It sounds like changing recursive="false" to "true" will do what I
want.. is this a supported feature? I don't see it in the UI, and I'm
worried that even if it does happen to work now, it will get broken in
the future, or the setting will get overwritten if I modify the
library using the UI after changing the file on disk.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

yole wrote:

Yes, it is a supported feature; it's called 'jar directories' in the UI.


Then I must be doing something wrong. I added all these directories to my Library as "jar directories" but they don't support recursive searching (also, they show up in the Library .xml file with recursive="false" set). I just tried making a new Library from scratch and got the same behavior.

In other words, I can add "file://$JBOSS_DIST$/modules/javax/annotation/api/main" to my Library and things compile OK, but if I remove it and add "file://$JBOSS_DIST$/modules/javax/annotation/api" instead then my code won't compile.

Maybe I have some other project setting in effect that's conflicting with this operation?

0
Comment actions Permalink

Indeed, it's not recursive, feel free to vote for http://youtrack.jetbrains.net/issue/IDEA-40818.

0
Comment actions Permalink

serge wrote:

Indeed, it's not recursive, feel free to vote for http://youtrack.jetbrains.net/issue/IDEA-40818.

Yes, which is why I was wondering why the actual files contain 'recursive="false"'. Seems like either it was supported, or was planned to be supported, but was never implemented.

0

Please sign in to leave a comment.