Class Not Found exception with exec-maven-plugin when run on Linux -


i trying run testng tests. project organization - src->test->java->com->shn->library below command works in windows fails in linux.

mvn -x clean exec:java -dexec.mainclass="com.shn.library.runsuitesinparallel" -dexec.classpathscope=test -e 

error seen in linux on running same command -

[error] failed execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project uaf: exception occured while executing java class. com.shn.library.runsuitesinparallel -> [help 1] org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project uaf: exception occured while executing java class. com.shn.library.runsuitesinparallel         @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:217)         @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153)         @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145)         @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:84)         @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:59)         @ org.apache.maven.lifecycle.internal.lifecyclestarter.singlethreadedbuild(lifecyclestarter.java:183)         @ org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:161)         @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:320)         @ org.apache.maven.defaultmaven.execute(defaultmaven.java:156)         @ org.apache.maven.cli.mavencli.execute(mavencli.java:537)         @ org.apache.maven.cli.mavencli.domain(mavencli.java:196)         @ org.apache.maven.cli.mavencli.main(mavencli.java:141)         @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)         @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)         @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)         @ java.lang.reflect.method.invoke(method.java:601)         @ org.codehaus.plexus.classworlds.launcher.launcher.launchenhanced(launcher.java:290)         @ org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:230)         @ org.codehaus.plexus.classworlds.launcher.launcher.mainwithexitcode(launcher.java:409)         @ org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:352) caused by: org.apache.maven.plugin.mojoexecutionexception: exception occured while executing java class. com.shn.library.runsuitesinparallel         @ org.codehaus.mojo.exec.execjavamojo.execute(execjavamojo.java:352)         @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:101)         @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:209)         ... 19 more caused by: java.lang.classnotfoundexception: com.shn.library.runsuitesinparallel         @ java.net.urlclassloader$1.run(urlclassloader.java:366)         @ java.net.urlclassloader$1.run(urlclassloader.java:355)         @ java.security.accesscontroller.doprivileged(native method)         @ java.net.urlclassloader.findclass(urlclassloader.java:354)         @ java.lang.classloader.loadclass(classloader.java:423)         @ java.lang.classloader.loadclass(classloader.java:356)         @ org.codehaus.mojo.exec.execjavamojo$1.run(execjavamojo.java:285)         @ java.lang.thread.run(thread.java:722) [error] [error] [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception 

i ran -

mvn clean install. 

post when run -

mvn -x clean exec:java -dexec.mainclass="com.shn.library.runsuitesinparallel" -dexec.classpathscope=test -e 

the compiled classes deleted & error apparent.

so solution -

mvn -x clean install exec:java -dexec.mainclass="com.shn.library.runsuitesinparallel" -dexec.classpathscope=test -e 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -