You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mark Hobson (JIRA)" <ji...@codehaus.org> on 2008/04/04 16:10:59 UTC

[jira] Created: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
------------------------------------------------------------------------------------------------

                 Key: MECLIPSE-422
                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: Core : Dependencies resolution and build path
    Affects Versions: 2.5
            Reporter: Mark Hobson


As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Hannu Leinonen (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hannu Leinonen updated MECLIPSE-422:
------------------------------------

    Attachment: fakeBuildOutputDirectory.patch

I also have an issue (and a patch) related to this. I included a fakeBuildOutputDirectory variable to the plugin which means that it sets the default output folder, but uses the specific output folders for the source directories. This is essential for the Google Plugin for Eclipse development, since it requires certain path for the default output directory. Otherwise I can't run tests or use the Eclipse Java compiler. I'm hosting the patched snapshot (with another patch of mine from http://jira.codehaus.org/browse/MECLIPSE-402) in a Maven repository at http://beardedgeeks.googlecode.com/svn/repository/snapshots/

> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: fakeBuildOutputDirectory.patch, separateOutputs.patch, testOutputDirectory.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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] Issue Comment Edited: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Andrea Aime (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182607#action_182607 ] 

Andrea Aime edited comment on MECLIPSE-422 at 7/4/09 8:07 AM:
--------------------------------------------------------------

Very much agreed. In GeoTools and GeoServer projects we would like to use a separate Eclipse output directory but at the moment it's not possible due to this very issue, as we have test resources that do overwrite main resources with the same name. Both are related to the respective plugin systems, which look for a certain file in the jars, and the tests, that in order to double check the plugin system itself, use files with the same name to install test plugins.

The separateOutputs.patch file is a trivial patch that makes it so the output of src and test end up in different directories fixing the problem for us. The intent is to consider the outputDirectory not as the directory where the classes will be put, but as the root for the main and source output directories, which will be kept separate.  When the outputDirectory is set to $OUTPUT, the main sources and resources will be targeted to $OUTPUT/classes, whilst the test ones to $OUTPUT/test-classes.

If this behaviour change is not acceptable I'm ready to prepare a patch that will add a testOutputDirectory parameter instead.
Oh, I coded the patch against the 2.7 releases sources.

      was (Author: aaime):
    Very much agreed. In GeoTools and GeoServer projects we would like to use a separate Eclipse output directory but at the moment it's not possible due to this very issue, as we have test resources that do overwrite main resources with the same name. Both are related to the respective plugin systems, which look for a certain file in the jars, and the tests, that in order to double check the plugin system itself, use files with the same name to install test plugins.

The separateOutputs.patch file is a trivial patch that makes it so the output of src and test end up in different directories fixing the problem for us. The intent is to consider the outputDirectory not as the directory where the classes will be put, but as the root for the main and source output directories, which will be kept separate.  When the outputDirectory is set to $OUTPUT, the main sources and resources will be targeted to $OUTPUT/classes, whilst the test ones to $OUTPUT/test-classes.

If this behaviour change is not acceptable I'm ready to prepare a patch that will add a testOutputDirectory parameter instead.
  
> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: separateOutputs.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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] Issue Comment Edited: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Andrea Aime (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182609#action_182609 ] 

Andrea Aime edited comment on MECLIPSE-422 at 7/4/09 8:56 AM:
--------------------------------------------------------------

Ok, second attempt (testOutputDirectory.patch), this time tested with the GeoTools and GeoServer projects. Seems to work fine there. It would be nice to get confirmation from other people affected by this issue.

In this one I've added an explicit testOutputDirectory configuration option. It defaults to the project one, and can be overridden like this:

{code:xml}
     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <outputDirectory>bin/classes</outputDirectory>
          <testOutputDirectory>bin/test-classes</testOutputDirectory>
        </configuration>
      </plugin>
{code}

If the developers think this patch is good for inclusion I'll extend it to the documentation as well.

      was (Author: aaime):
    Ok, second attempt (testOutputDirectory.patch), this time tested with the GeoTools and GeoServer projects. Seems to work fine there. It would be nice to get confirmation from other people affected by this issue.

In this one I've added an explicit testOutputDirectory configuration option. It defaults to the project one, and can be overridden like this:

{code:xml}
     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <outputDirectory>bin/classes</outputDirectory>
          <testOutputDirectory>bin/test-classes</testOutputDirectory>
        </configuration>
      </plugin>
{code:xml}

If the developers think this patch is good for inclusion I'll extend it to the documentation as well.
  
> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: separateOutputs.patch, testOutputDirectory.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Andrea Aime (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Aime updated MECLIPSE-422:
---------------------------------

    Attachment: testOutputDirectory.patch

Ok, second attempt, this time tested with the GeoTools and GeoServer projects. Seems to work fine there. It would be nice to get confirmation from other people affected by this issue.

> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: separateOutputs.patch, testOutputDirectory.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Rustam Abdullaev (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=151294#action_151294 ] 

Rustam Abdullaev commented on MECLIPSE-422:
-------------------------------------------

buildOutputDirectory is useless; I can't think of a scenario in which one would want to mix test- and non-test folders, but it seems like the plugin was designed that way, according to this comment in EclipsePlugin.java:
        // If using the standard output location, don't mix the test output into it.

A possible workaround:
Specify the output directory at the project level under /project/build, for example, like this:
        <outputDirectory>WebContent/WEB-INF/classes</outputDirectory>
And don't specify buildOutputDirectory - the eclipse plugin will automatically use the default outputDirectory for non-test classes only.

Note For a web app, also specify it under /project/build/plugins/plugin[artifactId="maven-war-plugin"]/configuration, like this:
					<warSourceDirectory>WebContent</warSourceDirectory>



> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Andrea Aime (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Aime updated MECLIPSE-422:
---------------------------------

    Attachment: separateOutputs.patch

Very much agreed. In GeoTools and GeoServer projects we would like to use a separate Eclipse output directory but at the moment it's not possible due to this very issue, as we have test resources that do overwrite main resources with the same name. Both are related to the respective plugin systems, which look for a certain file in the jars, and the tests, that in order to double check the plugin system itself, use files with the same name to install test plugins.

The separateOutputs.patch file is a trivial patch that makes it so the output of src and test end up in different directories fixing the problem for us. The intent is to consider the outputDirectory not as the directory where the classes will be put, but as the root for the main and source output directories, which will be kept separate.  When the outputDirectory is set to $OUTPUT, the main sources and resources will be targeted to $OUTPUT/classes, whilst the test ones to $OUTPUT/test-classes.

If this behaviour change is not acceptable I'm ready to prepare a patch that will add a testOutputDirectory parameter instead.

> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: separateOutputs.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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] Issue Comment Edited: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Andrea Aime (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182609#action_182609 ] 

Andrea Aime edited comment on MECLIPSE-422 at 7/4/09 8:56 AM:
--------------------------------------------------------------

Ok, second attempt (testOutputDirectory.patch), this time tested with the GeoTools and GeoServer projects. Seems to work fine there. It would be nice to get confirmation from other people affected by this issue.

In this one I've added an explicit testOutputDirectory configuration option. It defaults to the project one, and can be overridden like this:

{code:xml}
     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <outputDirectory>bin/classes</outputDirectory>
          <testOutputDirectory>bin/test-classes</testOutputDirectory>
        </configuration>
      </plugin>
{code:xml}

If the developers think this patch is good for inclusion I'll extend it to the documentation as well.

      was (Author: aaime):
    Ok, second attempt, this time tested with the GeoTools and GeoServer projects. Seems to work fine there. It would be nice to get confirmation from other people affected by this issue.
  
> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: separateOutputs.patch, testOutputDirectory.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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] Issue Comment Edited: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Rustam Abdullaev (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=151294#action_151294 ] 

rustamabd edited comment on MECLIPSE-422 at 10/19/08 12:23 PM:
----------------------------------------------------------------------

buildOutputDirectory is useless; I can't think of a scenario in which one would want to mix test- and non-test folders, but it seems like the plugin was designed that way, according to this comment in EclipsePlugin.java:
        // If using the standard output location, don't mix the test output into it.

A possible workaround:
Specify the output directory at the project level under /project/build, for example, like this:
        <outputDirectory>WebContent/WEB-INF/classes</outputDirectory>
And don't specify buildOutputDirectory - the eclipse plugin will automatically use the default outputDirectory for non-test classes only.

Note For a web app, also specify correct webapp path under /project/build/plugins/plugin[artifactId="maven-war-plugin"]/configuration, like this:
					<warSourceDirectory>WebContent</warSourceDirectory>



      was (Author: rustamabd):
    buildOutputDirectory is useless; I can't think of a scenario in which one would want to mix test- and non-test folders, but it seems like the plugin was designed that way, according to this comment in EclipsePlugin.java:
        // If using the standard output location, don't mix the test output into it.

A possible workaround:
Specify the output directory at the project level under /project/build, for example, like this:
        <outputDirectory>WebContent/WEB-INF/classes</outputDirectory>
And don't specify buildOutputDirectory - the eclipse plugin will automatically use the default outputDirectory for non-test classes only.

Note For a web app, also specify it under /project/build/plugins/plugin[artifactId="maven-war-plugin"]/configuration, like this:
					<warSourceDirectory>WebContent</warSourceDirectory>


  
> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnaud Heritier updated MECLIPSE-422:
-------------------------------------

    Assignee:     (was: Arnaud Heritier)

> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: separateOutputs.patch, testOutputDirectory.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

-- 
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: (MECLIPSE-422) Cannot specify a separate output directory for test classes when custom buildOutputDirectory set

Posted by "Andrea Aime (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182608#action_182608 ] 

Andrea Aime commented on MECLIPSE-422:
--------------------------------------

Doh, I should have tested the patch a bit, the .classpath file looked good but the result is that the per entry output are nested with the default output and Eclipse does not like the result.
Will work on a better solution.

> Cannot specify a separate output directory for test classes when custom buildOutputDirectory set
> ------------------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-422
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-422
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.5
>            Reporter: Mark Hobson
>         Attachments: separateOutputs.patch
>
>
> As soon as buildOutputDirectory is set to a non-default value the output directories for all source folders are the same.  It should be possible to specify a buildTestOutputDirectory to separate main and test classes, as is the default behaviour when buildOutputDirectory is not set.

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