You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mahesh Bedampeta (JIRA)" <ji...@apache.org> on 2016/02/26 06:16:18 UTC

[jira] [Updated] (MNG-5985) Need help in executing a Java program and testng.xml one after other using Maven

     [ https://issues.apache.org/jira/browse/MNG-5985?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahesh Bedampeta updated MNG-5985:
----------------------------------
    Description: 
​My question is that I wanted to execute a testNG suite file and a java program one after other using a POM.xml.

Please help me out with a code snippet that actually does this execution.


Below is my code that is currently running my test scripts of testng.xml, and I want to add a code for executing a separate Java(Main)​ class. Please add the code for executing my java program in it.

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<argLine>
	-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
</argLine>
<suiteXmlFiles>
<suiteXmlFile>${basedir}\testng.xml</suiteXmlFile>
</suiteXmlFiles>
<outputDirectory>${basedir}/results</outputDirectory>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>


  was:
​My question is that I wanted to execute a testNG suite file and a java program one after other using a POM.xml.

Please help me out with a code snippet that actually does this execution.


Below is my code that is currently running my test scripts of testng.xml, and I want to add a code for executing a separate Java(Main)​ class. Please add the code for executing my java program in it.

         <build>
                    <plugins>
                          <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.17</version>
				<configuration>
					<argLine>
						-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
					</argLine>
						<suiteXmlFiles>
						<suiteXmlFile>${basedir}\testng.xml</suiteXmlFile>
					</suiteXmlFiles>
					<outputDirectory>${basedir}/results</outputDirectory>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.aspectj</groupId>
						<artifactId>aspectjweaver</artifactId>
						<version>${aspectj.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>



> Need help in executing a Java program and testng.xml one after other using Maven 
> ---------------------------------------------------------------------------------
>
>                 Key: MNG-5985
>                 URL: https://issues.apache.org/jira/browse/MNG-5985
>             Project: Maven
>          Issue Type: Question
>          Components: core
>            Reporter: Mahesh Bedampeta
>            Priority: Minor
>
> ​My question is that I wanted to execute a testNG suite file and a java program one after other using a POM.xml.
> Please help me out with a code snippet that actually does this execution.
> Below is my code that is currently running my test scripts of testng.xml, and I want to add a code for executing a separate Java(Main)​ class. Please add the code for executing my java program in it.
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.17</version>
> <configuration>
> <argLine>
> 	-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
> </argLine>
> <suiteXmlFiles>
> <suiteXmlFile>${basedir}\testng.xml</suiteXmlFile>
> </suiteXmlFiles>
> <outputDirectory>${basedir}/results</outputDirectory>
> </configuration>
> <dependencies>
> <dependency>
> <groupId>org.aspectj</groupId>
> <artifactId>aspectjweaver</artifactId>
> <version>${aspectj.version}</version>
> </dependency>
> </dependencies>
> </plugin>
> </plugins>
> </build>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)