I'm trying to convert wsdl into java using maven and cxf-codegen-plugin but i always get the same error:
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.1.6:wsdl2java (aspsms) on project webapp: org/apache/velocity/context/Context: org.apache.velocity.context.Context -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.1.6:wsdl2java (aspsms) on project webapp: org/apache/velocity/context/Context
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: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)
Caused by: org.apache.maven.plugin.MojoExecutionException: org/apache/velocity/context/Context
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:435)
at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:260)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:512)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.NoClassDefFoundError: org/apache/velocity/context/Context
at org.apache.cxf.tools.wsdlto.core.AbstractGenerator.<init>(AbstractGenerator.java:47)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.generators.AbstractJAXWSGenerator.<init>(AbstractJAXWSGenerator.java:30)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.generators.AntGenerator.<init>(AntGenerator.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.cxf.tools.wsdlto.core.PluginLoader.getFrontEndGenerators(PluginLoader.java:278)
at org.apache.cxf.tools.wsdlto.core.PluginLoader.getFrontEndProfile(PluginLoader.java:393)
at org.apache.cxf.tools.wsdlto.WSDLToJava.loadFrontEnd(WSDLToJava.java:64)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:96)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:415)
... 24 more
Caused by: java.lang.ClassNotFoundException: org.apache.velocity.context.Context
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 38 more
[ERROR]
[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
My mvn version:
$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /Users/user/Desktop/dev/ses/apps/apache-maven-3.3.9
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"
Here is my pom file:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.1.6</version>
<executions>
<execution>
<id>aspsms</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/generated-source</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/wsdl/aspsmsx2.wsdl</wsdl>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>com.test.service.adapter.aspsms.wsclient</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
The jar files were correctly downloaded in my maven repo. Do you have an advice?
Maybe you can add explicitly the dependency to velocity in the plugin configuration
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.1.6</version>
<executions>
<execution>
<id>aspsms</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/generated-source</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/wsdl/aspsmsx2.wsdl</wsdl>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>com.test.service.adapter.aspsms.wsclient</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
</dependencies>
</plugin>
Related
Note: before someone mark this issue as duplicate please note I have already read and tried solutions suggested in following similar threads which did not work for me:
Maven:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources
and
https://issues.apache.org/jira/browse/MSHARED-223
I see following on my CLI after I execute 'mvn -X clean compile|package':
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources (copy-resources) on project empl-monthly-payslip: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources (copy-resources) on project empl-monthly-payslip: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources failed.
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: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)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution copy-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Here is the relevant part of my POM file:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.8</jdk.version>
<maven.compiler.version>3.6.1</maven.compiler.version>
<maven.assembly.version>3.0.0</maven.assembly.version>
<maven.resources.version>3.0.2</maven.resources.version>
</properties>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.version}</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<includeEmptyDirs>true</includeEmptyDirs>
<resources>
<resource>
<targetPath>${basedir}/src/main/resources</targetPath>
<filtering>false</filtering>
<includes>
<include>*</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I want to copy all resources (recursively) that are at ${basedir}/src/main/resources folder. Any help/advise greatly appreciated.
Note: I'm using Apache Maven 3.3.9. And have also tried cleaning everything under my ~/.m2/repository and compiling again.
All,
I have a Spring Boot Application which needs to be deployed to Nexus as both a library and an executable jar. Spring provides a way to have both using the following bit of code in the POM file.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.3.RELEASE</version>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
This produces the following two JARs.
(a) target/[artifact]-[version].jar
(b) target/[artifact]-[version]-exec.jar
Previous to adding the code to the POM, I am able to deploy artifact (a) to Nexus without issue. However, once I add the code, I get the following exception.
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project [artifact-id]: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
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: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: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.MojoExecutionException: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at org.apache.maven.plugin.deploy.DeployMojo.deployProject(DeployMojo.java:284)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:169)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171)
at org.apache.maven.plugin.deploy.DeployMojo.deployProject(DeployMojo.java:279)
... 23 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
... 25 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:893)
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:1)
at io.takari.aether.connector.AetherRepositoryConnector$PutTask.flush(AetherRepositoryConnector.java:743)
at io.takari.aether.connector.AetherRepositoryConnector.put(AetherRepositoryConnector.java:345)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
... 28 more
To add to the intrigue. I tried building another JAR using more standard code. When I deploy using this, it works fine.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>client</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
One more update, when I try the below, it fails with the same exception.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>fat</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
This issue was caused by request filtering limits in an IIS proxy.
By default, the maximum allowed content length was 30 MB. This was blocking my post of a ~90 MB jar file. Increasing the limit to 512 MB fixed the problem.
When I try to run maven "clean compile install wildfly:deploy" on jenkins for my application, it works fine sometimes and returns a success but sometimes it fails with the below error. The application code did not change but the behavior of the build keeps changing. I did try to restart the wildfly server manually on Amazon Linux ec2 instance to see that it sometimes helps. The same mvn works fine locally when testing the app and deploying on local windows workstation.
NOTE: My Jenkins and Wildfly app server are on the same Amazon Linux EC2 instance. So on the build script, I referred it as localhost.
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha7:deploy (default-cli) on project MedDRA-DataProcessing: Error executing FORCE_DEPLOY: java.util.concurrent.CancellationException: Operation was cancelled -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha7:deploy (default-cli) on project MedDRA-DataProcessing: Error executing FORCE_DEPLOY
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: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:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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.wildfly.plugin.common.DeploymentExecutionException: Error executing FORCE_DEPLOY
at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:161)
at org.wildfly.plugin.deployment.AbstractDeployment.executeDeployment(AbstractDeployment.java:147)
at org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:179)
at org.wildfly.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70)
at org.wildfly.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:137)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: java.io.IOException: java.util.concurrent.CancellationException: Operation was cancelled
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:149)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:80)
at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:153)
... 26 more
Caused by: java.util.concurrent.CancellationException: Operation was cancelled
at org.jboss.threads.AsyncFutureTask.operationCancelled(AsyncFutureTask.java:70)
at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:267)
at org.jboss.as.controller.client.impl.AbstractDelegatingAsyncFuture.get(AbstractDelegatingAsyncFuture.java:57)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:147)
... 28 more
[ERROR]
[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
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
pom.xml has:
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<!-- Deployment on AS from console -->
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.maven.wildfly}</version>
<configuration>
<hostname>localhost</hostname>
<port>9990</port>
<username>user1</username>
<password>password1</password>
</configuration>
</plugin>
</plugins>
</build>
Have you tried to use other plugin versions then alpha for your plugins? I recommend final versions as it often happes that there can be inconsistencies in alphabuilds
I get the following error when I run mvn integration-test -e com.example.mymodule:
[ERROR] Failed to execute goal org.jbehave:jbehave-maven-plugin:3.9.5:run-stories-as-embeddables (embeddable-stories) on project com.example.mymodule: Failed to run stories as embeddables: Failure in running embeddable: com.example.mymodule.TheStories: Could not initialize class freemarker.ext.beans.BeansWrapper -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jbehave:jbehave-maven-plugin:3.9.5:run-stories-as-embeddables (embeddable-stories) on project com.example.mymodule: Failed to run stories as embeddables
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: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: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: Failed to run stories as embeddables
at org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:20)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.jbehave.core.embedder.Embedder$RunningEmbeddablesFailed: Failure in running embeddable: com.example.mymodule.TheStories
at org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:130)
at org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:18)
... 21 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class freemarker.ext.beans.BeansWrapper
at freemarker.template.ObjectWrapper.<clinit>(ObjectWrapper.java:69)
at freemarker.core.Configurable.<init>(Configurable.java:139)
at freemarker.template.Configuration.<init>(Configuration.java:142)
at freemarker.template.Configuration.<clinit>(Configuration.java:127)
at org.jbehave.core.reporters.FreemarkerProcessor.configuration(FreemarkerProcessor.java:30)
at org.jbehave.core.reporters.FreemarkerProcessor.process(FreemarkerProcessor.java:21)
at org.jbehave.core.reporters.TemplateableViewGenerator.write(TemplateableViewGenerator.java:267)
at org.jbehave.core.reporters.TemplateableViewGenerator.createReports(TemplateableViewGenerator.java:219)
at org.jbehave.core.reporters.TemplateableViewGenerator.generateReportsView(TemplateableViewGenerator.java:110)
at org.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:249)
at org.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:237)
at org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:213)
at org.jbehave.core.junit.JUnitStories.run(JUnitStories.java:20)
at org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:121)
... 22 more
When I run mvn dependency:tree -pl com.example.mymodule | grep freemarker I get
[INFO] | +- org.freemarker:freemarker:jar:2.3.19:compile
I used javap to confirm that the class freemarker.ext.beans.BeansWrapper exists in this jar:
javap -classpath C:\Users\CONOR2\.m2\repository\org\freemarker\freemarker\2.3.19\freemarker-2.3.19.jar freemarker.ext.beans.BeansWrapper
Here's the relevant portion of my depdendencies from my pom.xml:
<dependency>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-core</artifactId>
<version>3.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-core</artifactId>
<version>3.9.5</version>
<classifier>resources</classifier>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.jbehave.site</groupId>
<artifactId>jbehave-site-resources</artifactId>
<version>3.2</version>
<type>zip</type>
</dependency>
Here's my plugin section:
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<version>3.9.5</version>
<executions>
<execution>
<id>unpack-view-resources</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-view-resources</goal>
</goals>
</execution>
<execution>
<id>embeddable-stories</id>
<phase>integration-test</phase>
<configuration>
<includes>
<include>com/example/mymodule/TheStories.java</include>
</includes>
<excludes />
<ignoreFailureInStories>true</ignoreFailureInStories>
<ignoreFailureInView>false</ignoreFailureInView>
<scope>test</scope>
<threads>1</threads>
<metaFilters>
<metaFilter></metaFilter>
</metaFilters>
</configuration>
<goals>
<goal>run-stories-as-embeddables</goal>
</goals>
</execution>
</executions>
</plugin>
I tried this with versions 3.9.5 and 4.0.3, but I get the same error with both versions.
It turns out that the jbehave-maven-plugin was having trouble with log4j. Adding log4j:log4j and org.slf4j:slf4j-log4j as dependencies for the plugin fixed the issue.
I'm trying to build a fat jar with dependencies using maven-assembly-plugin (2.4), JDK 1.8u11, Maven 3.1.1.
I have the plugin configured as following:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
This gives me the following error when running
mvn clean install assembly:single -e
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (default-cli) on project banking-embedded-injector: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single failed: MALFORMED -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (default-cli) on project banking-embedded-injector: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single failed: MALFORMED
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single failed: MALFORMED
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.IllegalArgumentException: MALFORMED
at java.util.zip.ZipCoder.toString(ZipCoder.java:58)
at java.util.zip.ZipFile.getZipEntry(ZipFile.java:531)
at java.util.zip.ZipFile.access$900(ZipFile.java:56)
at java.util.zip.ZipFile$1.nextElement(ZipFile.java:513)
at java.util.zip.ZipFile$1.nextElement(ZipFile.java:483)
at org.codehaus.plexus.components.io.resources.PlexusIoZipFileResourceCollection$1.next(PlexusIoZipFileResourceCollection.java:62)
at org.codehaus.plexus.components.io.resources.PlexusIoZipFileResourceCollection$1.next(PlexusIoZipFileResourceCollection.java:55)
at org.codehaus.plexus.components.io.resources.AbstractPlexusIoArchiveResourceCollection.getResources(AbstractPlexusIoArchiveResourceCollection.java:78)
at org.codehaus.plexus.components.io.resources.proxy.PlexusIoProxyResourceCollection.getResources(PlexusIoProxyResourceCollection.java:89)
at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:468)
at org.apache.maven.plugin.assembly.filter.ComponentsXmlArchiverFileFilter.finalizeArchiveCreation(ComponentsXmlArchiverFileFilter.java:166)
at org.codehaus.plexus.archiver.AbstractArchiver.runArchiveFinalizers(AbstractArchiver.java:884)
at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:908)
at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive(AssemblyProxyArchiver.java:512)
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:186)
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:436)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
... 20 more
If appendAssemblyId is set to true, it works fine, but the resulting jar has the "jar-with-dependencies" suffix, which I don't want.
Any ideas?