You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/07/30 11:27:45 UTC

[jira] Created: (MPJAR-34) Add an option to include test classes in jars

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Fri, 30 Jul 2004 5:26 AM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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: (MPJAR-34) Add an option to include test classes in jars

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: dion gillard
    Created: Sat, 31 Jul 2004 6:14 AM
       Body:
If we want to have a jar of the test classes, the code should be in the test plugin.
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPJAR-34?page=comments#action_22563

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Sat, 31 Jul 2004 6:14 AM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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: (MPJAR-34) Add an option to include test classes in jars

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: Felipe Leme
    Created: Sun, 1 Aug 2004 8:43 PM
       Body:
I agree this would be an useful feature, specially when you develop components with points of extension. In these cases, you could provide test cases that would be extended by applications using your component.

Of course, we could create another project for that, but I think it would be much easier if Maven packaged these test cases in the same project.
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPJAR-34?page=comments#action_22596

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Sun, 1 Aug 2004 8:43 PM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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: (MPJAR-34) Add an option to include test classes in jars

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: Carlos Sanchez
    Created: Fri, 30 Jul 2004 10:11 AM
       Body:
It doesn't sound good to me.

If you don't want to mix your test classes create another project and use it as a dependency.
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPJAR-34?page=comments#action_22526

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Fri, 30 Jul 2004 10:11 AM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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: (MPJAR-34) Add an option to include test classes in jars

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: Michael Mattox
    Created: Mon, 2 Aug 2004 8:14 AM
       Body:
I'm glad to see some discussion on this topic.  One of the challenges of Maven is to produce a utility that works for everyone.  Sometimes a few people really want/need a feature but others do not.  I think it's not possible to satisify everyone 100% of the time.

I see both sides, for including the tests in the jar and for putting them in a separate project.  I think the best thing to do is to give the user the choice.  If you don't want the test classes in the jar then that's fine, why force others to feel as you do?

Another topic came up today.. we'd like to run our junit tests on our integration servers.  I pointed out that the tests aren't included in the jars.  If we make a separate jar with test code, that complicates our deployment.  So it's much simpler to use a property to toggle including the test classes or not.  It's very useful during testing and integration to include them, and nice to not include them for production releases.  Also if we put test classes in separate jars, that could theoretically double the number of projects.  And that complicates the project.xmls.  I think the dependencies are already a total mess as it is (I'm eagerly awaiting M2).  What about conf files?  

Overall I think adding the property is the easiest quick fix to this problem.  As it currently is I'm forced to put mock objects and some of my integration junit tests in my src/java tree.  Anything is better than that.

-Michael Mattox
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPJAR-34?page=comments#action_22622

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Mon, 2 Aug 2004 8:14 AM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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: (MPJAR-34) Add an option to include test classes in jars

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: Felipe Leme
    Created: Sun, 1 Aug 2004 8:55 PM
       Body:
Not in the regular jar, but in a test specific jar (something like myproject-test-version.jar).

The main limitation is that <artifact> does not allow different basename for the artifacts - that's something we should discuss in anotehr issue (I will open one)
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPJAR-34?page=comments#action_22598

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Sun, 1 Aug 2004 8:55 PM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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: (MPJAR-34) Add an option to include test classes in jars

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: dion gillard
    Created: Mon, 2 Aug 2004 8:32 AM
       Body:
"Sometimes a few people really want/need a feature but others do not. I think it's not possible to satisify everyone 100% of the time."

Hence maven.xml and post/pre goals, plugins...

"If you don't want the test classes in the jar then that's fine, why force others to feel as you do?"

I'm not forcing anyone, but Maven simply can't be all configurable, it'd be a mess.

"Overall I think adding the property is the easiest quick fix to this problem. As it currently is I'm forced to put mock objects and some of my integration junit tests in my src/java tree. Anything is better than that."

Quick fixes are not often the best ones.

A quicker fix would be for you to postGoal the jar goal and add any test classes into the jar....


---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPJAR-34?page=comments#action_22624

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Mon, 2 Aug 2004 8:32 AM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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: (MPJAR-34) Add an option to include test classes in jars

Posted by ji...@codehaus.org.
The following comment has been added to this issue:

     Author: dion gillard
    Created: Sun, 1 Aug 2004 8:49 PM
       Body:
I'm very much against including test classes in the jar.

Adding functionality to the test plugin to create a separate jar from its source sounds a lot cleaner
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPJAR-34?page=comments#action_22597

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPJAR-34

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPJAR-34
    Summary: Add an option to include test classes in jars
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-jar-plugin

   Assignee: Jason van Zyl
   Reporter: Michael Mattox

    Created: Fri, 30 Jul 2004 5:26 AM
    Updated: Sun, 1 Aug 2004 8:49 PM

Description:
I have mock objects defined in my src/test tree.  Other projects then use these mock objects for their tests.  With Maven, test classes are not included in the distribution jars.  Searching the mailing list, this seems to be a common need.  The only viable solution I've seen is to move the mock objects to the src/java tree.  I don't like this at all.  I'd like to propose a new property:

maven.jar.include.test.classes

it could be false by default.  Setting it to true would include the test classes in the jar.  I consider test code just as important as my application code, so this option makes a lot of sense to me.  I don't see any reason not to include, but at least adding the property would give the user the choice.




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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