Error while running through command line in springs - spring

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 :)

Related

creating custom processors apache nifi

I was creating a custom processor in apache NIFI and in order to do it, I needed to run the cmd: mvn clean install but I have an error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:59 min
[INFO] Finished at: 2020-02-21T11:50:51+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
8.1:testCompile (groovy-tests) on project nifi-pros-test: Execution groovy-tests
of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile failed
: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its depe
ndencies could not be resolved: Could not transfer artifact org.codehaus.groovy:
groovy-eclipse-batch:jar:2.5.4-01 from/to bintray (https://dl.bintray.com/groovy
/maven): Transfer failed for https://dl.bintray.com/groovy/maven/org/codehaus/gr
oovy/groovy-eclipse-batch/2.5.4-01/groovy-eclipse-batch-2.5.4-01.jar: Connect to
d29vzk4ow07wi7.cloudfront.net:443 [d29vzk4ow07wi7.cloudfront.net/13.225.218.65,
d29vzk4ow07wi7.cloudfront.net/13.225.218.163, d29vzk4ow07wi7.cloudfront.net/13.
225.218.41, d29vzk4ow07wi7.cloudfront.net/13.225.218.66] failed: Read timed out
-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException
any help?? I'm a beginner and I googled it but no solution
Actually all it takes that instead of passing the command: mvn install enter the command: mvn install -DskipTests ! that's all it take !! because those errors are generated by testing ! so skip the test and all worked super greatly

Maven run issue in spring tool suite for spring boot application

I am getting the below error on executing springboot:run in Spring tool suite for a spring boot application.
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.020 s
[INFO] Final Memory: 27M/262M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) on project documentupload-svc: Could not exec java: Application finished with exit code: 1 -> [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
Please suggest how to resolve the issue in Spring tool suite.
Assuming you're on a windows machine:
1) set JAVA_HOME environment variable to the folder where your java is.
2) set M2_HOME environment variable to the folder where maven is.
3) add %JAVA_HOME%/bin:%M2_HOME%/bin to the start of your PATH environment variable.
4) make sure your STS has a JDK set.

Sakai 10 Building Error

I'm trying to install Sakai 10.2 and it gives me an error every time. I've reinstall everything, including de OS. And the error persist.
This is my current configuration:
Sakai 10.2
Maven 3.2.5
Tomcat 7.0.59
This the error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------ ------
[INFO] Total time: 02:00 min
[INFO] Finished at: 2015-03-17T17:56:31+01:00
[INFO] Final Memory: 347M/829M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project entitybroker-restimpl: There are test failures.
[ERROR]
[ERROR] Please refer to C:\opt\sakai-10.x\entitybroker\rest\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 :entitybroker-restimpl
These are de reports of the test.
EntityDescriptionManagerTest
EntityHandlerImplTest
[EntityBrokerServlet]http://pastebin.com/vWmbNXxa
There appears to be an error in the tests.
Build Sakai with -Dmaven.test.skip.
Could you also file a Jira at http://jira.sakaiproject.org with the test errors and someone can take a look.
Ok. Problem solved. I don't know how and I don't know the cause of the problem.
I've update JDK to _076 version and skip the test. It have no sense for me.
But it's done.
Thank you for your time and your help.

mvn clean install errors with "Negative seek offset"

mvn clean install causes build error
here is the error what I am getting..
... 24 more
{[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.707s
[INFO] Finished at: Thu Jun 12 14:09:51 IST 2014
[INFO] Final Memory: 9M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency- plugin:2.1:unpack-dependencies (get-test-data) on project neo4j-spatial: Error unpacking file: /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar to: /home/dev237/Projects /spatial/target
[ERROR] org.codehaus.plexus.archiver.ArchiverException: Error while expanding /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/20100819/osm-test-data-20100819.jar: Negative seek offset
[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/
Try renaming the repository folder "/home/dev237/.m2/repository" to make maven create a new repository and download all dependencies again.
I ran into a similar issue. This is what I did to resolve it:
cd into /home/dev237/.m2/repository/org/neo4j/spatial/osm-test-data/
rm -rf 20100819 (remove the problematic dependencies)
Re-run mvn clean install
At which point it built successfully.
This solution is arguably better than TekTimmy's as it avoids re-downloading all dependencies, regardless of if they're problematic or not. If they're all causing issues however, it may be easier to go with their solution.

How to Resolve Maven CDK Plugin Dependency Error when Following Cloudera Demo

I'm trying to following along with the Cloudera CDK-examples Demo (https://github.com/cloudera/cdk-examples/tree/master/demo); this is part of a conference (Big Data Techon 2013) session by Cloudera on Hadoop App development
However, I am unable to get mvn install to build successfully. I keep getting warnings like this
[WARNING] The POM for com.cloudera.cdk:cdk-maven-plugin:jar:0.8.1-SNAPSHOT is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for com.cloudera.cdk:cdk-maven-plugin:0.8.1-SNAPSHOT: Plugin com.cloudera.cdk:cdk-maven-plugin:0.8.1-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.cloudera.cdk:cdk-maven-plugin:jar:0.8.1-SNAPSHOT
and then it fails with these errors... I tried to troubleshoot on my own using Google and the link mentioned in the error, but it was to no avail
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.263s
[INFO] Finished at: Tue Oct 15 15:21:23 PDT 2013
[INFO] Final Memory: 6M/57M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'cdk' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/cloudera/.m2/repository), cdh.repo (https://repository.cloudera.com/artifactory/cloudera-repos), central (http://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException
Looking at the pom.xml here, I see that the snapshots is disabled for both repository and pluginRepository.
You could try to enable it and try building.

Resources