<properties>
<testng.version>6.10</testng.version>
<selenium.version>3.4.0</selenium.version>
<compiler.version>1.8</compiler.version>
<aspectj.version>1.8.10</aspectj.version>
</properties>
<repositories>
<!--<repository>
<id>jcenter</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>-->
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://central.maven.org/maven2/</url>
</repository>
</repositories>
<build>
<!--<sourceDirectory>src</sourceDirectory>-->
<!--<testSourceDirectory>src/test/java/selenium/testng/tests</testSourceDirectory>-->
<plugins>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${compiler.version}</source>
<target>${compiler.version}</target>
</configuration>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<testSourceDirectory>/src/test/java/</testSourceDirectory>
<!--<testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>-->
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>-->
</plugins>
</build>
这是我项目中的POM文件。当我运行mvn编译时,它说的是BUILD SUCCESS,但是在项目目录中根本没有目标文件夹。Maven并没有创建/目标目录,也没有任何类文件
我试图调试编译阶段,我看不到任何错误消息。 我一直坚持下去,特别是这是我的第一个maven项目。 我的POM配置是否正确?
P.S当我运行mvn clean时,我看到使用了maven-clean-plugin。 当我运行MVN编译我没有看到类似的文本,如“行家 - 编译 - 插件:”在cmd窗口
我的项目结构:
src
---main
----java
-----selenium
---test
---java
----selenium
----pages
----tests
请发布您的完整pom文件... – khmarbaise
除了没有使用标准的Maven目录结构之外,您已将编译插件注释掉了,所以,那里有那个 –
我已经使用了您的pom并在其工作正常之后注释掉 configuration> suiteXmlFiles –