2010-12-10 34 views
1

J'ai un peu de difficulté à obtenir le rapport surefire à apparaître dans le site généré. Je cours mvn clean site:site et le rapport est manquant.Maven Surefire Rapport manquant à partir du site généré

Mon pom.xml ressemble à ceci: -

<?xml version="1.0" encoding="UTF-8"?> 
<project> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>testMaven</groupId> 
    <artifactId>testMaven</artifactId> 
    <name>Test Maven Project</name> 
    <version>1.0</version> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.1</version> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.6</version> 
      </plugin> 
     </plugins> 
    </build> 

    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.6</version> 
      </plugin> 
     </plugins> 

    </reporting> 
</project> 

Quand je fais mvn test, le test fonctionne très bien.

$ mvn clean test 
[INFO] Scanning for projects... 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Test Maven Project 
[INFO] task-segment: [clean, test] 
[INFO] ------------------------------------------------------------------------ 
[INFO] [clean:clean {execution: default-clean}] 
[INFO] Deleting directory c:\workspace\java\rsa\testMaven\target 
[INFO] [resources:resources {execution: default-resources}] 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 0 resource 
[INFO] [compiler:compile {execution: default-compile}] 
[INFO] Compiling 1 source file to c:\workspace\java\rsa\testMaven\target\classes 
[INFO] [resources:testResources {execution: default-testResources}] 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 0 resource 
[INFO] [compiler:testCompile {execution: default-testCompile}] 
[INFO] Compiling 1 source file to c:\workspace\java\rsa\testMaven\target\test-classes 
[INFO] [surefire:test {execution: default-test}] 
[INFO] Surefire report directory: c:\workspace\java\rsa\testMaven\target\surefire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
Running testMaven.main.HelloWorldServiceTest 
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 sec 

Results : 

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 

[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESSFUL 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1 second 
[INFO] Finished at: Fri Dec 10 10:42:20 CST 2010 
[INFO] Final Memory: 17M/1016M 
[INFO] ------------------------------------------------------------------------ 

Puis-je savoir ce que je fais mal ici? Merci.

Répondre

4

Vous devez utiliser le plugin maven-surefire-report-dans la section des rapports (au lieu du maven-surefire-plugin), par ex.

<reporting> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-report-plugin</artifactId> 
      <version>2.6</version> 
     </plugin> 
    </plugins> 
</reporting>