简体   繁体   中英

Maven not finding Eclipse Plug-in tests

So I have a large project and we're just now trying to integrate tests into the whole thing (I know). But when I run a

mvn clean install

on the test plug in, I get the message

All Tests Passed!

But its clearly not running the tests since one of my tests is written to fail. The structure of my plug in project is:

->src/${filepath}  */ My tests are here
->src/${filepath}/folderA
->src/${filepath}/folder
etc...

I have a master pom file a level up which is used to compile all dependencies (successfully). Is my structure just wrong in the test plug in?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<version>1.0.0.qualifier</version>
<artifactId>com.exeeng.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
<name>${name}</name>

<parent>
    <version>${parent-version}</version>
    <groupId>${parent-grou}</groupId>
    <artifactId>parent</artifactId>
</parent>
<properties>
    <tycho-version>0.19.0</tycho-version>
</properties>   
<build>
<plugins>
    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-maven-plugin</artifactId>
        <version>${tycho-version}</version>
        <extensions>true</extensions>
    </plugin>
    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-surefire-plugin</artifactId>
        </plugin>
    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho-version}</version>
    </plugin>
    <plugin>
        <groupId>org.codehaus.tycho</groupId>
        <artifactId>maven-osgi-packaging-plugin</artifactId>
    </plugin>
</plugins>

According to Maven specification, a maven project has tests in src/test/java and its resources in src/test/resources (default). Do you have this structure?

I would like to add that maven Junit tests are run by surefire-plugin which expects this as the default directory structure for tests. If you need to configure this, check this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM