How to create installer to the network folder using IzPack - java

I'm using IzPack plugin to generate the installer of a project done in java.
I use continuous integration with Jenkins.
My scenario is as follows:
On my computer I can usually generate a build using the maven but when committing and make jenkins run to build the installer tries to create the directory in which I add, the same happens the following error below:
[ERROR] Failed to execute goal org.codehaus.izpack:izpack-maven-plugin:1.0-alpha-5:izpack (standard-installer) on project ManagerNeverStop: Could not create directory \\192.168.2.6\deploy\produto\testes -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.izpack:izpack-maven-plugin:1.0-alpha-5:izpack (standard-installer) on project ManagerNeverStop: Could not create directory \\192.168.2.6\deploy\produto\testes
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.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
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.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.maven.plugin.MojoFailureException: Could not create directory \\192.168.2.5\deploy\Manager_NeverStop\testes
at org.izpack.mojo.IzPackMojo.init(IzPackMojo.java:181)
at org.izpack.mojo.IzPackMojo.execute(IzPackMojo.java:160)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
My pom.xml:
<plugin>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-maven-plugin</artifactId>
<version>1.0-alpha-5</version>
<dependencies>
<dependency>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-standalone-compiler</artifactId>
<version>4.3.1</version>
</dependency>
</dependencies>
<configuration>
<izpackBasedir>${staging.dir}</izpackBasedir>
<customPanelDirectory>${staging.dir}</customPanelDirectory>
<installerFile>\\192.168.2.6\teste\/${project.artifactId}-${project.version}.${prefix.revision}-install</installerFile>
</configuration>
<executions>
<execution>
<id>standard-installer</id>
<phase>package</phase>
<goals>
<goal>izpack</goal>
</goals>
</execution>
</executions>
</plugin>
My problem is how to generate an installer on a mapped network directory using IzPack and Jenkins.
I've looked at the permissions and the same are with full permission.

Related

Enforcer rules are getting failed using maven plugin

I have pom.xml with below plugin containing enforcement rule.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<configuration>
<rules>
<banVersionDeps implementation="com.atlassian.maven.enforcer.BanVersionDeps">
<bannedDependencyVersionRegexp>(?i)^.*-(rc|m)-?[0-9]+(-.+)?$</bannedDependencyVersionRegexp>
<noFailReactorVersionRegexp>(?i)^.*-m-?[0-9]+(-.+)?$</noFailReactorVersionRegexp>
<excludes>
<!-- Version being used is an RC with no newer GA release -->
<exclude>com.atlassian.crowd:*</exclude>
<exclude>net.fortuna.ical4j:ical4j</exclude>
<!-- Version being used is a milestone with no newer GA release -->
<exclude>com.atlassian.extension:*</exclude>
<exclude>com.atlassian.jira.plugins.inline-create:*</exclude>
</excludes>
</banVersionDeps>
</rules>
</configuration>
</plugin>
When I start build using this pom.xml I am facing below error.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-versions) on project atlassian-jira-pageobjects: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-versions) on project atlassian-jira-pageobjects: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:237)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
I am using apache-maven-3.2.5 and Java 8.
Can someone guide me what is wrong in this configuration.
I was getting error for atlassian-browsers-windows I excluded that package and its working fine.
<excludes>
<exclude>com.atlassian.browsers:atlassian-browsers-windows:*</exclude>
</excludes>

Launch4j redirect to download java version

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>

Google errorprone java compiler - Bugs during maven build: java.lang.NoSuchFieldError: pid

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

BDD jbehave integration with maven

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.

jaxb2-maven-plugin is giving me a SAXParseException when trying to generate META-INF\sun-jaxb.episode file

Im getting the following error when trying to generate the episode file using xjc2-maven-plugin. This error seems to be with META-INF folder creation.
Any idea on how to solve this. I have been stuck of this for quite some time.
the command line equivalent xjc command seems to work with the same inputs.
[INFO] parsing a schema...
[INFO] compiling a schema...
[ERROR] null[-1,-1]
org.xml.sax.SAXParseException; Failed to write to src\main\generated\META-INF\sun-jaxb.episode
at com.sun.tools.xjc.addon.episode.PluginImpl.run(PluginImpl.java:209)
at com.sun.tools.xjc.model.Model.generateCode(Model.java:294)
at com.sun.tools.xjc.Driver.run(Driver.java:363)
at org.codehaus.mojo.jaxb2.AbstractXjcMojo.execute(AbstractXjcMojo.java:316)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
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:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder
java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
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:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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:601)
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: java.io.FileNotFoundException: src\main\generated\META-INF\sun-jaxb.episode (The system cannot find the path
specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at com.sun.tools.xjc.addon.episode.PluginImpl.run(PluginImpl.java:170)
... 24 more
The snippet of pom.xml
<properties>
<jaxb.mojo.version>1.6</jaxb.mojo.version>
</properties>
.
.
.
<plugin>
<!-- xjc -p com.test.framework.contracts ./main/xsd/Framework.xsd -d ./main/generated -episode ./main/generated/META-INF/sun-jaxb.episode -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>${jaxb.mojo.version}</version>
<executions>
<execution>
<id>xjc-framework</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<schemaFiles>Framework.xsd</schemaFiles>
<arguments>-episode src/main/generated/META-INF/sun-jaxb.episode</arguments>
<outputDirectory>src/main/generated</outputDirectory>
<packageName>com.test.framework.contracts</packageName>
</configuration>
</execution>
</executions>
</plugin>
However changing the line episode argument
<arguments>-episode src/main/generated/sun-jaxb.episode</arguments>
makes the compilation pass.
Please help, i need the episode file to be generated by META-INF.

Categories