Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365419

Summary: Classpath for Integration Test
Product: z_Archived Reporter: Karl Heinz Marbaise <eclipse>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: igor, miro.simko
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karl Heinz Marbaise CLA 2011-12-02 07:49:30 EST
I have a project which contains a web-project (JSF) and a supplemental project which contains the integration test for the web-project (selenium tests).

I've had the problem to use classes within my integration test module from the web-project (src/main/java)...so the solution is to configure the maven-war-plugin like the following:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
    <attachClasses>true</attachClasses>
  </configuration>
</plugin>

which works perfectly on command line (mvn clean verify)...

My integration test module has the following dependencies whereas the first one is needed to make sure the reactor-order is correct and the second is needed to have the required classes available.

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>web-project</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>web-project</artifactId>
      <version>${project.version}</version>
      <classifier>classes</classifier>
      <type>jar</type>
      <scope>test</scope>
    </dependency>

my current problem is if i select to start an integration test via Eclipse i need manually add the web-project as a dependency to get the tests running (TestNG tests). 

I'm not sure if this is an issue in m2e or in TestNG Eclipse plugin.
Comment 1 Karl Heinz Marbaise CLA 2011-12-02 08:07:03 EST
I've also given a statement in the testng-user group http://groups.google.com/group/testng-users (described the same)..Cause i'm not really sure who is the destination for that problem.
Comment 2 Igor Fedorenko CLA 2011-12-02 09:48:36 EST
Maven project model does not have enough metadata to determine contents of attached artifacts in a generic way. Because of this limitation, the only way to support war attached sources is by writing code specific to maven-war-plugin and there are no plans to make maven-war-plugin integration part of m2e core. I suggest you talk to m2eclipse-wtp and/or webby developers to see if they can offer something better.
Comment 3 Denis Roy CLA 2021-04-19 13:27:05 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/