Maven test run in Eclipse does not work . Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test - eclipse

A test in Eclipse / JUnit with a Maven project run as "Maven test" using Surefire PlugIn does not work. See error code below.
I did not find any solution but one saying using Oracle jdk it works but openjdk is a must have in this case.
Any idea what´s wrong?
Running versions:
MAVEN:
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) Maven
home: C:\Program Files\Java\apache-maven-3.8.1\bin.. Java version:
15.0.2, vendor: Oracle Corporation, runtime: C:\path_to_folders\software\Eclipse\eclipse\plugins\org.eclipse.justj.openjdk.
hotspot.jre.full.win32.x86_64_15.0.2.v20210201-0955\jre Default
locale: de_DE, platform encoding: Cp1252 OS name: "windows 10",
version: "10.0", arch: "amd64", family: "windows"
JAVA:
openjdk version "1.8.0_41"
OpenJDK Runtime Environment (build 1.8.0_41-b04)
OpenJDK Client VM (build 25.40-b25, mixed mode)
SUREFIRE:
maven-surefire-plugin 3.0.0-M5
ECLIPSE IDE:
Version: 2021-03 (4.19.0)
Build id: 20210312-0638
Error Code:
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< de.condingsolo:SeleniumMavenProjekt1 >----------------
[INFO] Building SeleniumMavenProjekt1 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # SeleniumMavenProjekt1 ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # SeleniumMavenProjekt1 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # SeleniumMavenProjekt1 ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # SeleniumMavenProjekt1 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) # SeleniumMavenProjekt1 ---
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/3.0.0-M5/maven-surefire-common-3.0.0-M5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.798 s
[INFO] Finished at: 2021-04-30T17:07:09+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project SeleniumMavenProjekt1: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0-M5 -> org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M5: Failed to read artifact descriptor for org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M5: Could not transfer artifact org.apache.maven.surefire:maven-surefire-common:pom:3.0.0-M5 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/3.0.0-M5/maven-surefire-common-3.0.0-M5.pom: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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/PluginResolutionException
I think it is all about this part:
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project SeleniumMavenProjekt1: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0-M5 -> org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M5: Failed to read artifact descriptor for org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M5: Could not transfer artifact org.apache.maven.surefire:maven-surefire-common:pom:3.0.0-M5 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/3.0.0-M5/maven-surefire-common-3.0.0-M5.pom: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 1]
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.condingsolo</groupId>
<artifactId>SeleniumMavenProjekt1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId> org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
<version>0.8.1</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Java Build Path in Screenshot.
enter image description here
Java Build Path Libraries Screenshot:
enter image description here

Thanx for answering but I do not see how it helps me or what to with it.
UPDATE:
After "mvn test" command in Eclipse terminal:
pom.xml WITHOUT surefire goal configuration,
regarding this usage page
(https://maven.apache.org/surefire/maven-surefire-plugin/usage.html),
the actual error message of a test run with Maven is:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.069 s
[INFO] Finished at: 2021-05-03T17:06:42+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\user.name). Please verify you in
voked Maven from the correct directory. -> [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/MissingProjectException
pom.xml WITH surefire goal configuration,
regarding this page about goal (https://maven.apache.org/surefire/maven-surefire-plugin/plugin-info.html#),
the actual error message of a test run with Maven is:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.079 s
[INFO] Finished at: 2021-05-03T17:12:07+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\user.name). Please verify you in
voked Maven from the correct directory. -> [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/MissingProjectException
If I run the tests via context menue right click on project folder choosing "Run As" -> "Maven test" and
WITHOUT goal seettings in pom.xml,
the error looks like this:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project SeleniumMavenProjekt1: There are test failures.
[ERROR]
[ERROR] Please refer to C:\path_to_folder\Eclipse\eclipse_workspace\SeleniumMavenProjekt1\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:497)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[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/MojoExecutionException
If I run the tests via context menue right click on project folder choosing "Run As" -> "Maven test" and
WITH goal seettings in pom.xml,
the error looks like this:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project SeleniumMavenProjekt1: There are test failures.
[ERROR]
[ERROR] Please refer to C:\path_to_folder\Eclipse\eclipse_workspace\SeleniumMavenProjekt1\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:497)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[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/MojoExecutionException
No differences.
Still no idea what it is.

See this Error - trustAnchors parameter must be non-empty
Your original problem InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty was related to SSL and keystore password. Freely it could be related to your settings.xml or SSL certificates because your local repo already contains the most of required artifacts but new artifacts could not be downloaded.

Related

Maven build issue with codehaus package

I am trying to build the ear using Maven and received the following error.
[INFO] SASC .............................................. SUCCESS [10.134s]
[INFO] SASC-war .......................................... SUCCESS [41.967s]
[INFO] SASC-ear .......................................... FAILURE [2.764s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 55.162s
[INFO] Finished at: Tue Dec 15 10:52:50 CST 2015
[INFO] Final Memory: 9M/93M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.6:generate-application-xml (default-generate-application-xml) on project SASC-ear: Execution default-generate-application-xml of goal org.apache.maven.plugins:maven-ear-plugin:2.6:generate-application-xml failed: A required class was missing while executing org.apache.maven.plugins:maven-ear-plugin:2.6:generate-application-xml: org/codehaus/plexus/util/xml/XmlStreamWriter
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-ear-plugin:2.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/xxx/.m2/repository/org/apache/maven/plugins/maven-ear-plugin/2.6/maven-ear-plugin-2.6.jar
[ERROR] urls[1] = file:/C:/Users/xxx/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.xml.XmlStreamWriter
[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/PluginContainerException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :SASC-ear
Can anyone help me to fix this? I have tried to delete the .m2/repository folder and that is not helpful to solve the issue.

Adding #RunWith for jbehave-junit-runner breaks JBehave build using Maven

I'm using JBehave with my Maven build which I also develop in Eclipse and sometimes run the my unit tests with the JUnit runner in Eclipse. I found jbehave-junit-runner works well for beautifying the JBehave stories in the JUnit runner. However, adding jbehave-junit-runner seems to have broken my Maven build.
Result of mvn clean install after installing https://github.com/codecentric/jbehave-junit-runner:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[28,23] error: package org.junit.runner does not exist
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[42,1] error: cannot find symbol
[ERROR] symbol: class RunWith
/Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[28,23] error: package org.junit.runner does not exist
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[42,1] error: cannot find symbol
[ERROR] symbol: class RunWith
/Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[50,28] error: cannot access Runner
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.043 s
[INFO] Finished at: 2014-12-23T15:38:39-08:00
[INFO] Final Memory: 14M/156M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project followerdownloader-frontend: Compilation failure: Compilation failure:
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[28,23] error: package org.junit.runner does not exist
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[42,1] error: cannot find symbol
[ERROR] symbol: class RunWith
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[28,23] error: package org.junit.runner does not exist
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[42,1] error: cannot find symbol
[ERROR] symbol: class RunWith
[ERROR] /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/src/main/java/com/netbase/followerdownloader/FollowerDownloaderStories.java:[50,28] error: cannot access Runner
[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
What is it about https://github.com/codecentric/jbehave-junit-runner that broke my build?
The solution to the problem is to broaden the scope of junit by removing the test element from the junit in the pom.xml file:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<!-- <scope>test</scope> --> <!-- SOLUTION: COMMENTED OUT THIS LINE -->
</dependency>
I think I stumbled into a paradox of JBehave and Behavior Driven Design (BDD):
On the one hand, BDD is not testing (see http://jbehave.org/reference/stable/examples-philosophy.html).
On the other hand, a tool for BDD, https://github.com/codecentric/jbehave-junit-runner, depends on the #RunWith annotation that's in a test framework, specifically org.junit.runner.RunWith.
I worry that my solution may have consequences for my production code if I'm no longer limiting the scope of junit to the Maven standard test directory.
Nevertheless, my solution did solve the original problem.

Build Failure for JDT Core with Maven

I'm trying to build the JDT Core library with maven. I downloaded the git repository and in that folder I issued: mvn -P build-individual-bundles package
I get the error below after a few minutes. Any ideas? TIA!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5:04.943s
[INFO] Finished at: Wed Sep 24 08:36:51 PDT 2014
[INFO] Final Memory: 82M/455M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.21.0:compile (default-compile) on project org.eclipse.jdt.annotation: Compilation failure: Compilation failure:
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\NonNull.java:[14]
[ERROR] import static java.lang.annotation.ElementType.TYPE_USE;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import java.lang.annotation.ElementType.TYPE_USE cannot be resolved
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\NonNull.java:[52]
[ERROR] #Target({ TYPE_USE })
[ERROR] ^^^^^^^^
[ERROR] TYPE_USE cannot be resolved to a variable
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\Nullable.java:[14]
[ERROR] import static java.lang.annotation.ElementType.TYPE_USE;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import java.lang.annotation.ElementType.TYPE_USE cannot be resolved
[ERROR] F:\Workspace\git\eclipse-jdt-core\org.eclipse.jdt.annotation\src\org\eclipse\jdt\annotation\Nullable.java:[43]
[ERROR] #Target({ TYPE_USE })
[ERROR] ^^^^^^^^
[ERROR] TYPE_USE cannot be resolved to a variable
[ERROR] 4 problems (4 errors)
[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 :org.eclipse.jdt.annotation
Version information:
F:\Workspace\git\eclipse-jdt-core>mvn -version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
Maven home: C:\Apps\Java\apache-maven-3.1.1\bin\..
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: C:\Apps\Java\jdk1.7.0_67\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Looks like it needs to be compiled with Java 8.
java.lang.annotation.ElementType.TYPE_USE is new in Java 8.

Using scala-eclipse for spark

Could some please help me on how to use the scala-eclipse IDE for spark ?
I came across this link - http://syndeticlogic.net/?p=311. But I am unable to follow it.
I entered the command - mvn -Phadoop2 eclipse:clean eclipse:eclipse inside the spark directory after a long list of downloads it gave me some error. Please help. Thanks
Below is the error i received
Reactor Summary:
[INFO]
[INFO] Spark Project Parent POM .......................... SUCCESS [5:22.386s]
[INFO] Spark Project Core ................................ SUCCESS [17:20.807s]
[INFO] Spark Project Bagel ............................... FAILURE [2.159s]
[INFO] Spark Project GraphX .............................. SKIPPED
[INFO] Spark Project ML Library .......................... SKIPPED
[INFO] Spark Project Streaming ........................... SKIPPED
[INFO] Spark Project Tools ............................... SKIPPED
[INFO] Spark Project Catalyst ............................ SKIPPED
[INFO] Spark Project SQL ................................. SKIPPED
[INFO] Spark Project Hive ................................ SKIPPED
[INFO] Spark Project REPL ................................ SKIPPED
[INFO] Spark Project Assembly ............................ SKIPPED
[INFO] Spark Project External Twitter .................... SKIPPED
[INFO] Spark Project External Kafka ...................... SKIPPED
[INFO] Spark Project External Flume ...................... SKIPPED
[INFO] Spark Project External ZeroMQ ..................... SKIPPED
[INFO] Spark Project External MQTT ....................... SKIPPED
[INFO] Spark Project Examples ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25:15.115s
[INFO] Finished at: Wed May 07 15:27:51 GMT+05:30 2014
[INFO] Final Memory: 22M/81M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "hadoop2" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (default) on project spark-bagel_2.10: Failed to resolve dependencies for one or more projects in the reactor. Reason: Missing:
[ERROR] ----------
[ERROR] 1) org.apache.spark:spark-core_2.10:jar:1.0.0-SNAPSHOT
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.spark -DartifactId=spark-core_2.10 -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.spark -DartifactId=spark-core_2.10 -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) org.apache.spark:spark-bagel_2.10:jar:1.0.0-SNAPSHOT
[ERROR] 2) org.apache.spark:spark-core_2.10:jar:1.0.0-SNAPSHOT
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] org.apache.spark:spark-bagel_2.10:jar:1.0.0-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] maven-repo (http://repo.maven.apache.org/maven2, releases=true, snapshots=false),
[ERROR] apache-repo (https://repository.apache.org/content/repositories/releases, releases=true, snapshots=false),
[ERROR] jboss-repo (https://repository.jboss.org/nexus/content/repositories/releases, releases=true, snapshots=false),
[ERROR] mqtt-repo (https://repo.eclipse.org/content/repositories/paho-releases, releases=true, snapshots=false),
[ERROR] cloudera-repo (https://repository.cloudera.com/artifactory/cloudera-repos, releases=true, snapshots=false),
[ERROR] apache.snapshots (http://repository.apache.org/snapshots, releases=false, snapshots=true),
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :spark-bagel_2.10
This is because there is no profile called hadoop2 in the pom.xml. The closest matches are hadoop-2.2,hadoop-2.3 etc.
You can run the following
mvn -Phadoop-2.2 eclipse:clean eclipse:eclipse
or you may run 'mvn help:all-profiles' to list all the profiles and use one from it
If you want to contribute to the Apache Spark project, then
Go to spark home and run sbt/sbt eclipse
In Scala IDE, Select File | Import | Existing Projects into Workspace.
Select root directory :MY_SPARK_HOME
Select Search for Nested Projects
Select the projects that you want
Do not select "Copy projects into workspace".
If you want to use the spark libraries in an application that you are using then,
- You can create a jar using the sbt/sbt assembly command and then add that jar as a library to your application project
Also refer to the eclipse documentation here at: https://cwiki.apache.org/confluence/display/SPARK/Contributing+to+Spark#ContributingtoSpark-Eclipse

Adding maven dependencies to GWT project

I start my GWT project, and then somebody told me it's good to use maven, so i decided to try and i added maven dependencies to my project
it generated very simple pom file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven 4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>demo5</groupId>
<artifactId>demo5</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
</project>
i tried to run goals gwt:compile gwt:run, that when i run it first time downloaded lot of jars and stuck, when i run it second time it gaves me this:
[INFO] --- gwt-maven-plugin:2.4.0:compile (default-cli) # demo5 ---
[WARNING] The POM for com.google.gwt:gwt-servlet:jar:2.4.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Downloading: http://repo1.maven.org/maven2/com/google/gwt/gwt-dev/2.4.0/gwt-dev-2.4.0.jar
Downloaded: http://repo1.maven.org/maven2/com/google/gwt/gwt-dev/2.4.0/gwt-dev-2.4.0.jar (27647 KB at 61.4 KB/sec)
[WARNING] GWT plugin is configured to detect modules, but none were found.
[INFO]
[INFO] >>> gwt-maven-plugin:2.4.0:run (default-cli) # demo5 >>>
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) # demo5 ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\workspace\springsource\demo5\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # demo5 ---
455388 [main] ERROR org.sonatype.guice.bean.reflect.LoadedClass - Error injecting: org.apache.maven.plugin.CompilerMojo
java.lang.NoClassDefFoundError: org/codehaus/plexus/compiler/CompilerException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:609)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:816)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:750)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:235)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:185)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:824)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:938)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:971)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:932)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:984)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:451)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:98)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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:365)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.compiler.CompilerException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 51 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7:36.976s
[INFO] Finished at: Sun Nov 13 22:03:36 GMT 2011
[INFO] Final Memory: 7M/16M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project demo5: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile failed: Unable to load the mojo 'compile' in the plugin 'org.apache.maven.plugins:maven-compiler-plugin:2.3.2'. A required class is missing: org/codehaus/plexus/compiler/CompilerException
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:2.3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/c:/users/mad%20troll/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.jar
[ERROR] urls[1] = file:/c:/users/mad%20troll/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] urls[2] = file:/c:/users/mad%20troll/.m2/repository/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.jar
[ERROR] urls[3] = file:/c:/users/mad%20troll/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-manager-1.8.1.jar
[ERROR] urls[4] = file:/c:/users/mad%20troll/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.compiler.CompilerException
[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/PluginContainerException
If this will be helpful, i'm working under eclipse
Can anyone tell me what i made wrong and how i can fix that?
thanks in advance.
You can use the -maven tag with the webAppCreator utility that comes packaged with the GWT SDK, like this:
webAppCreator -maven -out MyGwtProject com.mycompany.myproject.MyGwtProject
It's not enough to create a project and add some dependencies. First of all you need to add the right dependencies, codehaus plugin with proper configuration and of course proper project structure with a web.xml and gwt descriptor module.
The easiest way to start gwt with maven is to generate a complete project from archetype. Look at http://mojo.codehaus.org/gwt-maven-plugin/user-guide/archetype.html.
To generate GWT project just type in your console:
mvn archetype:generate \
-DarchetypeRepository=repo1.maven.org \
-DarchetypeGroupId=demo5 \
-DarchetypeArtifactId=demo5 \
-DarchetypeVersion=2.4.0
Next you have to import generated project into your IDE and I recommend you to compile it before you will launch hosted mode with the following command:
mvn gwt:run