Maven build works with Docker GUI running but not with the binary - maven

I installed the Docker executable with brew install docker and I can see it in the PATH of bash:
$ which docker
/usr/local/bin/docker
I set up a Spring Boot application with this Dockerfile:
FROM openjdk:8-jre
MAINTAINER ...
COPY dist /dist/
ARG JAR_FILE
COPY target/${JAR_FILE} /target/app.jar
EXPOSE 8080
CMD ["java", "-jar", "/target/app.jar"]
When I have the Docker GUI application running, Maven builds the app and I can run it and see it locally. But when the Docker GUI application is not running, Maven is unable to build the app, even though it is in the bash executable, because it can't establish a connection to Docker:
$ mvn clean install
[INFO] Scanning for projects...
...
[WARNING] An attempt failed, will retry 1 more times
org.apache.maven.plugin.MojoExecutionException: Could not build image
...
Caused by: com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Connection refused
...
Caused by: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Connection refused
...
Caused by: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Connection refused
...
Caused by: java.io.IOException: Connection refused
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.498 s
[INFO] Finished at: 2018-09-12T11:39:34+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.4:build (default) on project econometer: Could not build image: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Connection refused -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Does Maven use a different PATH than bash? How can I give the path to the docker executable to Maven?

Docker uses a client-server architecture, and the "whale" application provides the "server" half of it. On a Mac you need to have the desktop application running (or a heavier-weight VM like what Docker Machine or minikube provides) to use any Docker commands or otherwise interact with Docker.

Related

Jenkinsfile pipeline with DependenceCheck fail with RetireJS checking

Error as below:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.902 s
[INFO] Finished at: 2021-01-21T09:58:57+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.owasp:dependency-check-maven:6.0.5:check (default-cli) on project core-account-service: One or more exceptions occurred during dependency-check analysis: One or more exceptions occurred during analysis:
[ERROR] InitializationException: Unable to initialize the Retire JS respository
[ERROR] caused by UpdateException: Failed to initialize the RetireJS repo
[ERROR] caused by DownloadFailedException: Download failed, unable to copy 'https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json' to '/app/repository/org/owasp/dependency-check-utils/6.0.5/../../dependency-check-data/5.0/jsrepository.json'; Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
[ERROR] caused by DownloadFailedException: Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
[ERROR] caused by ConnectException: Connection refused (Connection refused)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Jenkins Pipeline
stage('dependencyCheck') {
steps {
parallel(
dependencyCheck: {
sh 'mvn org.owasp:dependency-check-maven:check -Ddependency-check-format=XML -DdisableRetireJS -DdisableNodeJS'
step([$class: 'DependencyCheckPublisher', unstableTotalAll: '0'])
}
)
}
}
stage('dependencyCheck') {
steps {
parallel(
dependencyCheck: {
sh 'mvn org.owasp:dependency-check-maven:check -Ddependency-check-format=XML --disableRetireJS --disableNodeJS'
step([$class: 'DependencyCheckPublisher', unstableTotalAll: '0'])
}
)
}
}
When we try to integrate Dependency-check with Jenkins Pipelow as above showing, it's failed.
Any idea about how to add disableRetireJS and disableNodeJS , when use mvn org.owasp:dependency-check-maven:check

Gitlab CI. mvn verify. Failed to execute goal

I tried build locally:
mvn -B verify
All works fine.
.gitlab-ci.yml :
image: maven:latest
verify-job:
script:
- mvn -B verify
After checked several modules maven. I get error:
[INFO] Tree 1.0-0 ......................................... FAILURE [ 7.587 s]
... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2018-12-25T13:51:57Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project Tree: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :Tree
ERROR: Job failed: exit code 1
no module uses dependency org.apache.maven.plugins:maven-surefire-plugin
I checked another answers on SO with the same error, no one is related with CI GitLab integration.
I can guess it's related to ktlint, but why local builds are successful?
I find a solution:
just add to pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
Here you can go for the solution, your pipeline need to be define jdk package add:
Just make sure about the java version as per your project needs:
Java_Build:
stage: build
image:
name: docker:20.10
services:
- docker:dind
before_script:
- apk update
- apk add openjdk8
- apk add maven
script:
- mvn -B verify

Openshift : Fabric deployment fails with while building image

I am trying to deploy the sample project using Fabric8 Maven plugin.
https://github.com/jbossdemocentral/katacoda-fuse-getting-started.git
I have a up and running Openshift environment in remote machine and I am connecting to it using "oc login ....."
Local Development Machine Setup: has docker, maven. oc installed.
OS: Mac OS
> docker version
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:20:08 2016
OS/Arch: darwin/amd64
Server:
Version: 18.05.0-ce
API version: 1.37
Go version: go1.10.1
Git commit: f150324
Built: Wed May 9 22:20:42 2018
OS/Arch: linux/amd64
>> oc version
oc v3.9.25
kubernetes v1.9.1+a0ce1bc657
When I run the sample project "mvn fabric8:deploy" from command prompt, the build fails with
Error Logs:
[DEBUG] Trying to configure client from Kubernetes config...
[DEBUG] Found for Kubernetes config at: [/Users/apiteam/.kube/config].
[WARNING] F8: Cannot access cluster for detecting mode: Unknown host placholder.openshiftenv.com
[INFO] F8: Building Docker image in Kubernetes mode
[INFO] F8: spring-boot: Using fat jar packaging as the spring boot plugin is using `repackage` goal execution
[INFO] F8: Running generator spring-boot
[INFO] F8: spring-boot: Using Docker image jboss-fuse-6/fis-java-openshift:2.0 as base / builder
[ERROR] F8: I/O Error executing build for image [fuse/fuse-camel-sb-rest:snapshot-180515-144114-0343] "spring-boot":io.fabric8.maven.docker.access.DockerAccessException: Unable to pull 'jboss-fuse-6/fis-java-openshift:2.0'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:22 min
[INFO] Finished at: 2018-05-15T14:42:21+05:30
[INFO] Final Memory: 52M/400M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build (default) on project fuse-camel-sb-rest: I/O Error executing build for image [fuse/fuse-camel-sb-rest:snapshot-180515-144114-0343] "spring-boot":io.fabric8.maven.docker.access.DockerAccessException: Unable to pull 'jboss-fuse-6/fis-java-openshift:2.0': Get https://registry-1.docker.io/v2/jboss-fuse-6/fis-java-openshift/manifests/2.0: Get https://auth.docker.io/token?scope=repository%3Ajboss-fuse-6%2Ffis-java-openshift%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) (Internal Server Error: 500) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:fabric8-maven-plugin:3.1.80.redhat-000010:build (default) on project fuse-camel-sb-rest: I/O Error executing build for image [fuse/fuse-camel-sb-rest:snapshot-180515-144114-0343] "spring-boot":io.fabric8.maven.docker.access.DockerAccessException: Unable to pull 'jboss-fuse-6/fis-java-openshift:2.0'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:352)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:197)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: I/O Error executing build for image [fuse/fuse-camel-sb-rest:snapshot-180515-144114-0343] "spring-boot":io.fabric8.maven.docker.access.DockerAccessException: Unable to pull 'jboss-fuse-6/fis-java-openshift:2.0'
at io.fabric8.maven.plugin.mojo.build.BuildMojo.buildAndTag(BuildMojo.java:242)
at io.fabric8.maven.docker.BuildMojo.executeInternal(BuildMojo.java:47)
at io.fabric8.maven.plugin.mojo.build.BuildMojo.executeInternal(BuildMojo.java:218)
at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:193)
at io.fabric8.maven.plugin.mojo.build.BuildMojo.execute(BuildMojo.java:201)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 24 more
Caused by: io.fabric8.maven.docker.access.DockerAccessException: Unable to pull 'jboss-fuse-6/fis-java-openshift:2.0'
at io.fabric8.maven.docker.access.hc.DockerAccessWithHcClient.pullImage(DockerAccessWithHcClient.java:369)
at io.fabric8.maven.docker.AbstractDockerMojo.checkImageWithAutoPull(AbstractDockerMojo.java:439)
at io.fabric8.maven.docker.AbstractBuildSupportMojo.autoPullBaseImage(AbstractBuildSupportMojo.java:110)
at io.fabric8.maven.docker.AbstractBuildSupportMojo.buildImage(AbstractBuildSupportMojo.java:63)
at io.fabric8.maven.docker.BuildMojo.buildAndTag(BuildMojo.java:56)
at io.fabric8.maven.plugin.mojo.build.BuildMojo.buildAndTag(BuildMojo.java:235)
... 30 more
Caused by: io.fabric8.maven.docker.access.hc.http.HttpRequestException: Get https://registry-1.docker.io/v2/jboss-fuse-6/fis-java-openshift/manifests/2.0: Get https://auth.docker.io/token?scope=repository%3Ajboss-fuse-6%2Ffis-java-openshift%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) (Internal Server Error: 500)
at io.fabric8.maven.docker.access.hc.ApacheHttpClientDelegate$StatusCodeCheckerResponseHandler.handleResponse(ApacheHttpClientDelegate.java:177)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
at io.fabric8.maven.docker.access.hc.ApacheHttpClientDelegate.post(ApacheHttpClientDelegate.java:97)
at io.fabric8.maven.docker.access.hc.DockerAccessWithHcClient.pullImage(DockerAccessWithHcClient.java:366)
... 35 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I followed the instructions given in the Redhat site and setup the local environment with docker, oc and access to Openshift environment from local machine via oc login. Also, I dont have much knowledge on the openshift environment thats running remotely, I got only openshift console and the token with which am connecting from local machine.
So, now the questions I have are
Is there any additional setup required to use fabric8 in Local machine?
As mentioned already, am not aware if fabric8 is installed on top of openshift platform. Is it mandatory to have fabric8 on openshift setup or openshift provides this out of the box.
I checked in openshift console, it has got "jboss-fuse-6/fis-java-openshift:2.0" imagestreams. Do I need to get the docker internal repository url of the openshift platform and should this needs to be configured in the source code somewhere? In logs "https://registry-1.docker.io/v2/jboss-fuse-6/fis-java-openshift/manifests/2.0", where this comes from - I dont seem to find this configuration in source code. Does fabric8 automatically connects to the Internal docker registry of openshift env?
When the "mvn fabric8:deploy" is run, my understanding is "Project is compiled locally, Local docker connects to the Openshift environment and pulls the base images (in this case 'jboss-fuse-6/fis-java-openshift:2.0') into Local machine and builds the final images and deploys to openshift environment". Is this correct or - is it the other away around i.e, the springboot jar, docker images are built inside openshift platform and deployed too?
Should my profile in openshift also needs to have access to Internal Openshift Registry to pull docker images?
Can someone please clarify the doubts and help with the issue?
If you use OpenShift and fabric8 s2i build, local setup is not
required. All builds and deployments run in OpenShift. The error
shows that OpenShift can not pull
jboss-fuse-6/fis-java-openshift:2.0 image.
AFAIK, OpenShift doesn't provide fabric8.
This image is hosted in redhat container registry, not official
docker registry. In other words, this image is located at
registry.access.redhat.com/jboss-fuse-6/fis-java-openshift, not
registry-1.docker.io/v2/jboss-fuse-6/fis-java-openshift.
You need to enable docker engine to access redhat registry, please refer to this for example.
Not the way you think if you are running s2i build.
Not necessary, for either s2i build or docker build.
mvn package fabric8:build works.
<registry>registry.access.redhat.com</registry>
<authConfig>
<username>registry-username</username>
<password>registry-password</password>
</authConfig>
</configuration>

Sakai 12.1 deploy command error when connecting to MySQL through JBDC driver

I am currently trying to deploy an instance of the latest Sakai 12.1 on Tomcat, but when I run the
mvn clean install sakai:deploy -Dmaven.tomcat.home=$CATALINA_HOME -Dsakai.home=$CATALINA_HOME/sakai -Dsakai.cleanup=true -Djava.net.preferIPv4Stack=true command, if executes without errors until the "Sakai Core Kernel Implementation" modules (out of the 413), returning this:
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:30 min
[INFO] Finished at: 2018-05-17T13:33:19+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project sakai-kernel-impl: There are test failures.
[ERROR]
[ERROR] Please refer to /home/usuario/sakai/kernel/kernel-impl/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :sakai-kernel-impl
I have seen the error log and the first one is in the RoleAccessTest test.
The log info:
...
13:29:15,161 INFO PoolBase:505 - sakai - Driver does not support get/set network timeout for connections. (not supported feature)
13:29:15,168 ERROR PoolBase:441 - sakai - Failed to execute connection test query (insufficient user privileges or object not found: DUAL).
13:29:15,169 ERROR HikariPool:541 - sakai - Exception during pool initialization.
java.sql.SQLSyntaxErrorException: insufficient user privileges or object not found: DUAL
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
...
[EDIT: Looking at the preceding log, why does HSQLDB arises in the error stack? Isn't supposed to be only MySQL?]
Later, in another line:
WARN JdbcServicesImpl:195 - HHH000341: Could not obtain connection metadata
The Mysql Driver JAR is correctly copied in /opt/tomcat/lib, and the DB user and credentials correctly set in /opt/tomcat/sakai/local.properties
I do not want to deploy Sakai without running test as this is a complete fresh installation and there should not be any errors...
Any help?
Look in your sakai.properties or local.properties. It probably has the line
# validationQuery#javax.sql.BaseDataSource=select 1 from DUAL
This is the SQL query Sakai issues by default to check whether the database is reachable. It looks as though the database system you're using doesn't support that query, so you'll either need to set that property to some other query, or switch the database system you're using. MySQL supports this query, so if you have
vendor#org.sakaiproject.db.api.SqlService=mysql
I'm wrong and it must be something else.

Error while running through command line in springs

I have a test class that uses #Autowired annotation and #ContextConfiguration and #Category annotations.
The test tuns fine when its run through eclipse.
But when i try running it through Command line, it is throwing the following error.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.690s
[INFO] Finished at: Wed Jun 12 09:56:48 GMT+05:30 2013
[INFO] Final Memory: 31M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.14.1:integration-test (default) on project OmnitureSeleniumTests: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.14.1:integration-test failed: There was an error in the forked process
[ERROR] java.lang.NoSuchMethodError: org.junit.runner.Request.classes(Lorg/junit/runner/Computer;[Ljava/lang/Class;)Lorg/junit/runner/Request;
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createReqestAndRun(JUnitCoreWrapper.java:128)
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:111)
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:84)
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:138)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
I am using junit 4.8.2 and
maven-failsafe-plugin:2.14.1
There could be many configuration / environmental differences when running maven from Eclipse vs command line:
The maven version / path. In Eclipse the actual maven binary can be default / explicitly set via preferences, whereas in command line your OS will pick the first one available on your PATH env var. Check maven version using mvn -version
Maven user / global settings.xml. When running through command line typically ~/.m2/settings.xml is used but this can be explicitly overridden on Eclipse preferences
Maven local repository cache. If you have discrepancy on 1 and/or 2, you could end up with different local repository cache. Incorrect artifact distribution could cause build to fail if performed against different local repository cache.
Eclipse maven could use different version of JVM than your command line.
i have changed the version of maven-failsafe-plugin to 2.6 and it is running fine thru command line now :)

Resources