soapUI+maven+Jenkins 搭建接口自動化持續集成平臺

1.搭建個Jenkins 環境

2.再Jenkins中安裝maven 插件

3.Jenkins上新建選取構建maven項目,配置如下,其餘均可默認



4.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-pro- maven-plugin </artifactId>
                            <!-- 根據實際情況填寫版本號 -->
                            <version> 5.1.1</version >
                            <configuration>
                            </configuration>
                            <dependencies>
                                   <dependency>
                                          <groupId> org.reflections</groupId >
                                          <artifactId> reflections</artifactId >
                                          <version> 0.9.9-RC1</version >
                                   </dependency>
                                   <dependency>
                                          <groupId> org.apache.poi</groupId >
                                          <artifactId> poi-ooxml</ artifactId>
                                          <version> 3.10-FINAL</version >
                                   </dependency>
                            </dependencies>

                            <executions>
                                   <execution>
                                          <phase> test</phase >
                                          <goals>
                                                 <goal> test</goal >
                                          </goals>
                                          <configuration>
                                          <!--填寫需要執行的腳本路徑  -->
                                                 <projectFile> F:\soapUI\REST-Project-1-soapui-project.xml </projectFile>
                                                 <projectProperties>
                                                        <value> message=API TEST</value>
                                                 </projectProperties>
                                          </configuration>
                                   </execution>
                            </executions>
                      </plugin>
               </plugins>
        </build>
</pre><pre name="code" class="html">
5. 構建
如果構建從maven中心下載插件很慢的話,可以自己搭建個maven 私服




發佈了64 篇原創文章 · 獲贊 12 · 訪問量 27萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章