SAXParseException when compiling through maven - maven-3

Hi all I know this might of been asked before, so sorry in advance(havnt got enough reps to comment on other thread)
When I compile my project through mvn I get some SAXParse exceptions, even though I can build and run my project no problem. I'm just cleaning up some build warnings and would like to know why this occurs...any help greatly appreciated
LOG.....
[INFO] --- jaxb2-maven-plugin:1.6:xjc (Shop) # the-project ---
[INFO] Generating source...
[INFO] parsing a schema...
**[INFO] compiling a schema...
[WARNING] null[-1,-1]
org.xml.sax.SAXParseException; generating code**
at com.sun.tools.xjc.ErrorReceiver.debug(ErrorReceiver.java:140)
at com.sun.tools.xjc.Driver.run(Driver.java:361)
at org.codehaus.mojo.jaxb2.AbstractXjcMojo.execute(AbstractXjcMojo.java:316)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: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)
the POM....
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>The</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<schemaIncludes>
<include>The.xsd</include>
</schemaIncludes>
<schemaDirectory>${schema.directory.The}</schemaDirectory>
<packageName>${generated.source.The}</packageName>
<verbose>true</verbose>
<clearOutputDir>false</clearOutputDir>
</configuration>
</execution>
</executions>

I was having the same problem, and the issue is that the verbose flag is turned on, and the logging for verbose creates errors just for the sake of logging.
There is basically a "bug" in the XJC code, where they call
//generate actual code
receiver.debug("generating code");
and the debug statement is written
public final void debug( String msg ) {
info( new SAXParseException(msg,null) );
}
which then calls
public void info(SAXParseException exception) {
if(opt.verbose)
super.info(exception);
}
Thus, because of the way the the logger is implimented, it logs a full stack trace. This is even more fun to find, because the SAXParseExceptionis only created to create a logging statement, and is never thrown.

Related

maven-changes-plugin error: "This JIRA server does not support version 2 of the REST API"

We use maven-changes-plugin to generate release announcement. Unfortunately, "mvn changes:jira-report" commands returns "Falling back to RSS for issue download: This JIRA server does not support version 2 of the REST API, which maven-changes-plugin requires.". Please see command error log below:
[INFO] Falling back to RSS for issue download: This JIRA server does not support version 2 of the REST API, which maven-changes-plugin requires.
[WARNING] Unable to respond to any of these challenges: {oauth=OAuth realm="https%3A%2F%2Fjira.myjira.com%3A8443"}
[INFO] Downloading from JIRA at: https://jira.myjira.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?tempMax=100&reset=true&jqlQuery=project+%3D+CP+AND+fixVersion+%3D+%223.2.1-alpha-4%22+AND+status+in+%28Closed%29+AND+resolution+in+%28Fixed%29+ORDER+BY+priority+DESC%2C+created+DESC
[WARNING] Unable to respond to any of these challenges: {oauth=OAuth realm="https%3A%2F%2Fjira.myjira.com%3A8443"}
[WARNING] Downloading from JIRA failed. Received: [401]
[WARNING] JIRA file /Users/jay/3.2.1-alpha/marketplace/target/jira-results.xml doesn't exist.
[WARNING]
org.apache.maven.plugin.MojoExecutionException: Couldn't find any issues for the version '3.2.1-alpha-4' among the supplied issues: []
at org.apache.maven.plugin.issues.IssueUtils.getIssuesForVersion(IssueUtils.java:119)
at org.apache.maven.plugin.jira.JiraMojo.executeReport(JiraMojo.java:387)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:255)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:210)
at org.apache.maven.plugin.changes.AbstractChangesReport.execute(AbstractChangesReport.java:207)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java: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)
Environment info
JIRA Standalone 5.2.5
maven-changes-plugin v2.11
pom.xml excerpt
<issueManagement>
<system>JIRA</system>
<url>https://jira.myjira.com:8443/browse/CP</url>
</issueManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.11</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>announcement-generate</goal>
</goals>
<id>announcement-generate</id>
</execution>
<execution>
<phase>deploy</phase>
<goals>
<goal>announcement-mail</goal>
</goals>
<id>announcement-mail</id>
</execution>
</executions>
<configuration>
<useJql>true</useJql>
<jiraUser>xxx</jiraUser>
<jiraPassword>xxx</jiraPassword>
<webUser>xxx</webUser>
<webPassword>xxx</webPassword>
<onlyCurrentVersion>true</onlyCurrentVersion>
<smtpHost>relay.edsmtp.net</smtpHost>
<smtpPort implementation="java.lang.Integer">25</smtpPort>
<toAddresses>
<toAddress implementation="java.lang.String">to#email.com</toAddress>
</toAddresses>
<mailSender>
<name>Release Notification</name>
<email>projectupdates#email.com</email>
</mailSender>
<issueManagementSystems>
<issueManagementSystem>JIRA</issueManagementSystem>
</issueManagementSystems>
</configuration>
</plugin>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.11</version>
<configuration>
<useJql>true</useJql>
<jiraUser>xxx</jiraUser>
<jiraPassword>xxx</jiraPassword>
<webUser>xxx</webUser>
<webPassword>xxx</webPassword>
<onlyCurrentVersion>true</onlyCurrentVersion>
<resolutionIds>Unresolved</resolutionIds>
<statusIds>Open</statusIds>
<typeIds>Bug, New Feature, Improvement</typeIds>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>jira-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
Appreciate any pointers.
Thanks
You get that error because the first REST method it tries to access (https://myjiraserver/rest/api/2/serverInfo) did not return HTTP 200 when trying to access the resource.
Your JIRA version should support v2 of the REST API, so you are likely getting that error because of one of the following reasons:
you provided the wrong URL to Maven (perhaps missing the context path?), or
could you be using a self-signed SSL certificate on the server that might interfere with the ability of the client to connect?
In the latter case, you could try pointing Maven at the non-SSL port for JIRA (if you still have that <Connector> accessible in JIRA's conf/server.xml), or else see if you can fix it by adding the cert to the trust store used by Maven.
I think option #2 is less likely since I would expect the WebClient library to throw an exception if there were a cert validation problem, but I admit that I haven't dug into its API to figure out exactly what it does in that scenario.
From https://maven.apache.org/plugins/maven-changes-plugin/xref/org/apache/maven/plugin/jira/RestJiraDownloader.html:
105 Map<String, String> urlMap = JiraHelper.getJiraUrlAndProjectName( project.getIssueManagement().getUrl() );
106 String jiraUrl = urlMap.get( "url" );
107 jiraProject = urlMap.get( "project" );
108
109 // This classloader juggling is a workaround for a classic Maven 2 class loader management bug.
110 ClassLoader ccl = Thread.currentThread().getContextClassLoader();
111 try
112 {
113 Thread.currentThread().setContextClassLoader( WebClient.class.getClassLoader( ) );
114 WebClient client = setupWebClient( jiraUrl );
115
116 // We use version 2 of the REST API, that first appeared in JIRA 5
117 // Check if version 2 of the REST API is supported
118 // http://docs.atlassian.com/jira/REST/5.0/
119 // Note that serverInfo can always be accessed without authentication
120 client.replacePath( "/rest/api/2/serverInfo" );
121 client.accept( MediaType.APPLICATION_JSON );
122 Response siResponse = client.get();
123 if ( siResponse.getStatus() != Response.Status.OK.getStatusCode() )
124 {
125 throw new NoRest(
126 "This JIRA server does not support version 2 of the REST API, which maven-changes-plugin requires." );
127 }
128

Why does jboss-as:deploy fail?

I wanted to deploy my war file to JBoss 7.1.1 after compilation. But it fails with the following line in output (setting maven debug output to -X and -e does not create more verbose output).
My maven command I use to invoke it is: clean install -Pintegration jboss-as:deploy
[INFO] --- jboss-as-maven-plugin:7.1.1.Final:deploy (default-cli) # webapp ---
Aug 28, 2013 11:58:26 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
Aug 28, 2013 11:58:26 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Aug 28, 2013 11:58:26 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
mojoFailed org.jboss.as.plugins:jboss-as-maven-plugin:7.1.1.Final(default-cli)
projectFailed com.foo:webapp:0.0.1-SNAPSHOT
[HUDSON] Archiving C:\Users\Administrator\.hudson\jobs\CCMS\workspace\pom.xml to C:\Users\Administrator\.hudson\jobs\CCMS\modules\com.foo$webapp\builds\2013-08-28_11-57-43\archive\com.foo\webapp\0.0.1-SNAPSHOT\pom.xml
[HUDSON] Archiving C:\Users\Administrator\.hudson\jobs\CCMS\workspace\target\webapp.war to C:\Users\Administrator\.hudson\jobs\CCMS\modules\com.foo$webapp\builds\2013-08-28_11-57-43\archive\com.foo\webapp\0.0.1-SNAPSHOT\webapp.war
sessionEnded
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 57.908s
[INFO] Finished at: Wed Aug 28 11:58:49 CEST 2013
[INFO] Final Memory: 21M/250M
[INFO] ------------------------------------------------------------------------
maven builder waiting
mavenExecutionResult exceptions not empty
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.1.1.Final:deploy (default-cli) on project webapp: Deployment failed and was rolled back.
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.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:146)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:124)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:107)
at hudson.remoting.UserRequest.perform(UserRequest.java:41)
at hudson.remoting.Request$2.run(Request.java:276)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.plugin.MojoExecutionException: Deployment failed and was rolled back.
at org.jboss.as.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:147)
at org.jboss.as.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:138)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Before that, I added mgmtuser with the batch files to the jboss management realm.
Profile pom.xml configuration is:
<profile>
<!-- The profile to build in the integration environment -->
<id>integration</id>
<build>
<plugins>
<!-- Use this plugin to cleanly deploy the application -->
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.1.1.Final</version>
<configuration>
<hostname>localhost</hostname>
<username>mgmtuser</username>
<password>pwd</password>
<force>true</force>
</configuration>
</plugin>
</plugins>
</build>
</profile>
How could I retrieve detailed information about the error?
I looked up the server.log and spoted Can't find a persistence unit named foo in deployment.
Altough it worked in local development with Eclipse, it failed on integration. Reason: the persistence.xml was not included in the classpath. In the war file that is: /WEB-INF/classes/META-INF/persistence.xml
Any place else results in an error.

Sonar: IllegalStateException

I am trying to setup sonar on Ubuntu 12.04 machine. However, when I run mvn (maven 3.0.4), it fails with this exception. The sonar server is running fine, I can access it from browser.
Here is my sonar profile in settings.xml (~/.m2/settings.xml)
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>jdbc:h2:tcp://localhost:9092/sonar</sonar.jdbc.url>
<sonar.jdbc.driver>org.h2.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>sonar</sonar.jdbc.password>
</properties>
</profile>
</profiles>
Exception:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project configurator: Can not execute Sonar: IllegalStateException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project configurator: Can not execute Sonar
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: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.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
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.IllegalStateException
at org.sonar.home.cache.FileCache.newTempFile(FileCache.java:143)
at org.sonar.home.cache.FileCache.get(FileCache.java:83)
at org.sonar.batch.bootstrap.PluginDownloader.downloadPlugin(PluginDownloader.java:53)
at org.sonar.batch.bootstrap.BatchPluginRepository.doStart(BatchPluginRepository.java:74)
at org.sonar.batch.bootstrap.BatchPluginRepository.start(BatchPluginRepository.java:65)
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.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:72)
at org.sonar.batch.bootstrap.Container.start(Container.java:71)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:88)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:72)
at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:142)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
... 23 more
Let me know if you need any additional information.
The stack trace told us that the current plugin is org.codehaus.mojo:sonar-maven-plugin:2.0 which is quite old, since 05-Nov-2011.
I would like to recommend not to define it in our pom.xml as mentionins at Analyzing with Maven: Recommended Way as the following:-
mvn clean install -DskipTests=true
mvn sonar:sonar
skipTests=true not to run unit tests twice: during the install goal and again during the sonar goal. You can also deactivate the integration tests execution. Please refer to the Maven documentation.
Anyhow If you would like to define it explicitly, please use the latest one which is matched with your Sonar server version. e.g. I'm using the current Sonar server version 3.5. The plugin should be either, org.codehaus.sonar:sonar-maven-plugin:3.5 or org.codehaus.sonar:sonar-maven3-plugin:3.5
Even the Installing and Configuring Maven also told us that the sonar.host.url is an optional (the default is http://localhost:9000), I also would like to encourage to define it explicitly as well.
I hope this may help.

Hitting org.apache.maven.lifecycle.LifecycleExecutionException with Maven 3 on Jenkins v1.461

I am trying to switch from Maven 2 to Maven 3 (v3.0.4). The basic command being used is mvn clean verify on jenkins.
When I run a build on jenkins I get the following stack trace on it's console:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
<snip />
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.12:verify (default) on project myProject: There are test failures.
Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
cause : There are test failures.
Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.12:verify (default) on project myProject: There are test failures.
Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
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.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
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.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
Please refer to /home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports for the individual test results.
at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:121)
at org.apache.maven.plugin.failsafe.VerifyMojo.execute(VerifyMojo.java:208)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Maven failed with error.
Sending e-mails to: person#org.com
channel stopped
2012-07-11 21:01:31.564:INFO::Shutdown hook executing
2012-07-11 21:01:31.564:INFO::Shutdown hook complete
Archiving artifacts
Sending e-mails to: person#org.com
Finished: SUCCESS
I've tried quite hard searching on the net, trying various pom changes and running maven with -e, -X, -fae etc but nothing seems to allow me shake off this stack trace :( .. been struggling w/ it for a few days now.
Anybody able to help out with some suggestions and/or pin-pointing the issue w/ a solution would be greatly appreciated.
Please note that the project is organized as:
Parent pom
|
----------> module 1
----------> module 2
----------> ...
----------> module 6
where module 6 corresponds to myProject above and it has dependencies on some libraries (i.e. module1, module2 etc).
The parent pom has:
<reporting>
<plugins>
{ several plugins including maven-dependency-plugin, maven-project-info-reports-plugin, cobertura-maven-plugin, maven-surefire-report-plugin (v2.12)
and maven-surefire-report-plugin (v2.12) specifically w/
<reportSets>
<reportSet>
<id>integration-tests</id>
<reports>
<report>failsafe-report-only</report>
</reports>
</reportSet>
</reportSets>
}
</plugins>
<reporting>
and
<build>
<pluginManagement>
<plugins>
{several plugins including maven-surefire-plugin, maven-surefire-report-plugin (v2.12), maven-assembly-plugin, maven-release-plugin (v2.3.2)
</plugins>
</pluginManagement>
<plugins>
{several plugins including maven-site-plugin (v3.1), maven-compiler-plugin (v2.5.1), maven-release-plugin (v2.3.2)
</plugins>
</build>
Please also note that I am seeing the problem exactly when there are test failures i.e. I would like to get a clean (no stack traces et all) console output when there is a test failure. In fact during my above mentioned troubleshooting I actually setup an (intentionally) failing test. Also when I look at '/home/tc/.jenkins/jobs/myProject-selenium-adhoc/workspace/target/failsafe-reports' the failsafe reports/test failure details output looks good i.e. I see my expected test failure screen capture (custom logic in our framework) AND various summary/reports like emailable-report.html with correct contents.
Thank you !

mvn clean install + java.lang.NoClassDefFoundError

Got next error with maven using console:
d:\projects.perforce\FOTradeCapture\branches\evb-dev>mvn clean install
Exception in thread "main" java.lang.NoClassDefFoundError: [15:27:13]
Caused by: java.lang.ClassNotFoundException: [15:27:13]
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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: [15:27:13]. Program will exit.
Maven was successfully installed and worked for some period of time.
Thanks for ideas.
==============================================================================
Aditional info:
d:\projects.perforce\FOTradeCapture\branches\evb-dev>mvn -version
Apache Maven 3.0.1 (r1038046; 2010-11-23 12:58:32+0200)
Java version: 1.6.0_23
Java home: c:\ProgramFiles\Java\jdk1.6.0_23\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
you must check pom.xml of your project and be sure that mainClass tag on pom.xml
reference to your project's class that contain main(String[] args) method.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>ir.codepress.MainApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
I had corrupted MAVEN_OPTS in Environment Variables.
I've changed maven memory settings and it stopped to work only after machine restart (on the next day).

Resources