I used Launch4j plugin in my Java project with Maven. When I compile project to exe and run on Windows system where there is no Java installed, it redirects (automatically open web browser) to download Java but with 32-bit version. I want to redirect to download 64-bit newest version. Is it possible?
My plugin definition in Maven looks like
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.11</version>
<executions>
<execution>
<id>l4j-gui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>target/Project.exe</outfile>
<jar>target/Project.jar</jar>
<priority>high</priority>
<errTitle>project</errTitle>
<classPath>
<mainClass>com.project.Main</mainClass>
<preCp>libs/*.jar</preCp>
</classPath>
<jre>
<minVersion>1.8.0_101</minVersion>
</jre>
<icon>${basedir}/build-resources/win/application-${ENV}.ico</icon>
</configuration>
</execution>
</executions>
</plugin>
I tried to add in <jar>...</jar> the <runtimeBits>64</runtimeBits> and when run exe file pop up shows "The application requries a Java Runtime Environment 1.8.0_101 (64-bit)" and after click OK, it redirect to download 32-bit version, with page address https://java.com/pl/download/
EDIT
I tried also add in <jar>...</jar> the <bundledJre64Bit>true</bundledJre64Bit> but can not end compilation and return error as below
[INFO] --- launch4j-maven-plugin:1.7.11:launch4j (l4j-gui) # stockbox-main ---
[INFO] Platform-specific work directory already exists: /Users/Arek/.m2/repository/net/sf/launch4j/launch4j/3.9
[ERROR]
net.sf.launch4j.BuilderException: !Jre.bundled.64bit.invalid!
at net.sf.launch4j.Builder.build(Builder.java:76)
at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute(Launch4jMojo.java:358)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
SOLUTION
Before <jre>...</jre> just add <downloadUrl>https://java.com/en/download/manual.jsp</downloadUrl> and that's it.
Redirect us to page when user can choose the java version according to system and which version must download by adding a <runtimeBits>64</runtimeBits> in <jre>... brackets.
The details are provided here - See if it can help
http://launch4j.sourceforge.net/docs.html
<bundledJre64Bit>true|false</bundledJre64Bit>
<bundledJreAsFallback>true|false</bundledJreAsFallback>
<runtimeBits>64|64/32|32/64|32</runtimeBits>
When I try to run the command mvn archetype:create-from-project for my WAR project, this exception is showed after the reading of a .java file:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:create-from-project (default-cli) on project ConfiguradorWAR: charsetName -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:create-from-project (default-cli) on project ConfiguradorWAR: charset
Name
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: charsetName
at org.apache.maven.archetype.mojos.CreateArchetypeFromProjectMojo.execute(CreateArchetypeFromProjectMojo.java:285)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
The default project encode is Cp1252, I already tried UTF-8 and ISO-8859-1, also edited the encode option from the project and eclipse preferences. On pom.xml:
<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
<project.resources.sourceEncoding>${project.build.sourceEncoding}</project.resources.sourceEncoding>
</properties>
and
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.2</version>
<configuration>
<defaultEncoding>${project.build.sourceEncoding}</defaultEncoding>
<encoding>${project.build.sourceEncoding}</encoding>
<archetypeArtifactId>archetype-wsjpa</archetypeArtifactId>
<archetypeGroupId>br.com.example</archetypeGroupId>
<archetypeVersion>1.0</archetypeVersion> <archetypeFilteredExtentions>java,xml</archetypeFilteredExtentions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
The best advice I got from my co-workers was try to replace all the characters with accent in the whole project. I have an EJB project with Cp1252 encode as default that worked on the first try.
Thank you in advance and sorry for my bad english.
After exhaustively exercite every param possible for the command line I found out the right one.
You should create your archetype like this:
mvn archetype:create-from-project -Darchetype.encoding=ISO-8859-1
As you can see on Maven Archetype Plugin Docs you should use the "User property archetype.encoding".
Any other parameter name will fail.
It worked for me!
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
<project.resources.sourceEncoding>${project.build.sourceEncoding}</project.resources.sourceEncoding>
I needed to add the above. Also I ran mvn clean before running mvn archetype:create-from-project
I have added the following to the pom file:
<!-- Source: http://errorprone.info/docs/installation -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<!-- maven-compiler-plugin defaults to targeting Java 5, but our javac
only supports >=6 -->
<source>8</source>
<target>8</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.5</version>
</dependency>
<!-- override plexus-compiler-javac-errorprone's dependency on
Error Prone with the latest version -->
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.0.4</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Which during maven clean install leads to:
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.NoSuchFieldError: pid
at lombok.javac.JavacAST.packageDeclaration(JavacAST.java:107)
at lombok.javac.JavacAST.<init>(JavacAST.java:81)
at lombok.javac.JavacTransformer.transform(JavacTransformer.java:67)
at lombok.javac.apt.Processor.process(Processor.java:250)
at lombok.core.AnnotationProcessor$JavacDescriptor.process(AnnotationProcessor.java:115)
at lombok.core.AnnotationProcessor.process(AnnotationProcessor.java:165)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:801)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:713)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2000(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1021)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1129)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1141)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:833)
at com.sun.tools.javac.main.Main.compile(Main.java:249)
at com.google.errorprone.ErrorProneCompiler.run(ErrorProneCompiler.java:220)
at com.google.errorprone.ErrorProneCompiler.run(ErrorProneCompiler.java:158)
at com.google.errorprone.ErrorProneCompiler.compile(ErrorProneCompiler.java:87)
at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne$CompilerInvoker.compile(JavacCompilerWithErrorProne.java:219)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne.performCompile(JavacCompilerWithErrorProne.java:91)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:825)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] ------------------------------------------------------------------------
...
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
(default-compile) on project Core: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
(default-compile) on project Core: Compilation failure at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:582) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:158) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497) at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by:
org.apache.maven.plugin.compiler.CompilationFailureException:
Compilation failure at
org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:915)
at
org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more [ERROR]
Hmm.. I notice just now that it is comlaining with regards to a lombok related AST stuff.
Does errorprone and lombok not work well together?
What can I do to resolve this issue?
They indeed do not work well together, because of compiler.
Error-prone dev comments (Jun, 26, 2015):
We made the decision to pin Error Prone to a specific version of javac because Error Prone relies on compiler internals, and supporting multiple versions of javac was difficult and hard to validate, because we use only one version of javac internally.
Lombok dev comment (Oct, 12, 2015):
I'm afraid Java 9 support is not going to be fixed in a few days.
It looks like all releases of errorprone starting with 2.0 do use javac9, thus making it not possible to workaround, although you may try previous versions of errorprone.
I had the same problem, solved it by using Java 8 to compile (turned out that my JAVA_HOME was pointing to a Java 9 version).
Hi i've got the following jbehave plugin configuration in parent pom.xml
${jbehave.version} = 3.9.4
<!--Jbehave-->
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<version>${jbehave.version}</version>
<configuration>
<scope>test</scope>
<includes>
<include>**/HotelStories.java</include>
</includes>
</configuration>
<executions>
<execution>
<id>run-stories-with-annotated-embedder</id>
<phase>test</phase>
<goals>
<goal>run-stories-with-annotated-embedder</goal>
</goals>
</execution>
</executions>
</plugin>
Unfortunately plugin cannot load the class HotelStories.java. It fails with the following exception
[ERROR] Failed to execute goal org.jbehave:jbehave-maven-plugin:3.9.4:run-stories-with-annotated-embedder (default-cli) on project com.alg.ce.services.jbehave: Failed to run stories with annotated embedder runner: Failed to load class com.alg.services.jbehave.stories.HotelStories with classLoader EmbedderClassLoader[urls=[/C:/Users/gsamsonov/av_services/serviceslayer/jbehave/target/test-classes, /C:/Users/gsamsonov/av_services/serviceslayer/jbehave/target/classes, hamcrest-library-1.2.1.jar, hamcrest-core-1.2.1.jar, jbehave-core-3.9.4.jar, junit-4.11.jar, hamcrest-integration-1.3.jar, commons-collections-3.2.1.jar, commons-io-2.4.jar, commons-lang-2.3.jar, plexus-utils-3.0.10.jar, freemarker-2.3.19.jar, paranamer-2.4.jar, xstream-1.4.5.jar, xmlpull-1.1.3.1.jar, xpp3_min-1.1.4c.jar, jbehave-maven-plugin-3.9.4.jar, maven-plugin-api-2.0.11.jar, maven-artifact-2.0.11.jar, maven-project-2.0.11.jar, maven-settings-2.0.11.jar, maven-profile-2.0.11.jar, maven-model-2.0.11.jar, maven-artifact-manager-2.0.11.jar, maven-repository-metadata-2.0.11.jar, wagon-provider-api-1.0-beta-2.jar, maven-plugin-registry-2.0.11.jar, plexus-interpolation-1.1.jar, plexus-container-default-1.0-alpha-9-stable-1.jar, classworlds-1.1-alpha-2.jar, plexus-archiver-1.2.jar, plexus-io-1.0.1.jar, jbehave-spring-3.9.4.jar, spring-context-4.0.5.RELEASE.jar, spring-aop-4.0.5.RELEASE.jar, aopalliance-1.0.jar, spring-beans-4.0.5.RELEASE.jar, spring-expression-4.0.5.RELEASE.jar, spring-test-4.0.5.RELEASE.jar, spring-core-4.0.5.RELEASE.jar, com.alg.ce.services.common-0.0.1-SNAPSHOT.jar, validation-api-1.1.0.Final.jar, spring-jdbc-4.0.5.RELEASE.jar, spring-tx-4.0.5.RELEASE.jar, spring-ws-core-2.2.0.RELEASE.jar, spring-xml-2.2.0.RELEASE.jar, spring-oxm-4.0.5.RELEASE.jar, spring-webmvc-4.0.5.RELEASE.jar, httpclient-4.3.3.jar, httpcore-4.3.2.jar, commons-codec-1.9.jar, com.alg.ce.services.repository-0.0.1-SNAPSHOT.jar, couchbase-client-1.4.2.jar, netty-3.5.5.Final.jar, jettison-1.1.jar, stax-api-1.0.1.jar, spymemcached-2.11.3.jar, httpcore-nio-4.3.jar, jackson-databind-2.2.1.jar, jackson-annotations-2.2.1.jar, jackson-core-2.2.1.jar, aspectjweaver-1.7.3.jar, aspectjrt-1.7.3.jar, aspectjtools-1.7.3.jar, asm-all-4.0.jar, cglib-2.2.0-b14.jar, poi-3.10-FINAL.jar, poi-ooxml-3.10-FINAL.jar, poi-ooxml-schemas-3.10-FINAL.jar, xmlbeans-2.3.0.jar, dom4j-1.6.1.jar, xml-apis-1.0.b2.jar, jackson-mapper-asl-1.9.13.jar, jackson-core-asl-1.9.13.jar, spring-web-4.0.5.RELEASE.jar, com.alg.ce.services.bl-0.0.1-SNAPSHOT.jar, joda-time-2.3.jar, logback-classic-1.1.2.jar, logback-core-1.1.2.jar, slf4j-api-1.7.6.jar, commons-logging-1.1.3.jar, db2jcc-4.9.78.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.9.4, parent: sun.misc.Launcher$AppClassLoader#1df95673]] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jbehave:jbehave-maven-plugin:3.9.4:run-stories-with-annotated-embedder (default-cli) on project com.alg.ce.services.jbehave: Failed to run stories with annotated embedder runner
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.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:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run stories with annotated embedder runner
at org.jbehave.mojo.RunStoriesWithAnnotatedEmbedderRunner.execute(RunStoriesWithAnnotatedEmbedderRunner.java:23)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 25 more
Caused by: org.jbehave.core.junit.AnnotatedEmbedderUtils$ClassLoadingFailed: Failed to load class com.alg.services.jbehave.stories.HotelStories with classLoader EmbedderClassLoader[urls=[/C:/Users/gsamsonov/av_services/serviceslayer/jbehave/target/test-classes, /C:/Users/gsamsonov/av_services/serviceslayer/jbehave/target/classes, hamcrest-library-1.2.1.jar, hamcrest-core-1.2.1.jar, jbehave-core-3.9.4.jar, junit-4.11.jar, hamcrest-integration-1.3.jar, commons-collections-3.2.1.jar, commons-io-2.4.jar, commons-lang-2.3.jar, plexus-utils-3.0.10.jar, freemarker-2.3.19.jar, paranamer-2.4.jar, xstream-1.4.5.jar, xmlpull-1.1.3.1.jar, xpp3_min-1.1.4c.jar, jbehave-maven-plugin-3.9.4.jar, maven-plugin-api-2.0.11.jar, maven-artifact-2.0.11.jar, maven-project-2.0.11.jar, maven-settings-2.0.11.jar, maven-profile-2.0.11.jar, maven-model-2.0.11.jar, maven-artifact-manager-2.0.11.jar, maven-repository-metadata-2.0.11.jar, wagon-provider-api-1.0-beta-2.jar, maven-plugin-registry-2.0.11.jar, plexus-interpolation-1.1.jar, plexus-container-default-1.0-alpha-9-stable-1.jar, classworlds-1.1-alpha-2.jar, plexus-archiver-1.2.jar, plexus-io-1.0.1.jar, jbehave-spring-3.9.4.jar, spring-context-4.0.5.RELEASE.jar, spring-aop-4.0.5.RELEASE.jar, aopalliance-1.0.jar, spring-beans-4.0.5.RELEASE.jar, spring-expression-4.0.5.RELEASE.jar, spring-test-4.0.5.RELEASE.jar, spring-core-4.0.5.RELEASE.jar, com.alg.ce.services.common-0.0.1-SNAPSHOT.jar, validation-api-1.1.0.Final.jar, spring-jdbc-4.0.5.RELEASE.jar, spring-tx-4.0.5.RELEASE.jar, spring-ws-core-2.2.0.RELEASE.jar, spring-xml-2.2.0.RELEASE.jar, spring-oxm-4.0.5.RELEASE.jar, spring-webmvc-4.0.5.RELEASE.jar, httpclient-4.3.3.jar, httpcore-4.3.2.jar, commons-codec-1.9.jar, com.alg.ce.services.repository-0.0.1-SNAPSHOT.jar, couchbase-client-1.4.2.jar, netty-3.5.5.Final.jar, jettison-1.1.jar, stax-api-1.0.1.jar, spymemcached-2.11.3.jar, httpcore-nio-4.3.jar, jackson-databind-2.2.1.jar, jackson-annotations-2.2.1.jar, jackson-core-2.2.1.jar, aspectjweaver-1.7.3.jar, aspectjrt-1.7.3.jar, aspectjtools-1.7.3.jar, asm-all-4.0.jar, cglib-2.2.0-b14.jar, poi-3.10-FINAL.jar, poi-ooxml-3.10-FINAL.jar, poi-ooxml-schemas-3.10-FINAL.jar, xmlbeans-2.3.0.jar, dom4j-1.6.1.jar, xml-apis-1.0.b2.jar, jackson-mapper-asl-1.9.13.jar, jackson-core-asl-1.9.13.jar, spring-web-4.0.5.RELEASE.jar, com.alg.ce.services.bl-0.0.1-SNAPSHOT.jar, joda-time-2.3.jar, logback-classic-1.1.2.jar, logback-core-1.1.2.jar, slf4j-api-1.7.6.jar, commons-logging-1.1.3.jar, db2jcc-4.9.78.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.9.4, parent: sun.misc.Launcher$AppClassLoader#1df95673]]
at org.jbehave.core.junit.AnnotatedEmbedderUtils.loadClass(AnnotatedEmbedderUtils.java:37)
at org.jbehave.core.junit.AnnotatedEmbedderUtils.runnerClass(AnnotatedEmbedderUtils.java:15)
at org.jbehave.core.junit.AnnotatedEmbedderUtils.annotatedEmbedderRunner(AnnotatedEmbedderUtils.java:10)
at org.jbehave.core.embedder.Embedder.runStoriesWithAnnotatedEmbedderRunner(Embedder.java:168)
at org.jbehave.mojo.RunStoriesWithAnnotatedEmbedderRunner.execute(RunStoriesWithAnnotatedEmbedderRunner.java:21)
... 27 more
Caused by: java.lang.ClassNotFoundException: com.alg.services.jbehave.stories.HotelStories
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.jbehave.core.junit.AnnotatedEmbedderUtils.loadClass(AnnotatedEmbedderUtils.java:35)
Has anybody encountered a similar issue i seem to've searched a lot on the web and been unable to find a solution.
The error boils down to:
ClassNotFoundException: com.alg.services.jbehave.stories.HotelStories
which means HotelStories.java is not on the classpath. It needs to be. So unless you have changed the default configuration, it should be under /src/main/java of the current project, or one of its dependencies.