build 9779 broken Maven classpath

Build 9779 breaks Maven classpath of multi module projects. Resources from dependent modules are not always available in main module on classpath when some class/test is executed. So when I run my tests using run icon, I get some failures. Then I use Debug icon instead of Run on the same class, and everything works fine. Then I go back to Run, and it works fine too. This classpath problem appears to affect only Run and not Debug, and it seems using Debug once on the class fixes it.

IntelliJ IDEA 8.1 9742 didn't suffer from this problem. Also Idea 7.0.6 works fine.

6 comments
Comment actions Permalink

Hi,

Could please attach a sample project?

Thanks,
Anton Makeev

0
Comment actions Permalink

I have been suffering a similar problem since Build #9732 See (IDEA-22029) which hints at the problem.
I have been keeping a copy of all my IntelliJ config files and when IJ drops dependencies I
copy these files back over the ones that were messed up. I have also started up IJ 8.0 and had it regenerate
the project files then move back to IJ 8.1. I have filed about 20 bug reports over the last year and JETBRAINS
has fixed about 50% of the problems, which is pretty good. I know I should file a bug report for this problem,
however I am a little burned out on maven bugs for now.

-Rob

0
Comment actions Permalink

No my problem is not related to your bug. I recommend you not to touch IDEA dependencies, and change only dependencies in pom.xml.

0
Comment actions Permalink

I tried creating a sample project with parent pom and 2 submodules (referencing also the parent pom as parent), with resource located in 1st module, and test in 2nd module. But bug cannot be reproduced in it.

So I performed additional tests.
1.) Problem occurs for both normal run and debug, so it doesn't affect only run.
2.) Problem disappears after 1st failed execution by run or debug. 2nd execution works fine.
3.) Classpath printed when Idea executes class appears to be correct for both 1st and 2nd execution. I can see target\classes directory where my resource is located.
4.) Before and after failed 1st run, required resources are located in target/classes
5.) Problem can be reproduced after any number of successful executions by selecting build->make and run/debug again
6.) Problem cannot be reproduced according to point 4, if Run->Edit configurations->before launch make is disabled. So the problem occurs only if make before launch is enabled for the 1st run.
7.) I tried changing dates of some resource files in target/classes just after "make" step of point 4, before Run. After failed 1st run, I looked at dates again, and could see files were copied from source directory.

In my opinion resource files are deleted by IntelliJ and copied there again just after the application starts, so application cannot find them. This probably occurs during "Processing Maven Resources" phase. Perhaps somebody is running resource copying in separate thread without proper synchronization. For 2nd run, some internal IntelliJ tasks are probably skipped, and bug does not appear anymore.

It is possible that this bug appears again after a few lines of code are changed and then tests are executed. Therefore for me build 9779 is unusable (I really don't like random bugs) and I will stick to 9757 which works.

0
Comment actions Permalink

We haven't added modules or changed dependencies in 9 months.
It's the way IJ refreshes/resolves the maven dependencies that has changed and hasn't been quite right since 8.0 and maybe since right before that.

I am not saying that our problems are the same but they feel similar, in the same IDE session IJ works/compiles then stops being able to resolve
paths and won't compile. I just need to keep a careful log of what I am doing when things stop working.


-Rob

0
Comment actions Permalink

Hi,

Are the module and the missing resources always the same? I mean do they change every failed run or not?
How many modules does you project have and that is the configuration of the modules that have problems?

Please reply in the jira only.

Thanks,
Anton Makeev

0

Please sign in to leave a comment.