【问题标题】:Maven Pom.xml not runningMaven Pom.xml 未运行
【发布时间】:2019-05-21 00:50:27
【问题描述】:

我尝试将我的测试作为 -mvn 测试运行,它显示为构建成功但是,没有可编译的源。我已附上我的 pom 和结果文件。

输出:

[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Wepaythemax 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Wepaythemax ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\rck\git\repository3\Wepaythemax\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ Wepaythemax ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Wepaythemax ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ Wepaythemax ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Wepaythemax ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.051 s
[INFO] Finished at: 2018-12-20T18:37:53+05:30
[INFO] Final Memory: 10M/114M

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>Wepaythemax</groupId>
  <artifactId>Wepaythemax</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
 <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.14.3</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-server</artifactId>
    <version>3.141.5</version>
</dependency>
  </dependencies>
  <profiles>
   <profile>
      <id>selenium-tests</id>
      <build>
         <plugins>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>3.1</version>
               <configuration>
                  <suiteXmlFiles>
                     <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                  </suiteXmlFiles>
               </configuration>
            </plugin>     
         </plugins>
      </build>
   </profile>
</profiles>
</project>

帮帮我,我在哪里做错了,我找不到。我正在尝试弄清楚。我还附上了我的 testng.xml 文件所在的屏幕截图

【问题讨论】:

  • 您的目录src/test 只有一个resources 子目录。没有java 子目录可能包含来源
  • 那么如何放置我的testng文件以及在哪里呢? @Seelenvirtuose
  • 你不是在谈论 resources - 比如testng.xml 文件。它告诉你,没有要编译的sources。您的屏幕截图告诉我们,您没有任何来源。那你到底在问什么?
  • 源位置 src/main/java src/test/java 中的单元测试 ...
  • GRRRRR.... 我说的是 sources,而不是 resources。我已经告诉过你,文件testng.xml 位于正确的 位置,因为它是一个资源。在这里你不明白的到底是什么?

标签: java maven selenium selenium-webdriver pom.xml


【解决方案1】:

没有要编译的源代码,意味着 src/main/java 或 src/test/java 中没有 java 文件。 sources 在 src/main/java 中,sources 不同于资源,即 .xml 等。

【讨论】:

  • 是的,明白了一个错误让我感到困惑!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-22
  • 2011-05-10
  • 2011-03-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多