[ http://jira.codehaus.org/browse/MNG-641?page=comments#action_43420 ] 

Brett Porter commented on MNG-641:
----------------------------------

the problem we're having here is one of definition. these don't appear to be 
the same resources we are talking about.

"plugin inputs" are more akin to sources than resources. Maybe we need more 
terminology.

What you are doing here is most certainly better acheived with a forked 
lifecycle as you are basically wanting to iterate through the lifecycle (not to 
mention the sources you generate, compile and run to generate sql / jsp are not 
project sources at all and should not be included in the final output). However 
this appears to only be for some of the sources? Sounds confusing! :)

Here's what I'd suggest with the limited info: let me know if it fits.

- text files stored in src/main/forms
- you register a foo:generate goal in generate-sources that forks 
"generate-sources" and overlays the following on the lifecycle:
  * forms -> xml mapped to generate-sources
  * xml -> java mapped to generate-sources
  (your plugin has tight control over the order here to eliminate the risk of 
user error)
 * let's assume 2 java dirs we're created:
    + target/generated-sources/foo1 is added to the compile classpath
    + target/generated-sources/foo2 is run through the plexus-compiler to 
produce target/foo2-classes
  * lifecycle returns, foo:generate now executes to generate sql and jsp, 
putting them directly in their target directory

Unless you are expecting to process the sql and jsp consistently with some 
other files this should work.

I'm a little concerned about resources myself and that we might need to 
elaborate more on them in the 2.1 timeframe, but I don't think this particular 
usecase is aided much by merging the phases. WDYT?



> Collapse "generate-sources" and "generate-resources" into "generate"
> --------------------------------------------------------------------
>
>          Key: MNG-641
>          URL: http://jira.codehaus.org/browse/MNG-641
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-plugins, maven-core
>     Reporter: Trygve Laugstol
>     Assignee: Brett Porter

>
>
> It's not unlikely that you'd like to generate sources from generated 
> resources. 
> A not that far fetched use case is that we might generate components.xml and 
> then generate remote stubs for the components found in components.xml.
> The same might apply to process-sources and -resources.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to