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 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 matlab求解平差
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
    • ¥15 安装svn网络有问题怎么办