|
|
|
Re: Exclude Certain Packages From Export (Java) [message #631771 is a reply to message #631762] |
Fri, 08 October 2010 16:32 |
|
On 2010.10.08 9:56, Jonah Bron wrote:
> Thanks for the reply. What I was trying to say was, I can't uncheck any
> source folders. They're already unchecked. Here's a screenshot to show
> you what I mean.
>
> http://s1046.photobucket.com/albums/b465/jonahbron/?action=v iew¤t=screenshot.png
>
>
> Thanks
Jonah,
You don't want to "uncheck" anything in Build Path (per your illustration).
To create a JAR, you right-click on the project and choose Export... (as
you started to do). But, when you reach the JAR Export dialog, you
uncheck what is probably your test subdirectory.*
If you like, peruse this discussion here:
http://www.javahotchocolate.com/tutorials/jars.html
* Now, if you didn't put your JUnit tests under a separate Source
Folder, parallel to src, then you should do that (it's a "best
practice") and that might be why you find it impossible to exclude them.
Come back if this isn't helpful,
Russ Bateman
|
|
|
|
|
Re: Exclude Certain Packages From Export (Java) [message #631955 is a reply to message #631950] |
Mon, 11 October 2010 01:41 |
|
On 2010.10.10 18:31, Jonah Bron wrote:
> Bump?
(Don't bump in this forum. Your question will always be answered as soon
as someone sees it who can answer it.)
Here's how to set up JUnit tests.
1) Right-click the project and choose New -> Source Folder. Name it "test".
2) Right-click test, then choose New -> Package. Name the package the
same as the package under src folder that contains the code your JUnit
class will test.
3) Create your JUnit test class under this package. If you've already
created a JUnit test under src folder, open both src and test, then drag
the JUnit test from under src to under test.
|
|
|
|
|
|
|
Re: Exclude Certain Packages From Export (Java) [message #632108 is a reply to message #631957] |
Mon, 11 October 2010 15:05 |
|
On 2010.10.10 20:21, Jonah Bron wrote:
> Quote:
>> (Don't bump in this forum. Your question will always be answered as soon
>> as someone sees it who can answer it.)
>
> Okay, sorry.
>
> I followed your instructions. I now have:
>
> src/
> ___packagename [package] /
> ______[code files]
> test/
> ___packagename [package] /
> ______[test files]
>
> But I still haven't found a way to exclude the jUnit test files from the
> runnable jar export. Until this problem is solved, I can just do it
> manually from the terminal. But, this really should work. Any ideas?
>
> Thanks
Please peruse this example for a step-by-step:
http://www.javahotchocolate.com/tutorials/jars.html#jarexamp le
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10031 seconds