dynamic dependencies in modules

What i want to achieve:

get intellij working happily within the existing tool chain I have at my place of work

Environment:
svn - source only
Custom build tool based on ant - this tool generates project files using a build.xml (with custom extensions) it will generate all the necessary files and the config files for an eclipse project.

I can use these generated projects to create idea modules, that works fine

Problem
dependencies - if a dependency version changes if i run the build tool it will update the jar files in the lib directory, in eclipse refreshing the project will fix this problem and it will change the list of dependecies.

Is there a way I can configure idea to look in this directory dynamically rather than loading a dependency statically.
Could i specify a dependency prefix? e.g dependent-jar*.jar would map to dependent-jar-5.jar

6 comments
Comment actions Permalink

You can use the Jar Directories feature to include all of the jar files in a particular directory as dependencies of your module.

0
Comment actions Permalink

thanks for the speedy response, i forgot to mark this thread as a question but that was the solution.

Is there a configuration/template file that idea uses to create a module from existing sources, it would be great if i didnt have to do it every time i imported a module but its not the end of the world if i have to!

0
Comment actions Permalink

No, there is no such configuration.

0
Comment actions Permalink

Hello again!

i have a class that is complaining that I am not declaring or catching a thrown Exception but i am.

I have a dependency that has

Class A

Class B extends A
Class C extends A

my code is throwing exceptions B and C and in the method signature I throw Class A but for some reason its not recongizing that B and C extends A. The package names on all the classes are correct, is there a way I can instect which jar it is getting the class from? Is there a bug for this issue?

thanks

0
Comment actions Permalink

There is no bug because it's not clear what the issue is. Pressing Goto Definition on A will bring you to where IDEA is loading the declaration from.

0
Comment actions Permalink

thanks that goto declaration identified the problem,

its a classloading problem. the exceptions being thrown are being loaded from a different jar to where i expected, these versions of the classes do not extend the correct class

0

Please sign in to leave a comment.