You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Trygve Laugstol (JIRA)" <ji...@codehaus.org> on 2005/07/25 17:53:57 UTC

[jira] Created: (MNG-641) Collapse "generate-sources" and "generate-resources" into "generate"

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


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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MNG-641) Collapse "generate-sources" and "generate-resources" into "generate"

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-641?page=all ]
     
Brett Porter closed MNG-641:
----------------------------

     Resolution: Won't Fix
    Fix Version:     (was: 2.0-beta-1)

it seems that (at least for now), we can get away with forking a lifecycle to simulate looping portions of the lifecycle.

maybe we need to use a workflow instead?

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-641) Collapse "generate-sources" and "generate-resources" into "generate"

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MNG-641) Collapse "generate-sources" and "generate-resources" into "generate"

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-641?page=all ]
     
Brett Porter closed MNG-641:
----------------------------

    Resolution: Won't Fix

I don't see that this gains us anything, so I'd rather not break backwards compat and risk discovering a use case later.

> 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

>
>
> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-641) Collapse "generate-sources" and "generate-resources" into "generate"

Posted by "Kenney Westerhof (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-641?page=comments#action_43419 ] 

Kenney Westerhof commented on MNG-641:
--------------------------------------

generate-sources is before generate-resources, which might not always be the correct ordering.

I had a usecase that really isn't very relevant anymore, it went something like this:

- extract metadata from database to xml file
- generate sources and resources (.sql files) from xml file

However normally the extraction will not be done..

Another usecase which we used succesfully in a project is this:

- we have a set of text files defining forms (src/main/resources)
- they are parsed and converted into xml files (generate-resources)
- these are converted to sources using xslt (generate-sources)
- some of these are run, producing more resources (sql / jsp) (process-sources + generate-resources)

This is reversed from the compiler-compiler situation: generate-sources, generate-(re)sources.

I think collapsing them would be a good idea so the ordering can then be defined in the pom. Although currently
you can override a plugin's phase, moving it in the lifecycle.

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Reopened: (MNG-641) Collapse "generate-sources" and "generate-resources" into "generate"

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-641?page=all ]
     
Brett Porter reopened MNG-641:
------------------------------

     Assign To: Brett Porter

apparently there is a specific use case Kenney has, so waiting to hear that.

the proposed solution is probably not feasible as it makes it difficult to get corrrect ordering when generating both sources and resources (it also breaks backwards compat)

the problem is that there may be a situation where the reverse is applicable: sources are processed to generate a resource which needs to be processed and which is used to generate more sources.

I'm still inclined to "won't fix" it, but I'll wait to hear the case. Currently I'm saying that sources generated ultimately from processed sources themselves can't be processed (otherwise phases will need to repeat over). This could perhaps be worked around by using an executed subphase.

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MNG-641) Collapse "generate-sources" and "generate-resources" into "generate"

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-641?page=all ]

Brett Porter updated MNG-641:
-----------------------------

    Fix Version: 2.0-beta-1

> 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
>      Fix For: 2.0-beta-1

>
>
> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org