Build Failure for JDT Core with Maven - eclipse

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.

Related

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

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.

Unable to launch Scala REPL using 'sbt console' due to InvalidPath exception

I am working on Windows 10 OS and installed sbt 1.4.5 from the .msi installer from scala-lang downloads page. Now when I type sbt or sbt about in the command prompt, it works fine but as soon as I type sbt console, I get the following error message:
C:\Users\anka2\Scala_Samples\Variables>sbt console
[warn] Neither build.sbt nor a 'project' directory in the current directory: "C:\Users\anka2\Scala_Samples\Variables"
c) continue
q) quit
?c
[warn] No sbt.version set in project/build.properties, base directory: C:\Users\anka2\Scala_Samples\Variables
[info] welcome to sbt 1.4.5 (Oracle Corporation Java 1.8.0_271)
[info] loading global plugins from C:\Users\anka2\.sbt\1.0\plugins
[info] set current project to variables (in build file:/C:/Users/anka2/Scala_Samples/Variables/)
[error] java.nio.file.InvalidPathException: Illegal char <"> at index 0: "C:\Windows\System32
[error] at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
[error] at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
[error] at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
[error] at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
[error] at java.io.File.toPath(File.java:2234)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.$anonfun$javaLibraryPaths$1(ClasspathUtilities.scala:62)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:285)
[error] at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
[error] at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
[error] at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:38)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:285)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:278)
[error] at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.javaLibraryPaths(ClasspathUtilities.scala:62)
[error] at sbt.internal.inc.classpath.ClasspathUtil$$anon$2.<init>(ClasspathUtilities.scala:50)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.toLoader(ClasspathUtilities.scala:48)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.makeLoader(ClasspathUtilities.scala:115)
[error] at sbt.internal.inc.classpath.ClasspathUtil$.makeLoader(ClasspathUtilities.scala:103)
[error] at sbt.Defaults$.$anonfun$consoleTask$1(Defaults.scala:2043)
[error] at sbt.Defaults$.$anonfun$consoleTask$1$adapted(Defaults.scala:2037)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] at sbt.Execute.work(Execute.scala:291)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (Compile / console) java.nio.file.InvalidPathException: Illegal char <"> at index 0: "C:\Windows\System32
[error] Total time: 0 s, completed Jan 17, 2021 11:25:34 AM
I tried identifying the error in format by running sbt --verbose and this is what I'm getting:-
C:\Users\anka2>sbt --verbose
# Executing command line:
"C:\Program Files\Java\jdk1.8.0_271\bin\java.exe"
-Dfile.encoding=UTF-8
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-cp
"C:\Program Files (x86)\sbt\\bin\sbt-launch.jar"
xsbt.boot.Boot
[info] welcome to sbt 1.4.5 (Oracle Corporation Java 1.8.0_271)
[info] loading global plugins from C:\Users\anka2\.sbt\1.0\plugins
[info] loading project definition from C:\Users\anka2\project
[info] set current project to anka2 (in build file:/C:/Users/anka2/)
[info] sbt server started at local:sbt-server-ff142d10856e0dc0f951
[info] started sbt server
But after this, as soon as I type console, I get the same InvalidPath exception message.
It might be elementary but I am absolutely unable to grasp where I am going wrong or how to fix this.
It fails because you are running this command from folder that is not an sbt project. As you can see in your error:
Neither build.sbt nor a 'project' directory in the current directory: "C:\Users\anka2\Scala_Samples\Variables"
Please add to the directory when you want to run it:
project\build.properties file with the content:
sbt.version = 1.4.5
build.sbt file with the content:
name := "test213"
version := "0.1"
scalaVersion := "2.13.4"
Then try to rerun this command.
The problem is SBT is missing couple of files.
Fix: Using cmd
cd to an empty folder.
C:\Users\USER\scala_sample_learning> sbt new scala/hello-world.g8
upon successful implementation of step 2 cmd will prompt you for a name give hello-world
Now you can use sbt console

Maven dependency: import cannot be resolved but is present in local repository (Eclipse Oomph Unzip Setup Task)

I have problems using Maven.
A Maven mvn clean package of the submodule "task-unzip" from the Eclipse Oomph's Unzip Setup Task repository (https://github.com/maybeec/oomph-task-unzip) fails with the following error on several machines/setups:
[INFO] --- tycho-compiler-plugin:0.22.0:compile (default-compile) # com.github.maybeec.oomph.task.unzip ---
[INFO] Compiling 13 source files to C:\FOLDER\repositories\oomph-task-unzip\task-unzip\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.983 s
[INFO] Finished at: 2020-10-28T18:35:49+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project com.github.maybeec.oomph.task.unzip: Compilation failure: Compilation failure:
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[7]
[ERROR] import org.apache.commons.compress.archivers.ArchiveEntry;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[8]
[ERROR] import org.apache.commons.compress.archivers.ArchiveInputStream;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[9]
[ERROR] import org.apache.commons.compress.archivers.ArchiveStreamFactory;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[10]
[ERROR] import org.apache.commons.compress.compressors.CompressorInputStream;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[11]
[ERROR] import org.apache.commons.compress.compressors.CompressorStreamFactory;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[12]
[ERROR] import org.apache.commons.compress.utils.IOUtils;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[47]
[ERROR] CompressorInputStream cIS = new CompressorStreamFactory().createCompressorInputStream(in);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^
[ERROR] CompressorInputStream cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[47]
[ERROR] CompressorInputStream cIS = new CompressorStreamFactory().createCompressorInputStream(in);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] CompressorStreamFactory cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[64]
[ERROR] ArchiveInputStream archiveIS = new ArchiveStreamFactory().createArchiveInputStream(fileIS);
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] ArchiveInputStream cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[64]
[ERROR] ArchiveInputStream archiveIS = new ArchiveStreamFactory().createArchiveInputStream(fileIS);
[ERROR] ^^^^^^^^^^^^^^^^^^^^
[ERROR] ArchiveStreamFactory cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[65]
[ERROR] ArchiveEntry entry;
[ERROR] ^^^^^^^^^^^^
[ERROR] ArchiveEntry cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[77]
[ERROR] IOUtils.copy(archiveIS, out);
[ERROR] ^^^^^^^
[ERROR] IOUtils cannot be resolved
[ERROR] 12 problems (12 errors)
[ERROR] -> [Help 1]
Maven is actually downloading the Apache commons-compress-1.19.jar to the local Maven repository and it is also being copied to the project's lib folder. So that is working and the dependency is actually present on the filesystem.
However, Maven can not find this dependency. Adding it manually to the project, the resolve failure can be solved, but that is not a solution to the problem it's not working with Maven.
Importing the submodule in Eclipse shows the same. Eclipse isn't able to auto-complete an "import" statement to "org.apache.commons.*":
The Properties > Build path of that submodule doesn't show any Maven dependencies (actually the "Maven Dependencies" list wasn't even there! I had to follow https://stackoverflow.com/a/27337064/5446400 and edit the .classpath file for that). However it's still empty:
Searching and working for hours on that problem I couldn't come up with an explanation why Maven behaves the way it does.
Thank you for any support!
Maven dependencies shouldn't need to be added to the build path of Eclipse plugins. The plugin dependencies are enough and in this case commons-compress-1.19.jar will be loaded as a library from within the plugin's lib directory (this is defined in the build.properties file), not directly as a Maven dependency.
I'm not sure if downloading a Maven dependency and using it in the same build will work this way. If it gets copied to the correct location, you might just need to refresh the workspace, otherwise the jar could get ignored in the Eclipse build.
For debugging the issue I would probably download the artifact and place the jar in the lib directory manually once and ditch the automated process. Then at least you see if this unusual handling of Maven dependencies is the issue or something else.

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.