You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "John Casey (JIRA)" <ji...@codehaus.org> on 2010/05/21 17:33:12 UTC

[jira] Created: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

"Extra" Compiler mojo for non-test, non-main code
-------------------------------------------------

                 Key: MCOMPILER-128
                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
             Project: Maven 2.x Compiler Plugin
          Issue Type: New Feature
    Affects Versions: 2.3.1
            Reporter: John Casey


It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.

Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.


-- 
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

        

[jira] Commented: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "Steve Ebersole (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222457#action_222457 ] 

Steve Ebersole commented on MCOMPILER-128:
------------------------------------------

Joerg, sure but its a question of convenience/sanity.  If I go that route, when I add new hibernate-testing classes I need to remember to update the include/exclude lists.

And since I am pretty sure this might be the next point, I don't think its reasonable for a build tool to enforce that I use a certain package structure just so that it can build an artifact easily.

> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.4
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

-- 
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

        

[jira] Commented: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "Steve Ebersole (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222615#action_222615 ] 

Steve Ebersole commented on MCOMPILER-128:
------------------------------------------

Look its obviously up to y'all if you choose to implement something or not.  But I find the alternative setup unacceptable.  You can collect your $0.02 at your convenience :)

> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.4
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

-- 
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

        

[jira] Commented: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222086#action_222086 ] 

Brett Porter commented on MCOMPILER-128:
----------------------------------------

sounds a bit odd to me, would be worth some discussion.

What is the more concrete use case?

Why doesn't an additional execution of the current compiler mojo suit?

> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.4
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

-- 
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

        

[jira] Updated: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Casey updated MCOMPILER-128:
---------------------------------

    Fix Version/s: 2.4
         Assignee: John Casey

> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.4
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

-- 
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

        

[jira] Commented: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "Joerg Schaible (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222107#action_222107 ] 

Joerg Schaible commented on MCOMPILER-128:
------------------------------------------

Additionally you can use the testjar to create such an test module. Especially since this goal respects includes/excludes to define the test code that should be part of the artifact.

> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.4
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

-- 
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

        

[jira] (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy updated MCOMPILER-128:
-----------------------------------

    Fix Version/s:     (was: 2.4)
                   backlog
    
> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: backlog
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "Joerg Schaible (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222584#action_222584 ] 

Joerg Schaible commented on MCOMPILER-128:
------------------------------------------

Steve, yep, that's the next point, why don't you use a separated package structure? See, if hibernate-testsuite *is* some kind of integration test, these tests should not use the same package as the tested code anyway and you can use an include pattern like org/hibernate/testsuite/**.

Alternatively you can really do as Brett said and use an additional execution of the compiler plugin or you may use the buildhelper plugin to add another folder as (test-)source directory. Event the jar plugin can be configured for an additional execution to create an additional attached JAR artifact.

The modification of the Maven lifecylce - as implied by the issue's description - has much more impact on Maven and additional other plugins and the question remains here, if it is really worth. I understand your requirement very well, I've had the same before, but that are really rare cases and I was always able to solve it with some special setup in the POM as already proposed.

> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.4
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

-- 
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

        

[jira] Commented: (MCOMPILER-128) "Extra" Compiler mojo for non-test, non-main code

Posted by "Steve Ebersole (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222455#action_222455 ] 

Steve Ebersole commented on MCOMPILER-128:
------------------------------------------

Brett, when I spoke to him John said he had already been contemplating this enhancement so I cannot speak to his previous thoughts.  But specifically what I spoke to him about was a specific use case that we have in Hibernate.  Currently Maven forced us to utilize 3 different modules, for what IMO should easily be allowed in one; one project -> one artifact being the biggest obstacle.

The module splits break down as:
* hibernate-core - The main Hibernate module
* hibernate-testing (depends on hibernate-core) - Contains test "infrastructure" code that gets used by other modules and that we package up separately for users to make it easy for them to write Hibernate-based test cases
* hibernate-testsuite (depends on both hibernate-core and hibernate-testing) - Obviously because we had to split hibernate-testing out, we had to split out the testsuite as well to avoid circularity.

The concern is that hibernatee-testsuite really is the testsuite for hibernate-core.  However, it often gets overlooked and not run when developers make changes prior to commit.  So I'd like to put all these back in their natural places.  Yes just splitting the hibernate-testing into a separate source directory and applying compilation will "work" in that it will get stuff into the needed classpath.  The issue is that the artifacts get screwed up (hibernate-testing classes will end up in hibernate-core, and there is additionally no easy way to build the hibernate-testing artifact for attachment since the classes are all in one big hodge-podge).

> "Extra" Compiler mojo for non-test, non-main code
> -------------------------------------------------
>
>                 Key: MCOMPILER-128
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-128
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3.1
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.4
>
>
> It'd be nice to be able to specify another compile step in the build process, pointed at different source code and compiling to some alternative location. Using this approach, one could easily segregate test-fixture code that depends on the current module from the unit tests for that module, then use something like the assembly plugin to jar up the compiled test fixtures for distribution.
> Obviously, once this "extra" compile step was completed, the resulting location would have to be added to the appropriate classpath for test compilation, etc. This could be handled using a system dependency (ick) or something like a test-resource with filtering turned off (much the way image resources are handled), which would make it available on the classpath.

-- 
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