0

私はmaven pom.xmlが初めてです

pom.xml を使用して .java ファイルを実行する方法はありません。何かすることがあれば、私に送ってください。

このJavaファイルにはセレンコード(Junitコード)があります

元:

package com.mycompany.app; 

import com.thoughtworks.selenium.*; 
import org.junit.BeforeClass; import org.junit.Test; import
org.testng.annotations.AfterClass; import
org.testng.annotations.AfterGroups; import
org.testng.annotations.BeforeGroups;

public class App4 {

    @Test
    public void Login1() throws Exception {
        System.out.println("*******Love u mom*******");
    }

}
4

2 に答える 2

0

最も簡単な解決策は、その目的を正確に意図したexec-maven-pluginを使用することです。このようにJavaゴールを使用することも、 execゴールが必要な場合もあります。

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            ...
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>com.example.Main</mainClass>
          <arguments>
            <argument>argument1</argument>
            ...
          </arguments>
          <systemProperties>
            <systemProperty>
              <key>myproperty</key>
              <value>myvalue</value>
            </systemProperty>
            ...
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>
   ...
</project>
于 2013-07-25T05:17:01.270 に答える