|
|
|
[
Permlink
| « Hide
]
Eugene Zhuravlev - 31 Aug 07 16:43
please check that the run configuration for your testcase has compilation enabled "before launch".
Yes, the "before launch steps" option is enabled.
What about "Make" option in "Before Launch" group (see te bottom of the configuration pane)?
Also, what module is specified in "Use classpath and JDK of module" field?
The make option is also checked, and the module is the module in which the test is located.
Unfortunately I was not able to reproduce.
I've created the following test case: public class ATest extends TestCase { and the following properties file: Put them into the directory structure as described in the issue description. Created a run configuration, made sure the checkbox "Make before run" was checked and set up a working direcory for a test to point to compiler output directory. The test runs ok, propfile.properties is copied to compiler output witout any problems. Could you please create a test project that illustrates the bug? Maybe the compiler resource patterns setting (see the screenshot) got screwed up somehow? Just a guess...
I have a similar problem. My resources (located in a resources folder) are not copied to the output folder.
My project follows default Maven 1.1 directory structure (target contains the compiled classes). I tried the same resource pattern you can see in the screenshot and I tried the one from the help screen ( .+\.(properties|gif|png|jpeg|xml) ). Attached you will find a zip of a test project folder having the same problem. Here are the steps required to create an identical project : > mkdir test Using build 7255 of IDEA Sébastien,
there are two problems about the project: 1. the "resources" directory must be marked as a source root 2. The pattern ".+\.(properties|gif|png|jpeg|xml) " won't match because it is a regular expression, but the field expects semicolon-separated list of patterns using file system wildcards (? or *), not regular expression. The regular expressions were used in previous versions, but were replaced with wildcards because of lots of complains from users that it was had to write a regular expression. After fixing the above issues everything works fine for me. Eugene,
Did 1 and 2 and everything now works fine for me too. Thank you very much, Sébastien I have attached my project settings, my compiler settings and my run configuration. Everything is as it is supposed to be, I think, but I still have the problem.
If you can't spot the error in the screenshots, I will try to create at test project. There is a related issue IDEA-16746 which shows how IDEA handles resources differently from Maven. A minimal project with unit tests showing the problem is provided.
I've noticed that adding a directory as a library does not include it in the runtime classpath and is causing problems for resource loading as a general rule. This worked in IDEA 5.x.
I never include resources with my compiled code; these are always maintained separately and I don't want them included in source trees. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||