0

I have project ABC and Project XXX. In Project XXX's pom.xml, I am importing project A using the dependency tags.

But I am unable to access the test classes of project ABC inside project XXX i.e. project ABC's src/test/java classes not accessible.

How can I access them?

schalakhoo
  • 19
  • 6
  • possible duplicate of [Sharing Test code in Maven](http://stackoverflow.com/questions/174560/sharing-test-code-in-maven) – Joe Nov 07 '14 at 13:31

1 Answers1

-1

In project ABC add this plugin:

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

In project XXX you must add the dependency(you need both dependencies, one to normal ABC jar and other to test-jar):

<dependency>
  <groupId>com.groupId</groupId>
  <artifactId>ABC</artifactId>
  <version>1.0</version>
  <type>test-jar</type>
  <scope>test</scope>
</dependency>
BlackBlaze
  • 254
  • 2
  • 10