[英]Unable to execute maven project
我已將我的項目從 Java 更改為 Maven。 現在嘗試執行我的腳本。 沒有得到我不正確的地方以及如何使用 maven 運行我的完整框架。
<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>1MyProjectName</groupId>
<artifactId>1MyProjectName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>1MyProjectNameAllDevices</name>
<description>Testing for multiple devices using remote server access.</description>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<mainClass>com.main.DriverScript</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
直接刪評論吧...
<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>1MyProjectName</groupId>
<artifactId>1MyProjectName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>1MyProjectNameAllDevices</name>
<description>Testing for multiple devices using remote server access.</description>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
</resource>
</resources>
<plugins>
</plugins>
</build>
</project>
您可以在 pom.xml 中定義所有依賴項/jar 文件,如下所示
<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>1MyProjectName</groupId>
<artifactId>1MyProjectName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>1MyProjectNameAllDevices</name>
<description>Testing for multiple devices using remote server access.
</description>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>"**/*.java"</exclude> //remove "", comment when you copy this code.
</excludes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>selenium-java-2.45.0</artifactId>
<groupId>..</groupId>
<scope>system</scope>
<systemPath>${user.home}/softwares/selenium-java-2.45.0.jar</systemPath>
<version>2.45.0</version>
</dependency>
<dependency>
<artifactId>selenium-server-standalone-2.44.0</artifactId>
<groupId>..</groupId>
<scope>system</scope>
<systemPath>${user.home}/softwares/selenium-server-standalone-2.44.0.jar</systemPath>
<version>2.44.0</version>
</dependency>
</dependencies>
</project>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.