Debugging what?

Hi,

I am trying to find out what it is I am actually debugging. As far as I can see there is no place to specify what is actually debugged in the debugging dialog. This leads me
to believe that I am debugging the contents of out/production map generated from the last make of the project. The stuff in out/production is probably the compiled output of
the contents of the java/main map in my project. Of course, as I can see when I start the debugger, this is supplemented by the classpath to the dependencies specified
in the file -> project structure -> Module -> dependencies.

So far so good!

Now, I would like to include META-INF/persistence.xml and log4j.xml in the mix of stuff above, to get it squeezed into the classpath. The easy and simple way to do this
would be to include module  dependencies of the files themselves, so that IDEA would copy them to  out/production at make time. This seems to be possible by  selecting
add -> Module library -> attach sources and then  specifying the directory that contains the infamous files. This has no effect what so ever!

Unfortunately the only way I seem to able to do this is to package the files in a jar and then include this jar in the dependencies. But if I do that, the change of the contents
of the files is going to be be pretty complicated.
Another solution is to include the packaging of the files in an artifact build, and make certain that I build the artifact whenever I chage the content of the files. Again, pretty
complicated.
Yet another solution would be to create an external script, that injects the files here and there in out/production, unfortunately this script would have to be run each time the
project is made, because IDEA clears out the out/production directory.

One could skip the IDEA build procedure alltogether and use ant or maven, but they have their drawbacks to, and it is very nice to use an integrated tool, if your project
is of a reasonable size.

Anybody got a better way?

Kind regards
Henrik

2 comments

add -> Module library -> attach sources and then  specifying the directory that contains the infamous files. This has no effect what so ever!


I am trying to understend what your problem is...
let say you have 2 dirs:

src/main/java
src/main/resources

both should be marked as "source directories" and anything you put within resources directory will be packaged in your jar
(you need to define compiler resource patterns, but I believe *.xml pattern is by default there)

0

Thanks, M.J.

Quite right, thats the way to go.

I thought that sources were meant to be compiled, I was wrong!

Kind regards
Henrik

0

Please sign in to leave a comment.