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 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 latex怎么处理论文引理引用参考文献
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
    • ¥15 乘性高斯噪声在深度学习网络中的应用