Maven exec plugin main class missing - java

I'm trying to go through Hibernate tutorial and got stuck on running the command
C:\Users\Eyal\workspace\FirstHibernateTutorial>mvn exec:java -Dexec.mainclass="o
rg.hsqldb.Server" -Dexec.args="-database.O file:target/data/tutorial" -e
and get these errors.
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
org.hibernate.tutorials:hibernate-tutorial:jar:1.0.0-SNAPSHOT
[WARNING] The expression ${artifactId} is deprecated. Please use ${project.artif
actId} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building First Hibernate Tutorial 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> exec-maven-plugin:1.2:java (default-cli) # hibernate-tutorial >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2:java (default-cli) # hibernate-tutorial <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2:java (default-cli) # hibernate-tutorial ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.964s
[INFO] Finished at: Thu Apr 21 18:31:10 IDT 2011
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (def
ault-cli) on project hibernate-tutorial: The parameters 'mainClass' for goal org
.codehaus.mojo:exec-maven-plugin:1.2:java are missing or invalid -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli) on project hibernate-t
utorial: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin
:1.2:java are missing or invalid
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:221)
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.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'mai
nClass' for goal org.codehaus.mojo:exec-maven-plugin:1.2:java are missing or inv
alid
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePl
uginFields(DefaultMavenPluginManager.java:576)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfigu
redMojo(DefaultMavenPluginManager.java:529)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
... 19 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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParamete
rException
I did changed one thing in the pom file. I added the versions of the dependencies. this is the pom.xml. I changed it because without it, I'm getting errors about lack of version specification.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/
maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hibernate.tutorials</groupId>
<artifactId>hibernate-tutorial</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>First Hibernate Tutorial</name>
<build>
<!-- we dont want the version to be part of the generated war file name -->
<finalName>${artifactId}</finalName>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.1.GA</version>
</dependency>
<!-- Because this is a web app, we also have a dependency on the servlet api. -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>[2.4,)</version>
</dependency>
<!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.5.6</version>
</dependency>
<!-- Hibernate gives you a choice of bytecode providers between cglib and javassist -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>[3.0,)</version>
</dependency>
</dependencies>
</project>
I think the main problem is in the line
The parameters 'mainClass' for goal org
.codehaus.mojo:exec-maven-plugin:1.2:java are missing or invalid -> [Help 1]
Why does mainClass is not valid?
Can you see something I don't?
EDIT:
OK, I changed "mainclass" to "mainClass" and it gives me this error about not finding "org.hsqldb.Server". I added hsqldb.jar to Eclipse' reference libraries but still it gives me the same error.
This is the stack print:
C:\Users\Eyal\workspace\FirstHibernateTutorial>mvn exec:java -Dexec.mainClass="o
rg.hsqldb.Server" -Dexec.args="-database.O file:target/data/tutorial" -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
org.hibernate.tutorials:hibernate-tutorial:jar:1.0.0-SNAPSHOT
[WARNING] The expression ${artifactId} is deprecated. Please use ${project.artif
actId} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building First Hibernate Tutorial 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> exec-maven-plugin:1.2:java (default-cli) # hibernate-tutorial >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2:java (default-cli) # hibernate-tutorial <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2:java (default-cli) # hibernate-tutorial ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.106s
[INFO] Finished at: Sat Apr 23 10:46:09 IDT 2011
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (def
ault-cli) on project hibernate-tutorial: An exception occured while executing th
e Java class. org.hsqldb.Server -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli) on project hibernate-t
utorial: An exception occured while executing the Java class. org.hsqldb.Server
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:217)
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.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured
while executing the Java class. org.hsqldb.Server
at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:346)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
... 19 more
Caused by: java.lang.ClassNotFoundException: org.hsqldb.Server
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:284)
at java.lang.Thread.run(Thread.java:662)
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
C:\Users\Eyal\workspace\FirstHibernateTutorial>

It should be mainClass not mainclass.
-Dexec.mainClass="org.hsqldb.Server"
Read more on this here and here.
And hsqldb should be in your maven dependencies:
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.0.0</version>
</dependency>

Please be aware, that the "configuration" section must be out of the execution section (see example below). Otherwise you get the "missing or invalid mainClass" error.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<dependencies>
<dependency>
<groupId>org.versly</groupId>
<artifactId>versly-wsdoc</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.versly.rest.wsdoc.RestDocAssembler</mainClass>
<arguments>
<argument>${project.build.directory}/classes</argument>
</arguments>
</configuration>
</plugin>

Related

Getting error while running Maven Project from Jenkins even though same setup works on Locally

Description : Same POM works locally with same suit but when i am swtiching to Jenkins execution, it shows the errors. Can anyone please help me to understand why this may happening?
Error Message recevied while running job from jenkins :
Started by user unknown or anonymous
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/WanderlyAutomationSuite
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git#github.com:orionhcs/automation-tests.git # timeout=10
Fetching upstream changes from git#github.com:orionhcs/automation-tests.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git fetch --tags --progress git#github.com:orionhcs/automation-tests.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 53f5d799bb2578706e48d80e1f428ca5a324e96c (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 53f5d799bb2578706e48d80e1f428ca5a324e96c
Commit message: "updated the code"
> git rev-list --no-walk 53f5d799bb2578706e48d80e1f428ca5a324e96c # timeout=10
[WanderlyAutomationSuite] $ /bin/sh -xe /tmp/jenkins8894762653318384960.sh
+ export M2_HOME=/srv/maven/
Parsing POMs
Established TCP socket on 37493
[WanderlyAutomationSuite] $ /usr/lib/jvm/java-8-openjdk-amd64//bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.5.4/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.5.4/conf/logging jenkins.maven3.agent.Maven35Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.5.4 /var/cache/jenkins/war/WEB-INF/lib/remoting-3.19.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12.jar 37493
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /var/lib/jenkins/workspace/WanderlyAutomationSuite/pom.xml compile test
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< Wanderly:WanderlyScenarios >---------------------
[INFO] Building WanderlyScenarios 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # WanderlyScenarios ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/WanderlyAutomationSuite/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # WanderlyScenarios ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # WanderlyScenarios ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/WanderlyAutomationSuite/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # WanderlyScenarios ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # WanderlyScenarios ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/WanderlyAutomationSuite/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # WanderlyScenarios ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # WanderlyScenarios ---
[INFO] No tests to run.
[INFO] Surefire report directory: /var/lib/jenkins/workspace/WanderlyAutomationSuite/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
hudson.AbortException: Test reports were found but none of them are new. Did leafNodes run?
For example, /var/lib/jenkins/workspace/WanderlyAutomationSuite/target/surefire-reports/TEST-TestSuite.xml is 37 min old
at hudson.tasks.junit.TestResult.parse(TestResult.java:266)
at hudson.tasks.junit.TestResult.parse(TestResult.java:231)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:629)
at hudson.maven.Maven3Builder$MavenExecutionListener.mojoFailed(Maven3Builder.java:662)
at hudson.maven.Maven3Builder$JenkinsEventSpy.onEvent(Maven3Builder.java:306)
at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent(EventSpyDispatcher.java:104)
at org.apache.maven.eventspy.internal.EventSpyExecutionListener.mojoFailed(EventSpyExecutionListener.java:138)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:90)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:220)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:130)
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 jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:176)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.440 s
[INFO] Finished at: 2019-03-06T12:25:02-08:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project WanderlyScenarios: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] Cannot find class in classpath: com.scenarios.Wanderly_ApplyJob_Scenario
[ERROR] at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
[ERROR] at org.testng.xml.XmlClass.init(XmlClass.java:73)
[ERROR] at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
[ERROR] at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:546)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
[ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
[ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:38)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:172)
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:300)
[ERROR] at org.testng.TestNG.run(TestNG.java:1021)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[JENKINS] Archiving /var/lib/jenkins/workspace/WanderlyAutomationSuite/pom.xml to Wanderly/WanderlyScenarios/0.0.1-SNAPSHOT/WanderlyScenarios-0.0.1-SNAPSHOT.pom
channel stopped
Finished: FAILURE
Below is the POM file which has created to run the script :
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>Wanderly</groupId>
<artifactId>WanderlyScenarios</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>WanderlyScenarios</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testngExecutor.xml</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.14.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.46.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.qmetry/qaf -->
<dependency>
<groupId>com.qmetry</groupId>
<artifactId>qaf</artifactId>
<version>2.1.14-RC2</version>
</dependency>
</dependencies>
</project>
After using "**mvn clean install**" shows below error :
it seems the error is related with maven with surefire plugin:
Can you please help me on this?
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< Wanderly:WanderlyScenarios >---------------------
[INFO] Building WanderlyScenarios 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (3.9 kB at 1.5 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom (13 kB at 24 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar (25 kB at 38 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (5.8 kB at 11 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar (34 kB at 44 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom (6.4 kB at 15 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.jar (27 kB at 48 kB/s)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # WanderlyScenarios ---
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom (4.1 kB at 10 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/16/spice-parent-16.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/16/spice-parent-16.pom (8.4 kB at 19 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/5/forge-parent-5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/5/forge-parent-5.pom (8.4 kB at 19 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar (226 kB at 181 kB/s)
[INFO] Deleting E:\Study Material\Selenium\WanderlyScenarios - NormalFW\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # WanderlyScenarios ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Study Material\Selenium\WanderlyScenarios - NormalFW\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # WanderlyScenarios ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # WanderlyScenarios ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Study Material\Selenium\WanderlyScenarios - NormalFW\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # WanderlyScenarios ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # WanderlyScenarios ---
[INFO] No tests to run.
[INFO] Surefire report directory: E:\Study Material\Selenium\WanderlyScenarios - NormalFW\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:11 min
[INFO] Finished at: 2019-03-07T11:16:08+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project WanderlyScenarios: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] Cannot find class in classpath: com.scenarios.Wanderly_ApplyJob_Scenario
[ERROR] at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
[ERROR] at org.testng.xml.XmlClass.init(XmlClass.java:73)
[ERROR] at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
[ERROR] at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:546)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
[ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
[ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:38)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:172)
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:300)
[ERROR] at org.testng.TestNG.run(TestNG.java:1021)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Even when I am using "mvn compile test", its working for me locally. Even when I am trying to run inside eclispe then also it works properly*

java.lang.NoClassDefFoundError: org/wildfly/swarm/bootstrap/util/MavenArtifactDescriptor

Using "WildFly Swarm Project Generator" tool via website, it generates a demo project to download, but when local Maven executes the steps of building and execution the following error happens:
mvn clean wildfly-swarm:run
Pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<name>WildFly Swarm Example</name>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<version.wildfly.swarm>2018.5.0</version.wildfly.swarm>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>bom-all</artifactId>
<version>${version.wildfly.swarm}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>demo</finalName>
<plugins>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<version>${version.wildfly.swarm}</version>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Java EE 7 dependency -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<!-- WildFly Swarm Fractions -->
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>jaxrs</artifactId>
</dependency>
</dependencies>
</project>
Log:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WildFly Swarm Example 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # demo ---
[INFO] Deleting /home/cbelleza/Downloads/demo/target
[INFO]
[INFO] >>> wildfly-swarm-plugin:2018.5.0:run (default-cli) > package # demo >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/cbelleza/Downloads/demo/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # demo ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/cbelleza/Downloads/demo/target/classes
[WARNING] error reading /home/cbelleza/.m2/repository/javax/javaee-api/7.0/javaee-api-7.0.jar; invalid LOC header (bad signature)
[WARNING] error reading /home/cbelleza/.m2/repository/org/wildfly/swarm/bootstrap/2018.5.0/bootstrap-2018.5.0.jar; invalid LOC header (bad signature)
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/cbelleza/Downloads/demo/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # demo ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # demo ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # demo ---
[INFO] Packaging webapp
[INFO] Assembling webapp [demo] in [/home/cbelleza/Downloads/demo/target/demo]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/cbelleza/Downloads/demo/src/main/webapp]
[INFO] Webapp assembled in [78 msecs]
[INFO] Building war: /home/cbelleza/Downloads/demo/target/demo.war
[INFO]
[INFO] --- wildfly-swarm-plugin:2018.5.0:package (default) # demo ---
[WARNING] Error injecting: org.wildfly.swarm.plugin.maven.PackageMojo
java.lang.NoClassDefFoundError: org/wildfly/swarm/bootstrap/util/MavenArtifactDescriptor
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
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)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:688)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:164)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:613)
at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:569)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:555)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:884)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:176)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:517)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
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.MojoExecutor.executeForkedExecutions(MojoExecutor.java:352)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:197)
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: java.lang.ClassNotFoundException: org.wildfly.swarm.bootstrap.util.MavenArtifactDescriptor
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)
... 76 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.262 s
[INFO] Finished at: 2018-05-20T13:04:45-03:00
[INFO] Final Memory: 28M/250M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.swarm:wildfly-swarm-plugin:2018.5.0:package (default) on project demo: Execution default of goal org.wildfly.swarm:wildfly-swarm-plugin:2018.5.0:package failed: A required class was missing while executing org.wildfly.swarm:wildfly-swarm-plugin:2018.5.0:package: org/wildfly/swarm/bootstrap/util/MavenArtifactDescriptor
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.wildfly.swarm:wildfly-swarm-plugin:2018.5.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/cbelleza/.m2/repository/org/wildfly/swarm/wildfly-swarm-plugin/2018.5.0/wildfly-swarm-plugin-2018.5.0.jar
[ERROR] urls[1] = file:/home/cbelleza/.m2/repository/org/wildfly/swarm/fraction-metadata/2018.5.0/fraction-metadata-2018.5.0.jar
[ERROR] urls[2] = file:/home/cbelleza/.m2/repository/org/wildfly/swarm/meta-spi/2018.5.0/meta-spi-2018.5.0.jar
[ERROR] urls[3] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-impl-javaee/2.0.0/shrinkwrap-descriptors-impl-javaee-2.0.0.jar
[ERROR] urls[4] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-impl-base/2.0.0/shrinkwrap-descriptors-impl-base-2.0.0.jar
[ERROR] urls[5] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-spi/2.0.0/shrinkwrap-descriptors-spi-2.0.0.jar
[ERROR] urls[6] = file:/home/cbelleza/.m2/repository/org/ow2/asm/asm/6.0/asm-6.0.jar
[ERROR] urls[7] = file:/home/cbelleza/.m2/repository/com/eclipsesource/minimal-json/minimal-json/0.9.4/minimal-json-0.9.4.jar
[ERROR] urls[8] = file:/home/cbelleza/.m2/repository/org/wildfly/swarm/tools/2018.5.0/tools-2018.5.0.jar
[ERROR] urls[9] = file:/home/cbelleza/.m2/repository/org/wildfly/swarm/bootstrap/2018.5.0/bootstrap-2018.5.0.jar
[ERROR] urls[10] = file:/home/cbelleza/.m2/repository/org/jboss/modules/jboss-modules/1.6.1.Final/jboss-modules-1.6.1.Final.jar
[ERROR] urls[11] = file:/home/cbelleza/.m2/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar
[ERROR] urls[12] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/shrinkwrap-api/1.2.6/shrinkwrap-api-1.2.6.jar
[ERROR] urls[13] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/shrinkwrap-spi/1.2.6/shrinkwrap-spi-1.2.6.jar
[ERROR] urls[14] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/shrinkwrap-impl-base/1.2.6/shrinkwrap-impl-base-1.2.6.jar
[ERROR] urls[15] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-api-jboss/2.0.0/shrinkwrap-descriptors-api-jboss-2.0.0.jar
[ERROR] urls[16] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-api-javaee/2.0.0/shrinkwrap-descriptors-api-javaee-2.0.0.jar
[ERROR] urls[17] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-api-base/2.0.0/shrinkwrap-descriptors-api-base-2.0.0.jar
[ERROR] urls[18] = file:/home/cbelleza/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-impl-jboss/2.0.0/shrinkwrap-descriptors-impl-jboss-2.0.0.jar
[ERROR] urls[19] = file:/home/cbelleza/.m2/repository/net/lingala/zip4j/zip4j/1.3.2/zip4j-1.3.2.jar
[ERROR] urls[20] = file:/home/cbelleza/.m2/repository/org/wildfly/swarm/spi/2018.5.0/spi-2018.5.0.jar
[ERROR] urls[21] = file:/home/cbelleza/.m2/repository/org/jboss/jandex/2.0.3.Final/jandex-2.0.3.Final.jar
[ERROR] urls[22] = file:/home/cbelleza/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
[ERROR] urls[23] = file:/home/cbelleza/.m2/repository/org/eclipse/aether/aether-util/1.0.0.v20140518/aether-util-1.0.0.v20140518.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.wildfly.swarm.bootstrap.util.MavenArtifactDescriptor
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
Is there any step missing? Or even a configuration to be applied in Maven.
In your error logs there is that message, invalid LOC header (bad signature).
Delete that jar so maven will download it again; see also Deploying Maven project throws java.util.zip.ZipException: invalid LOC header (bad signature)

How to make a storm release from the source code?

I need to create the latest "release" from the source code on github. But having trouble doing it.
here is the source code : https://github.com/apache/incubator-storm
here is how release looks like: https://storm.incubator.apache.org/downloads.html
My maven and java knowledge are very limited. I've tried this:
mvn release:prepare but it fails with this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project storm: Maven execution failed, exit code: '1' -> [Help 1]
pom.xml wasn't changed https://github.com/apache/incubator-storm/blob/master/pom.xml
If someone can otline me the steps on how to build a release it would be awesome.
Thank you.
##UPDATED
mvn release:prepare -X
[INFO] [DEBUG] Generating signature for /home/bsmith/workspace/storm/incubator-storm/target/storm-0.9.2-incubating.pom
[INFO] gpg: no default secret key: secret key not available
[INFO] gpg: signing failed: secret key not available
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Reactor Summary:
[INFO] [INFO]
[INFO] [INFO] Storm ............................................. FAILURE [4.032s]
[INFO] [INFO] maven-shade-clojure-transformer ................... SKIPPED
[INFO] [INFO] Storm Core ........................................ SKIPPED
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 4.907s
[INFO] [INFO] Finished at: Fri Mar 21 09:40:45 EDT 2014
[INFO] [INFO] Final Memory: 22M/291M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.4:sign (default) on project storm: Exit code: 2 -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.4:sign (default) on project storm: Exit code: 2
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:606)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[INFO] Caused by: org.apache.maven.plugin.MojoExecutionException: Exit code: 2
[INFO] at org.apache.maven.plugin.gpg.GpgSigner.generateSignatureForArtifact(GpgSigner.java:254)
[INFO] at org.apache.maven.plugin.gpg.GpgSignAttachedMojo.execute(GpgSignAttachedMojo.java:182)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[INFO] ... 19 more
[INFO] [ERROR]
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Storm ............................................. FAILURE [7.220s]
[INFO] maven-shade-clojure-transformer ................... SKIPPED
[INFO] Storm Core ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.198s
[INFO] Finished at: Fri Mar 21 09:40:45 EDT 2014
[INFO] Final Memory: 9M/151M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project storm: Maven execution failed, exit code: '1' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project storm: Maven execution failed, exit code: '1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: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:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:281)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:232)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89)
at org.apache.maven.shared.release.phase.RunPrepareGoalsPhase.execute(RunPrepareGoalsPhase.java:44)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:277)
... 22 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:394)
at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals(AbstractMavenExecutor.java:85)
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81)
... 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
##UPDATED #2
I've tried to go with first suggestion:
Fork the project (on Github), change the SCM section in the POM to use your own GitHub Fork (or change the SCM entry to some local repository)
After I've forked a git repo I've updated a section in pom.xml:
<scm>
<connection>scm:git:https://github.com/XXX/incubator-storm.git</connection>
<developerConnection>scm:git:https://github.com/XXX/incubator-storm.git</developerConnection>
<tag>v0.9.2-incubating</tag>
<url>https://github.com/XXX/incubator-storm.git</url>
</scm>
where XXX is my username.
pushed new pom.xml to github
run mvn release:prepare -DpushChanges=false -Dgpg.skip=true -X
and got an error:
[INFO] [DEBUG] Generating signature for /home/bsmith/workspace/storm/incubator-storm/target/storm-0.9.0.2.pom
[INFO] gpg: no default secret key: secret key not available
[INFO] gpg: signing failed: secret key not available
...
...
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.4:sign (default) on project storm: Exit code: 2 -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.4:sign (default) on project storm: Exit code: 2
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
If you are just trying to make a distribution (like what you would download from Apache), you can do so without the maven release plugin.
First, from the root of the source code directory do a maven build (skipping tests will make it faster):
mvn clean install -DskipTests=true
Then create the binary distribution:
cd storm-dist/binary
mvn package
The .zip and .tar.gz binary archives will be created in the storm-dist/binary/target sub-directory.
You won't be able to do a release using maven-release-plugin.
In order for this to succeed, the release plugin would have to change the source code on GitHub, which you aren't allowed to do.
So you have several options:
Fork the project (on Github), change the SCM section in the POM to use your own GitHub Fork (or change the SCM entry to some local repository)
You could call maven:release with -DpushChanges=false, which would prevent pushing of your changes back to GitHub
Don't use release plugin. Change the version using maven-versions-plugin, run mvn clean install (or deploy, after changing the distribution management section), and change the version again to a new SNAPSHOT version afterwards.
In any case, make sure that the cloned version (without release) builds cleanly on your computer.
Update
Try the third alternativ from above:
mvn version:set -DnewVersion=0.9.2-incubating-homebrew
git tag 0.9.2-incubating-homebrew (if you want)
mvn clean install/deploy
mvn version:set -DnewVersion=0.9.3-incubating-hombrew-SNAPSHOT
git push
If the gpg problem still occurs, it would be easiest to remove the complete sign profile.

JBehave Stories will not run as Embeddables

I have been attempting to run concurrent, multi-threaded stories using JBehave. They run correctly when using the embedder, but when running them as embeddables, they don't execute. When I change the source directories or the scope, I get a nullpointerException and when I comment them out, it builds successfully but does not find the class "My-ProgramStories.java." When I execute them using Maven with "mvn clean verify" this is what is returning (sorry for the ugly formatting):
[INFO] --- jbehave-maven-plugin:3.7.5:run-stories-as-embeddables (embeddable-stories) # program-test> ---
[INFO] Running stories as embeddables using embedder
Embedder[storyMapper=StoryMapper,storyRunner=StoryRunner,
embedderMonitor=MavenEmbedderMonitor,classLoader=EmbedderClassLoader[urls=[/Users//Documents/Repositories///target/test-classes/,
/Users//Documents/Repositories///target/classes,
groovy-all-1.8.4.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.7.5,
parent: sun.misc.Launcher$AppClassLoader#1729854]],embedderControls=
UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories
true,ignoreFailureInStories=true,ignoreFailureInView=true,verboseFailures=false,
verboseFiltering=false,storyTimeoutInSecs=400,threads=4]],
embedderFailureStrategy=org.jbehave.core.embedder.Embedder$ThrowingRunningStoriesFailed#127c1
ee,configuration=org.jbehave.core.configuration.MostUsefulConfiguration#10c56cbd,candidateSte
s=[],stepsFactory=,metaFilters=[groovy: story_path ==~ /.*.story/],systemProperties
{},executorService=,executorServiceCreated=false,storyManager=]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:04.710s
[INFO] Finished at: Mon Jul 29 09:55:43 CDT 2013
[INFO] Final Memory: 60M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jbehave:jbehave-maven-plugin:3.7.5:run-stories-as
embeddables (embeddable-stories) on project : Failed to run stories as
embeddables: NullPointerException -> [Help 1]
This is how I have the JBehave Maven Plugin configured in the POM:
<properties>
<embeddables>**/My-ProgramStories.java</embeddables>
<ignore.failre.in.stories>true</ignore.failre.in.stories>
<meta.filter>groovy: story_path ==~ /.*.story/</meta.filter>
<threads>4</threads>
<story.timeout.in.secs>400</story.timeout.in.secs>
</properties>
...
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<executions>
<execution>
<id>embeddable-stories</id>
<phase>integration-test</phase>
<configuration>
<includes>
<include>${embeddables}</include>
</includes>
<excludes>
<exclude>${exclude}</exclude>
</excludes>
<scope>test</scope>
<sourceDirectory>src/test/java</sourceDirectory>
<testSourceDirectory>src/test/resources</testSourceDirectory>
<skip>${skip}</skip>
<batch>false</batch>
<threads>${threads}</threads>
<storyTimeoutInSecs>${story.timeout.in.secs}</storyTimeoutInSecs>
<generateViewAfterStories>true</generateViewAfterStories>
<ignoreFailureInStories>
${ignore.failre.in.stories}
</ignoreFailureInStories>
<ignoreFailureInView>true</ignoreFailureInView>
<metaFilters>
<metaFilter>${meta.filter}</metaFilter>
</metaFilters>
</configuration>
<goals>
<goal>run-stories-as-embeddables</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.4</version>
</dependency>
</dependencies>
</plugin>
The structure of my story and test classes along with my story files as viewed through Eclipse is the following:
my-program-test
-->src/test/java
---->package1
------>My-ProgramSteps.java
------>My-ProgramStories.java
-->src/test/resources
---->package1
------>Story Files
Here is the stacktrace of the error:
[ERROR] Failed to execute goal org.jbehave:jbehave-maven-plugin:3.7.5:run-stories-as-embeddables (embeddable-stories) on project my-program: Failed to run stories as embeddables: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jbehave:jbehave-maven-plugin:3.7.5:run-stories-as-embeddables (embeddable-stories) on project my-program-test: Failed to run stories as embeddables
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
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:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: 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:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.util.AbstractScanner.normalizePattern(AbstractScanner.java:327)
at org.codehaus.plexus.util.AbstractScanner.setExcludes(AbstractScanner.java:314)
at org.jbehave.core.io.StoryFinder.scanDirectory(StoryFinder.java:218)
at org.jbehave.core.io.StoryFinder.scan(StoryFinder.java:205)
at org.jbehave.core.io.StoryFinder.findClassNames(StoryFinder.java:61)
at org.jbehave.mojo.AbstractEmbedderMojo.classNames(AbstractEmbedderMojo.java:302)
at org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:18)
... 21 more
Based on this
Caused by: java.lang.NullPointerException at
org.codehaus.plexus.util.AbstractScanner.normalizePattern(AbstractScanner.java:327) at
org.codehaus.plexus.util.AbstractScanner.setExcludes(AbstractScanner.java:314) at
Looks like your exclusion pattern configuration is broken. It would look like this:
<exclude>${exclude}</exclude>
is not defined in your properties. You could use effective-pom to confirm if all properties are properly expanded.

Maven compilation failes (but compilation under Eclipse is successful)

While building my web project from Eclipse, everything is fine: no errors, no warnings.
However while building project with Maven it failes. Below is the output form mvn compile:
c:\Users\jwa\Desktop\tets\traffic_web>mvn
compile -e
+ Error stacktraces are turned on. [INFO] Scanning for projects... [INFO]
------------------------------------------------------------------------ [INFO] Building traffic_web [INFO]
task-segment: [compile] [INFO]
------------------------------------------------------------------------ [INFO] [resources:resources
{execution: default-resources}]
[WARNING] Using platform encoding
(Cp1250 actually) to copy filtered
resources, i.e. build is platform
dependent! [INFO] skip non existing
resourceDirectory
c:\Users\jwa\Desktop\tets\traffic_web\src\main\resources
[INFO] [compiler:compile {execution:
default-compile}] [INFO] Compiling 22
source files to
c:\Users\jwa\Desktop\tets\traffic_web\target\classes
[INFO]
------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Compilation failure
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Encryptor.java:[7,15]
sun.misc.BASE64Encoder is Sun propriet
ary API and may be removed in a future
release
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Session.java:[3,25]
package javax.servlet.http does not
exis t
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Session.java:[15,21]
cannot find symbol symbol : class
HttpSession location: class
traffic_web.tools.Session
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[6,20]
package javax. servlet does not exist
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[7,20]
package javax. servlet does not exist
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[8,20]
package javax. servlet does not exist
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[10,58]
cannot find s ymbol symbol: class
ServletContextListener public class
ServletContextListenerInitializer
implements ServletContextListener {
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[12,33]
cannot find s ymbol symbol : class
ServletContextEvent location: class
traffic_web.tools.ServletContextListenerInitializer
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[15,35]
cannot find s ymbol symbol : class
ServletContextEvent location: class
traffic_web.tools.ServletContextListenerInitializer
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\controller\BoardController.java:[9,25]
package javax.servlet.http does not
exist
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\controller\BoardController.java:[87,29]
cannot find symbol symbol : class
HttpServletResponse location: class
traffic_web.controller.BoardController
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\controller\BoardController.java:[116,37]
cannot find symbol symbol : class
HttpServletResponse location: class
traffic_web.controller.BoardController
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Encryptor.java:[27,15]
sun.misc.BASE64Encoder is Sun proprie
tary API and may be removed in a
future release
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Session.java:[17,27]
cannot access
javax.servlet.http.HttpSe rvletRequest
class file for
javax.servlet.http.HttpServletRequest
not found
return attr.getRequest().getSession(true); //
true == allow create
c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[17,8]
cannot find sy mbol symbol : class
ServletContext location: class
traffic_web.tools.ServletContextListenerInitializer
[INFO]
------------------------------------------------------------------------ [INFO] Trace
org.apache.maven.BuildFailureException:
Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:55
6)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by:
org.apache.maven.plugin.CompilationFailureException:
Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 second [INFO]
Finished at: Mon Jun 28 21:56:25 CEST
2010 [INFO] Final Memory: 13M/254M
[INFO]
My POM file looks like that:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>masters.traffic</groupId>
<artifactId>traffic_web</artifactId>
<packaging>war</packaging>
<name>traffic_web</name>
<version>0.1.0</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
Can Someone help me how to fix that ?
Regards
You haven't added the servlet classes as dependencies. There are apparently present per default in Eclipse, which is why it works to compile from there. Add the following to you pom (before <build>..., taken from here):
<dependencies>
[...]
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
</dependencies>

Categories

Resources