Unable to run project through cmd prompt using Ant + Maven | Selenium Forum
M
Posted on 02/09/2016
Hi,

I am running my project using ant + maven configuration though command prompt.

It is giving an error to me that different version of ant exists, where it is giving me path of "ANT_HOME" added in environment variable and path of .M2 i.e. maven repo path.

I have tired deleting the M2 repo and downloading again but still it is giving same error.

Any help on this is appreciated.

run:
[junit] WARNING: multiple versions of ant detected in path for junit
[junit] jar:file:/E:/apache-ant-1.9.7/lib/ant.jar!/org/apache/tools
/ant/Project.class
[junit] and jar:file:/C:/Users/Lenovo/.m2/repository/org/apache/ant/ant
/1.9.7/ant-1.9.7.jar!/org/apache/tools/ant/Project.class

M
Replied on 03/09/2016

delete this jar file
[color=#FF0000:2irwiyqx][junit] jar:file:/E:/apache-ant-1.9.7/lib/ant.jar!/org/apache/tools
/ant/Project.class[/color:2irwiyqx]


M
Replied on 03/09/2016

Deleted the above mentioned ant.jar and executed "ant clean\build\run" from command prompt
it is saying ANT_HOME not set up correctly.

The above ant.jar points to ANT_HOME environment variable path while other points to Maven repository.

Also the error which is coming in JUnit result file is:-
com.google.common.collect.Multimaps.transformValues(Lcom/google/common/collect/ListMultimap;Lcom/google/common/base/Function;)Lcom/google/common/collect/ListMultimap;

java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.transformValues(Lcom/google/common/collect/ListMultimap;Lcom/google/ccommon/base/Function;)Lcom/google/common/collect/ListMultimap;
at com.google.commmon.net.MediaType.computeToString(MediaType.java:751)
at com.google.common.net.MediaType.toString(MediaType.java:741)
at org.openqa.selenium.remote.htttp.JsonHttpCommandCodec.encode(JsonHttpCommandCodec.java:232)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:139)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnnection.execute(NewProfileExtensionConnection.java:160)
at org.openqa.selenium.firefox.FFirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:380)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java::249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FiirefoxDriver.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)

at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriiver.java:207)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriiver.java:120)
at com.testing.AppTest.testApp(AppTest.java:18)


M
Replied on 04/09/2016

there is still a duplicate jar in your folder

http://stackoverflow.com/questions/25088899/selenium-webdriver-throws-exception-when-trying-to-run-via-ant