2016-07-21 52 views
-1

我在Eclipse的Maven项目中使用Cucumber来启动SoapUI。pom.xml:无法识别的标记:'soapuiProperties'

当从Eclipse内运行时,我的POM.xml文件运行良好,测试完成且没有错误。

然而,当我从 “MVN测试” 从命令行启动我得到这个错误:

的pom.xml:无法识别的标签: 'soapuiProperties'(位置:START_TAG看到... \ r \ n \ [R \ n ..

下面是pom.xml中

<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> 
    <groupId>Project_name</groupId> 
    <artifactId>Project_name</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <parent> 
     <groupId>com.smartbear</groupId> 
     <artifactId>ready-api</artifactId> 
     <version>1.7.0</version> 
    </parent> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    </properties> 
    <repositories> 
     <repository> 
      <id>SmartBearPluginRepository</id> 
      <url>http://www.soapui.org/repository/maven2/</url> 
     </repository> 
     <repository> 
      <id>maven2-repository.java.net</id> 
      <name>Java.net Repository for Maven</name> 
      <url>http://java.net/projects/maven-repository/</url> 
      <layout>default</layout> 
     </repository> 
    </repositories> 
    <!--Adding SoapUI Maven plugin--> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>SmartBearPluginRepository</id> 
      <url>http://www.soapui.org/repository/maven2/</url> 
       <soapuiProperties> 
        <property> 
         <name>soapui.home</name> 
         <value>C:\Program Files\SmartBear\ReadyAPI\bin</value> 
        </property> 
       </soapuiProperties> 
     </pluginRepository> 
    </pluginRepositories>  

    <build> 
    <sourceDirectory>src</sourceDirectory>   
    <plugins> 
      <plugin> 
       <artifactId>maven-install-plugin</artifactId> 
       <version>2.3</version> 
       <configuration> 
        <createChecksum>true</createChecksum> 
        <updateReleaseInfo>true</updateReleaseInfo> 
        <tasks> 
         <copy file="pom.xml" 
           tofile="${project.build.directory}/ready-api-maven-plugin-${project.version}.pom"/> 
        </tasks> 
       </configuration> 
      </plugin>    
      <plugin> 
       <artifactId>maven-assembly-plugin</artifactId> 
       <executions> 
        <execution> 
         <phase>package</phase> 
         <goals> 
          <goal>single</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <outputDirectory>${assembly.build.directory}</outputDirectory> 
        <descriptors> 
         <descriptor>src/main/assembly/public-pom.xml</descriptor> 
        </descriptors> 
       </configuration> 
      </plugin> 
      <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.5.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin>   
    </plugins> 
    </build> 
    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.12</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-junit</artifactId> 
      <version>1.2.2</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-java</artifactId> 
      <version>1.2.2</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.smartbear.soapui</groupId> 
      <artifactId>soapui</artifactId> 
      <version>5.2.1</version> 
      <scope>compile</scope> 
      <!-- <executions> 
       <execution> 
        <phase>test 
        </phase> 
        <goals> 
         <goal>test 
         </goal> 
        </goals> 
        <configuration> 
         <projectFile>C:\\Users\\charles\\test-automation\\Soapui\\Project_name-REST-soapui-project.xml</projectFile> 
        </configuration> 
       </execution> 
      </executions> --> 
     </dependency> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-java</artifactId> 
      <version>2.53.1</version> 
     </dependency> 
    </dependencies> 
</project> 

任何想法,我需要怎么解决POM?我试图移动SoapUIproperties阻断流入和流出的pluginrepsositories块,但有水库ult是一样的。

+0

这是什么'soapuiProperties'?它的用途是什么? – Tunaki

+0

请根据官方文档https://www.soapui.org/test-automation/maven/maven-2-x.html修复你的pom,或者解释你想做什么特别的事情!事实上,它根本没有意义。 – SiKing

+0

我已经尝试过soapui网站的各种POM文件,并且他们都没有为我工作,我已经在本地开发人员的帮助下开发了一个自定义POM。 –

回答

0

soapuiProperties不是pluginRepository元素的有效子元素。

pluginRepositories部分声明maven将尝试从中找到并下载插件。

它似乎没有使用SoapUI插件,因此您可能会删除pluginRepositories部分。

soapuiProperties的位置表明它未被测试使用,因此您可以删除它。

0

错误

pom.xml: Unrecognised tag: 'soapuiProperties' (position: START_TAG seen ...\r\n \r\n ..

意味着你已经畸形的POM文件(pom.xml中)。换句话说,您已将soapuiProperties标签放置在错误的地方。

您需要将soapuiProperties移动到build/plugins/plugin/configurationsoapui-maven-plugin。所以这里是pom.xml应该如何正确的代码片段:

<pluginRepositories> 
    <pluginRepository> 
     <id>smartbear-sweden-plugin-repository</id> 
     <url>http://www.soapui.org/repository/maven2/</url> 
    </pluginRepository> 
</pluginRepositories> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>com.smartbear.soapui</groupId> 
      <artifactId>soapui-maven-plugin</artifactId> 
      <version>5.2.1</version> 
      <configuration> 
       <projectFile>soapui-tests.xml</projectFile>      
       <soapuiProperties> 
        <property> 
         <name>soapui.logroot</name> 
         <value>${project.build.directory}/soapui-logs/</value> 
        </property> 
       </soapuiProperties> 
      </configuration>     
     </plugin> 
    </plugins> 
相关问题