How can I make the maven test dependent on the class defined in another project test?

I have two projects: A and B. Project A depends on project B. Project B implements several JUnit tests that work correctly with the maven test. The tests of project B JUnit also determines some of the constants that both projects A and B rely on. When I run maven install in project B, none of the test classes (namely constants) fall into Project B SNAPSHOT jar, therefore, when project A looking for project B constants, he cannot find them in bank B BNA SNAPSHOT, which is installed in my local repo. Is there a way to tell maven to package / install the SNAPSHOT test banner or something similar, so that Project A can access these constants during the test? These constants are used only in tests.

+3
source share
2 answers
  • : src/main/java , . , testing.
  • Overengineered solution: maven (, POM?), A, B test.
+1

100%, ,

 <classifier>tests</classifier>

.

A "" B B-.

: , classifier:test, type:test-jar.

0

All Articles