History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-19230
Type: Bug Bug
Status: Open Open
Assignee: Anton Makeev
Reporter: Wade Stebbings
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

sourceFolder in module iml file goes away in dependent module, after running tests within IDEA

Created: 19 Aug 08 22:28   Updated: 21 Aug 08 22:21
Component/s: IDE Configuration, Maven Integration, Project Configuration, Unit Testing. JUnit

Environment:
Mac OS X Leopard 10.5.4, 2.2GHz Intel Core 2 Duo (mac book pro, 15"), 2GB SDRAM, Java 1.5.0_13 (Apple)

Build: 7,941
Severity: Medium


 Description  « Hide
First off, I should mention we're now running IDEA 7.0.4, just downloaded. (I do not see the following behavior in 7.0.3.)

In this example, I have a module called 'commandfile' which depends on another module 'core' (among other modules), all modules have maven2 pom.xml files. When I use IDEA to run tests for commandfile, all of a sudden I get unresolved symbols in my editor window for a java source file I have open within the commandfile module. I find that my src/main/java directory over in my other module, core, is no longer listed as a source folder. I also find that my core.iml file now has the following line "missing" ...

<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />

If I go to my Settings, Modules (core), Sources and set my [core module] src/main/java directory to be a source directory, then go back to commandfile and try tests again, the same thing happens again!

I don't know if it is related to our use of Maven2 or not, but I had a suspicion, which is why I included that in the Components above. Other developers here have seen the same issue (on similarly configured platforms).

I set the Severity to High since it blocks my ability to use IDEA to run tests, however I have work-arounds, such as running with the 'mvn' command line, or to back-down to IDEA 7.0.3 (which I'd prefer not to do).



 All   Comments   Work Log   Change History      Sort Order:
Wade Stebbings - 21 Aug 08 22:18 - edited
This was indeed related to maven and in particular the way we had our (a) files organized and (b) maven2 pom.xml setup, which is to say we had this definition in our pom:
<resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/java/org/ipums/core/persistence/sqlmap</directory>
        <targetPath>org/ipums/core/persistence/sqlmap</targetPath>
        <includes>
          <include>**/*.xml</include>
        </includes>
      </resource>
</resources>

and by moving these "deep level" xml files into resources and a small amount of refactoring to find them, and removing the above declarations in our pom.xml (thereby relying on the default src/main/resources only), then it worked.

I still consider this issue a bug in 7.0.4, you should be able to make it work like this without IDEA changing/removing the idea of what is a source directory already declared. However, this is a lower severity than I originally stated. Which I will change.