Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353244

Summary: Generated-sources directory not used for sources
Product: z_Archived Reporter: Jason Bennett <jasonab>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: igor, scoplin, sebastien.pennec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jason Bennett CLA 2011-07-27 14:31:45 EDT
In older versions of m2e, updating the project configuration would automatically add the generated-sources folder as an Eclipse source folder if it existed. 

In 1.0, it refuses to add the folder, and ejects it if it was previously added. I believe the previous behavior is correct.
Comment 1 Igor Fedorenko CLA 2011-07-27 14:59:59 EDT
See [1] for description of expected behaviour and [2] for explanation how to add support for a code generation maven plugin.

[1] http://wiki.eclipse.org/M2E_plugin_execution_not_covered
[2] http://wiki.eclipse.org/M2E_Extension_Development
Comment 2 Jason Bennett CLA 2011-07-27 15:57:49 EDT
I've read that before, but it's not what I'm talking about.

I understand if I want my generator to run automatically, I need to implement the special code. All I'm saying is, if I run my generator manually (via tha Run menu) and then do "Update Project Configuration," I'd like for M2E to recognize that directory and use it as a source folder.
Comment 3 Igor Fedorenko CLA 2011-07-27 16:56:20 EDT
There is no way to find generated sources folder(s) without executing maven plugin that generates the code.
Comment 4 Jason Bennett CLA 2011-07-27 16:57:56 EDT
I guess I don't understand that limitation. Is that just because of the way the m2e plugin is structured, or is there some other eclipse limitation there?
Comment 5 Igor Fedorenko CLA 2011-07-27 17:01:41 EDT
This has nothing to do with eclipse. pom.xml does not have information about generated sources folder, so even if the folder exists on filesystem there is no (reliable) way to find it there.
Comment 6 Scott Coplin CLA 2011-09-08 23:48:47 EDT
So... how did the older version of m2e detect the generated sources folder automatically?

Maven plugins that generate sources generally register those source trees with the maven runtime (or their users use the maven-buildhelper-plugin).  That is certainly not part of the pom.xml, but is that something available dynamically?
Comment 7 Scott Coplin CLA 2011-09-08 23:51:15 EDT
Oops.  I apologize.  My question is answered in the prior links.
Comment 8 Matthew Piggott CLA 2012-02-29 09:49:07 EST
*** Bug 372847 has been marked as a duplicate of this bug. ***
Comment 9 Denis Roy CLA 2021-04-19 13:23:53 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/