Получение Для этого билда в Maven не было задано ни одной цели, несмотря на то, что она была включена в GoalsПожалуйста, смотрите обновленный POM ниже.Спасибо - PullRequest
0 голосов
/ 04 июня 2018

При попытке запустить 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 голосов
/ 04 июня 2018

Теперь он работает после того, как я добавил тег цели.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...