【问题标题】:pom.xml: Unrecognised tag: 'soapuiProperties'pom.xml:无法识别的标签:'soapuiProperties'
【发布时间】:2016-11-25 09:07:27
【问题描述】:

我在 Eclipse 的 Maven 项目中使用 Cucumber 来启动 SoapUI。

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

但是,当我使用“mvn test”从命令行启动时,出现以下错误:

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 块,但结果是一样的。

【问题讨论】:

    标签: java maven soapui pom.xml


    【解决方案1】:

    错误

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

    表示您的 POM 文件 (pom.xml) 格式错误。也就是说你把soapuiProperties标签放错了地方。

    您需要将soapuiProperties 移动到build/plugins/plugin/configuration 以获取soapui-maven-plugin。所以这里是 pom.xml 的正确外观的 sn-p:

    <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>
    

    【讨论】:

      【解决方案2】:

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

      pluginRepositories 部分声明maven 将尝试从哪里查找和下载插件。

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

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

      【讨论】:

        猜你喜欢
        • 2016-12-12
        • 2022-01-05
        • 2015-12-26
        • 2013-05-08
        • 2017-11-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-01-17
        相关资源
        最近更新 更多