doulangxun7769 2019-01-31 16:45
浏览 703

无法执行目标org.apache.maven.plugins:maven-war-plugin:2.2:war(default-war)项目simpleSpringRestWeb:组装WAR时出错:webxml

Im trying to setup everything so I could run a code coverage on maven and after creating a report with it I wanted to view the results on sonarQube dashboard.

Im a complete newbie on those tools so I was trying to research and managed to get some tutorials to get things running. SonarQube is working fine although code coverage is not.

(the code is mostly in php with some css, etc...)

Im Using: Apache Maven 3.6.0, SonarQube 7.5, PHP 7.3.1, jacoco 0.8.3, coverage.
(I think thats all)

My POM file:

<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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion> 
<groupId>com.mytutorial</groupId>
<artifactId>simpleSpringRestWeb</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>simpleSpringRestWeb</name>
<url>http://maven.apache.org</url>

<properties>
    <javac.src.version>1.7</javac.src.version>
    <javac.target.version>1.7</javac.target.version>
    <test.coverage.rate>100</test.coverage.rate>
    <cobertura.skip>false</cobertura.skip>
    <cobertura.skip>false</cobertura.skip>
</properties> 
 <dependencies>
 <dependency>
     <groupId>net.sourceforge.cobertura</groupId>
     <artifactId>cobertura</artifactId>
      <version>2.1.1</version>
      <scope>test</scope>
 </dependency>
 <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.7</version>
        <scope>test</scope>
</dependency>
</dependencies> 
<reporting>
<plugins>
      <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.7</version>
            <configuration>
                <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
            </configuration>
      </plugin>
      <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.2.2</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>3.0.0-M3</version>
        </plugin>
        <plugin> 
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-site-plugin</artifactId>
              <version>3.7.1</version>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.7</version>
            <configuration>
                <formats>
                    <format>xml</format>
                    <format>html</format>
                </formats>
            </configuration>
         <reportSets>
            <reportSet>
                <id>cobertura-report</id>
                <reports>
                    <report>clean</report>
                    <report>cobertura</report>
                </reports>
            </reportSet>
        </reportSets> 
        </plugin>
    </plugins>

sonar-project.properties:
-Dproject.settings=./sonar-project.properties
sonar.cobertura.reportPaths=C:/simple-maven-project-with-tests-master/target/surefire-reports

using mvn install results in Build Failure
mvn install output1 mvn install output2

using mvn clean package results in Build Failure
mvn clean package output1 mvn clean package output2

used someone tip (link below) mvn -Dmaven.test.skip=true your-plugin:your-goal output result

How to run a maven goal when there is tests failures?


I already searched everywhere I could, managed to fix some problems but this one... not at all. I have been tryng to get a solution for days now and at this point Im too confused and dont know what else I can do.

Sorry for the long post and please notice me if I didnt give any important information.

Regards!

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
    • ¥15 C# datagridview 单元格显示进度及值
    • ¥15 thinkphp6配合social login单点登录问题
    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配