尽管已经进入了目标,但在Maven中没有为此版本指定任何目标。请参阅下面更新的POM。感谢

时间:2018-06-03 23:57:13

标签: maven jenkins

当我尝试在eclipse上运行Maven Test时,我收到以下错误。请参阅下面的POM.XML

<build>
<plugins>
<!-- surefire plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>

<!-- build uploader Linux -->
<suiteXmlFile>src\test\resources\ftp_linux.xml</suiteXmlFile>

</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>8</source>
<target>8</target>
<fork>true</fork>
<executable>C:\Program Files\Java\jdk1.8.0_91\bin\javac.exe</executable>
</configuration>
</plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>RegressionTests.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>
 
</plugins>
</build>

请参阅下面的错误消息。我还检查了xml文件的名称,这是正确的。我不确定为什么它显示为xml文件而不是有效的

[WARNING] The requested profile "Test" could not be activated because it does not exist.
[WARNING] The requested profile "Automation" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project daily-installer: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: Suite file C:\Users\Admin\Downloads\daily-installer-automation-master\daily-installer-automation-master-e26d3512b5f2770b8388270ffcc3078e32571d9a\RegressionTests.xml is not a valid file
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.locateTestSets(TestNGXmlTestSuite.java:98)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] -> [Help 1]
[ERROR] 

enter image description here

现在我收到以下错误

enter image description here

这是我更新的pom.xml

</plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.21.0</version>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>RegressionTests.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>
 
 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-surefire-plugin</artifactId>
 <version>2.21.0</version>
 <executions>
<execution>
<id>test</id>
<phase>integration-test</phase>
<configuration>
<suiteXmlFiles>
	<suiteXmlFile>
         	RegressionTests.xml
	</suiteXmlFile>
</suiteXmlFiles>
</configuration>
      </execution>
      </executions>
     </plugin>


</plugins>
</build>

1 个答案:

答案 0 :(得分:0)

我添加目标广告后,现在正在运作。