Cannot run a class using a maven compilation

I have IDEA 14.1.3 ultimate version.  I have a simple maven project myapp and there is a class myapp.MyCls with main method.I am running the class MyCls by „Run/Debug configuration“ and compilation is done by maven –  in section „In Before launch“ is set „Run Maven Goal „myapp:compile“ and there is no Make - see an attachment.   When I run it I got the error: Exception in thread "main" java.lang.ClassNotFoundException: myapp.MyCls. If I run it immediately second time, then it succeed.  I notice that in my first attempt IDEA did not put “...myapp\target\classes” in the classpath. So to reproduce the error there must not exists a directory ...target\classes  before running a class.  Am I doing something wrong, or is it a bug in IDEA?

Attachment(s):
RunConfiguration.png
2 comments
Comment actions Permalink

Sorry, I can't say anything about the problem itself (other than it looks like a bug to me, too).

As you have gotten no response so far, I would propose that you file a bug in Jetbrains tracker:
https://youtrack.jetbrains.com/issues

I found that usually issues are handled timely.
It would help a lot if you could attach a small, self contained example that reproduces the bug.

0
Comment actions Permalink
Thank you for response. I reported it as a bug https://youtrack.jetbrains.com/issue/IDEA-140455
0

Please sign in to leave a comment.