无法为自动化框架创建Build

时间:2015-08-18 10:00:06

标签: maven pom.xml

看看下面的POM:

<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>com.newscase</groupId>
    <artifactId>Newscase_WebApp</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <dependencies>

    <!-- Extent Reports Generation Dependency -->
    <dependency>
        <groupId>com.relevantcodes</groupId>
        <artifactId>extentreports</artifactId>
        <version>1.4</version>
    </dependency>

    <!-- PDF Reports Generation Dependency -->
    <dependency>
        <groupId>com.lowagie</groupId>
        <artifactId>itext</artifactId>
        <version>2.1.7</version>
    </dependency>

    <!-- TestNG Dependency -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.8.21</version>
    </dependency>

    <!-- Guice Dependency -->
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>3.0</version>
    </dependency>

    <!-- ReportNG Dependency -->
    <dependency>
        <groupId>org.uncommons</groupId>
        <artifactId>reportng</artifactId>
        <version>1.1.4</version>
    </dependency>

    <!-- Mail Dependency -->
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
    </dependency>

    <!-- JSon Dependency -->
    <dependency>
        <groupId>com.googlecode.json-simple</groupId>
        <artifactId>json-simple</artifactId>
        <version>1.1</version>
    </dependency>

    <!-- Selenium Dependency -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.45.0</version>
    </dependency>

    <!-- Selenium Server Dependency -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.45.0</version>
    </dependency>

    <!-- HTTP Client Dependency -->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.4.1</version>
    </dependency>

    <!-- Apache POI Dependency -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.12</version>
    </dependency>

    <!-- JXL Dependency -->
    <dependency>
        <groupId>net.sourceforge.jexcelapi</groupId>
        <artifactId>jxl</artifactId>
        <version>2.6.12</version>
    </dependency>

    <!-- Mysql connector -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.6</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.16</version>
            <configuration>
                <systemPropertyVariables>
                    <propertyName>propertyValue</propertyName>
                    <buildDirectory>${project.build.directory}</buildDirectory>
                </systemPropertyVariables>
                <property>
                    <name>listener</name>
                    <value>com.newscase.listeners.IReportsListener,com.newscase.listeners.PDFListener,com.newscase.listeners.RetryListener</value>
                </property>
                <suitexmlfiles>
                    <suitexmlfile>testng.xml</suitexmlfile>
                </suitexmlfiles>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <encoding>iso-8859-1</encoding>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

有效POM:

<build>
    <sourceDirectory>/Users/sandeep/Documents/test-automation/src/main/java</sourceDirectory>
    <scriptSourceDirectory>/Users/sandeep/Documents/test-automation/src/main/scripts</scriptSourceDirectory>
    <testSourceDirectory>/Users/sandeep/Documents/test-automation/src/test/java</testSourceDirectory>
    <outputDirectory>/Users/sandeep/Documents/test-automation/target/classes</outputDirectory>
    <testOutputDirectory>/Users/sandeep/Documents/test-automation/target/test-classes</testOutputDirectory>
    <resources>
      <resource>
        <directory>/Users/sandeep/Documents/test-automation/src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>/Users/sandeep/Documents/test-automation/src/test/resources</directory>
      </testResource>
    </testResources>
    <directory>/Users/sandeep/Documents/test-automation/target</directory>
    <finalName>Newscase_WebApp-0.0.1-SNAPSHOT</finalName>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.3</version>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2-beta-5</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.8</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.3.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <systemPropertyVariables>
                <propertyName>propertyValue</propertyName>
                <buildDirectory>/Users/sandeep/Documents/test-automation/target</buildDirectory>
              </systemPropertyVariables>
              <property>
                <name>listener</name>
                <value>com.newscase.listeners.IReportsListener,com.newscase.listeners.PDFListener,com.newscase.listeners.RetryListener</value>
              </property>
              <suitexmlfiles>
                <suitexmlfile>testng.xml</suitexmlfile>
              </suitexmlfiles>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <systemPropertyVariables>
            <propertyName>propertyValue</propertyName>
            <buildDirectory>/Users/sandeep/Documents/test-automation/target</buildDirectory>
          </systemPropertyVariables>
          <property>
            <name>listener</name>
            <value>com.newscase.listeners.IReportsListener,com.newscase.listeners.PDFListener,com.newscase.listeners.RetryListener</value>
          </property>
          <suitexmlfiles>
            <suitexmlfile>testng.xml</suitexmlfile>
          </suitexmlfiles>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <executions>
          <execution>
            <id>default-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <encoding>iso-8859-1</encoding>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
          </execution>
          <execution>
            <id>default-testCompile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <encoding>iso-8859-1</encoding>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <encoding>iso-8859-1</encoding>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
        <executions>
          <execution>
            <id>default-clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>default-testResources</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>testResources</goal>
            </goals>
          </execution>
          <execution>
            <id>default-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>default-install</id>
            <phase>install</phase>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.3</version>
        <executions>
          <execution>
            <id>default-site</id>
            <phase>site</phase>
            <goals>
              <goal>site</goal>
            </goals>
            <configuration>
              <outputDirectory>/Users/sandeep/Documents/test-automation/target/site</outputDirectory>
              <reportPlugins>
                <reportPlugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-project-info-reports-plugin</artifactId>
                </reportPlugin>
              </reportPlugins>
            </configuration>
          </execution>
          <execution>
            <id>default-deploy</id>
            <phase>site-deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
            <configuration>
              <outputDirectory>/Users/sandeep/Documents/test-automation/target/site</outputDirectory>
              <reportPlugins>
                <reportPlugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-project-info-reports-plugin</artifactId>
                </reportPlugin>
              </reportPlugins>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <outputDirectory>/Users/sandeep/Documents/test-automation/target/site</outputDirectory>
          <reportPlugins>
            <reportPlugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
            </reportPlugin>
          </reportPlugins>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <outputDirectory>/Users/sandeep/Documents/test-automation/target/site</outputDirectory>
  </reporting>
</project>

请找我的Screeshot我的框架结构。

我在TestData文件夹下的Testdata.xls中有我的测试数据 Html_Reports文件夹下的扩展区报告的HTML报告。

但是在构建POM时,它正在考虑目标文件夹中的上述内容。

请帮助我这个主题!!!

提前致谢。

screen

0 个答案:

没有答案