You need to create a test-jar artifact out of your helper classes

Put this in the pom of your helper classes

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

This will create a test-jar.

Then in the project that you depend on these helper classes in test 
packages, declare a dependency to it with a type tag.

i.e.,
        <dependency>
            <groupId>your group id</groupId>
            <artifactId>helper project</artifactId>
            <version>version</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

Cheers,
rOnn c.




jsweeney67 <[EMAIL PROTECTED]> 
11/15/2007 11:16 AM
Please respond to
"Maven Users List" <users@maven.apache.org>


To
users@maven.apache.org
cc

Subject
JUnit and Maven - compiling helper classes







I'm a Maven newbie trying to incorporate JUnit tests into the build.  Some 
of
our JUnit test classes make use of shared code in helper classes that live
in the test packages.  When I run these tests from Eclipse, the helper
classes are found and compiled.  However, when a cmd-line Maven build 
tries
to run these tests, it does not find these classes and the tests get 
compile
errors.

What is the prefered way to tell the .pom(s) to compile these helper 
classes
as part of JUnit testing?
-- 
View this message in context: 
http://www.nabble.com/JUnit-and-Maven---compiling-helper-classes-tf4808900s177.html#a13759355

Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



######################################################################
DISCLAIMER:
This email and any attachment may contain confidential information.
If you are not the intended recipient you are not authorized to copy
or disclose all or any part of it without the prior written consent
of Toyota.

Opinions expressed in this email and any attachments are those of the
sender and not necessarily the opinions of Toyota.
Please scan this email and any attachment(s) for viruses.
Toyota does not accept any responsibility for problems caused by
viruses, whether it is Toyota's fault or not.
######################################################################

Reply via email to