Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] tycho project in m2e not picking up testSourceDirectory setting

I am trying to add regular JUnit tests to a tycho project, to be able to
TDD the business logic (right now the underlying model for a GEF
editor).

I have added the settings from
 http://mukis.de/pages/simple-junit-tests-with-tycho-and-surefire/
(and the mailing list post linked to from that blog post).

This works when building from the command line, but the src/test/java/
source directory doesn't appear in the eclipse project.

Is it supposed to?  Is there some way to make it work?

Here are the settings I added to the tycho project POM:
 <build>
  <!-- plain surefire tests without tycho -->
  <testSourceDirectory>src/test/java</testSourceDirectory>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <executions>
     <execution>
      <id>test</id>
      <phase>test</phase>
      <configuration>
       <includes>
        <include>**/*Test.java</include>
       </includes>
      </configuration>
      <goals>
       <goal>test</goal>
      </goals>
     </execution>
    </executions>
   </plugin>

   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <executions>
     <execution>
      <id>compiletests</id>
      <phase>test-compile</phase>
      <goals>
       <goal>testCompile</goal>
      </goals>
     </execution>
    </executions>
   </plugin>
  </plugins>
 </build>
 <dependencies>
  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.11</version>
   <scope>test</scope>
  </dependency>
 </dependencies>


Thanks!


- Steinar



Back to the top