Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353244 - Generated-sources directory not used for sources
Summary: Generated-sources directory not used for sources
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 372847 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-27 14:31 EDT by Jason Bennett CLA
Modified: 2021-04-19 13:23 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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/