Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Anton Makeev 
Subsystem
Maven Integration 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7648
Fixed in build
8244
Severity
0
  • Submitted by   Sean Kleinjung
    2 years ago (18 Jan 2008 02:55)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:57)
  • Jira: IDEA-42482
    (history, comments)

IDEA-42482

Modules with no source that are dependencies of WAR modules generate error when building project

I have imported a multi-module Maven project that includes one or more child modules that do not have source code. These modules are either sourceless POMs used as parents, or could simply declare dependency sets referenced by other modules. If any war modules depend on these empty modules, then attempting to build this project results in the following error:

Error: Directory '<path\to\module>\target\classes' not found. Please recompile module '<SourcelessModule>'.

Recompiling the specific module does not resolve the error.

Expected behavior would be one of the following, in order of decreasing desirability:
1) When importing a project, configure sourceless modules to allow compiles to succeed. (Not exactly sure what IDEA is looking for, so I cannot say more specifically what this is.)
2) Have the build for a sourceless project create the expected directory to suppress the error
3) Have the import create the src/main/java folder to prevent the error from happening

Note that, if a plain jar module depends on an empty module, everything works fine. The problem only occurs when the dependency is from a war module.

I have attached a sample project that illustrates this issue. Import the parent POM and attempt to build the project. The error is in the messages window.

Presently, I am working around this by creating empty src/main/java folders in all projects that do not have source, and committing those to Subversion. This works, but ideally the IDE wouldn't require this.

Issue was resolved
Comments (2)
 
History (1)
 
Links
 
Anton Makeev
  Anton Makeev
21 Jan 2008 14:54
(2 years ago)
#permalink
Do you have explicit dependency on such modules?

The better way to share dependencies is to use inheritance and set packaging method to 'pom'.
http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance

Will that resolve your problem?
Anton Makeev
  Anton Makeev
20 Mar 2008 19:19
(22 months ago)
#permalink
IDEA-17110