Le Thu, 18 Jun 2009 11:19:56 -0400,
"Gul Onural" <[email protected]> a écrit :
>
> Hi,
>
> In the project I am working on, there is a need to specify
> dependencies between the test source directories.
>
> The project tree looks like similar to this :
>
> - componentA
> - src
> - main
> - test
> - aCommonComponent
> - src
> - main
> - test
>
> In the JUNIT test cases defined under componentA/test, I want to be
> able to use a Java class defined under aCommonComponent/test.
> Defining a dependency to aCommonComponent inside componentA's pom file
> doesn't help because the class I want to use is under test directory
> of the aCommonComponent.
>
> What is the proper way of doing this in maven2 ?
>
> Thanks,
>
> Gul
>
You can expose your aCommonComponent in the classifier test
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>attach-test</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
and use it in your componentA
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>aCommonComponent</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
This should works :)
Best regards,
tony.
> ---------------------------------------------------------------------
> This transmission (including any attachments) may contain
> confidential information, privileged material (including material
> protected by the solicitor-client or other applicable privileges), or
> constitute non-public information. Any use of this information by
> anyone other than the intended recipient is prohibited. If you have
> received this transmission in error, please immediately reply to the
> sender and delete this information from your system. Use,
> dissemination, distribution, or reproduction of this transmission by
> unintended recipients is not authorized and may be unlawful.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
--
Tony Chemit
--------------------
tél: +33 (0) 2 40 50 29 28
email: [email protected]
http://www.codelutin.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]