On Tue, Jun 16, 2009 at 11:59 AM, David C. Hicks<[email protected]> wrote:
> I think my original message may not have been clear.  I've tried to
> clarify it below.
[del]
> I think maybe my description was poor.  The Model code itself does not
> rely on the test support classes, but rather the unit tests of those
> Model classes depend on the test support classes.  Let's see if I can
> "draw" a picture...
>
> MainProject
>    Model Module
>        src/main/java - model classes
>        src/test/java - unit tests for model classes
>
>    TestSupport Module
>        src/main/java - helper/builder classes - used by other modules
> in the Test Scope, only
>        src/test/java - current contains unit tests for model classes
> for which the presence of helper/builders is needed
>
>    Other modules - most of these have dependencies on both of the above
> modules, but only rely on TestSupport in the Test scope

I think I see what you are saying.

Model (test) depends upon Test Support (main and test jars)
I am going to assume that Test Support does not depend upon Model
(either main or test)

What you need to do is
* to tell maven-jar-plugin to build the test jar
* depend upon the test jar.

See http://maven.apache.org/plugins/maven-jar-plugin/

In TestSupport you want something like
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

In Model you want
  </dependencies>
...
    <dependency>
      <groupId>X</groupId>
      <artifactId>TestSupport</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Does this sound correct?

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to