I am trying to integrate OpenClover into my project.
I have a Java based webapp and I use maven
I have setup the plugin as follows
<plugin>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<version>4.2.0</version>
<configuration>
<targetPercentage>50%</targetPercentage>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
When I run the following command
mvn clean test clover:aggregate clover:clover -Dsurefire.skip.tests=false;
I get this error
[ERROR] Failed to execute goal org.openclover:clover-maven-plugin:4.2.0:setup (default-cli) on project fcservices-web: Execution default-cli of goal org.openclover:clover-maven-plugin:4.2.0:setup failed: Unable to load the mojo 'setup' (or one of its required components) from the plugin 'org.openclover:clover-maven-plugin:4.2.0': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) No implementation for org.apache.maven.execution.MavenSession was bound.
[ERROR] while locating com.atlassian.maven.plugin.clover.CloverSetupMojo
[ERROR] at ClassRealm[plugin>org.openclover:clover-maven-plugin:4.2.0, parent: sun.misc.Launcher$AppClassLoader#55f96302]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.openclover:clover-maven-plugin:4.2.0:setup)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.openclover:clover-maven-plugin:4.2.0:setup
[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
Any ideas what is up here?
Thank you
Damien
From error it looks like you need higher version of Maven or older version of Clover plugin.
Going to the latest version of Maven (3.5.2) resolved this issue
Related
I am trying to schedule my project on Maven. It uses Apache POI. Project works fine on my Laptop but it fails to compile Maven on Jenkins that is on a remote machine in our office. The error I face is:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile** (default-testCompile) on project GunAV-test-automation: Compilation failure: Compilation failure:
[ERROR] /C:/Program Files (x86)/Jenkins/workspace/Mytest/-42/src/test/java/utilities/ReadExcel.java:[11,37] **package org.apache.poi.xssf.usermodel does not exist**
[ERROR] /C:/Program Files (x86)/Jenkins/workspace/Mytest/-42/src/test/java/utilities/ReadExcel.java:[12,37] package org.apache.poi.xssf.usermodel does not exist**
[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/MojoFailureException
How could I fix this issue?
To fix a compilation error
package org.apache.poi.xssf.usermodel does not exist
you should add a poi-ooxml maven dependency:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
This dependency contains org.apache.poi.xssf.usermodel package.
I've problem with release:prepare in Maven. When I enter "mvn release:prepare" I get error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project com.joledzki.petclinic2: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-commit command failed.
[ERROR] Command output:
[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/MojoFailureException
pom.xml
<scm>
<developerConnection>scm:git:git#github.com:JakubOledzki/petclinic2.git</developerConnection>
<tag>com.joledzki.petclinic2-0.0.2</tag>
Build work correct. Someone has a solution ?
i'm working on a "complex"/"well-structured" Maven Project, and in particular i'm working on a single internal Module of the project. I'm against a COMPILE ERROR because it seems that it doesn't find the Java Classes from an external source already linked from the Menu (right-clicking on the project) ->Build Path->Link Source.
This is a bunch of essential errors taken from the Console when i Run-> mvn : compile
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project optimizer: Compilation failure: Compilation failure:
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/Module.java:[24,19] package jmetal.core does not exist
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/Module.java:[35,29] cannot find symbol
[ERROR] symbol: class Variable
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/Module.java:[39,11] cannot find symbol
[ERROR] symbol: class Problem
[ERROR] location: class eu.planner.Module
[INFO] 100 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.090 s
[INFO] Finished at: 2015-05-02T10:46:45+01:00
[INFO] Final Memory: 21M/219M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project optimizer: Compilation failure: Compilation failure:
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/heuristics/SVariable.java:[234,9] method does not override or implement a method from a supertype
[ERROR] /Users/Ste/Desktop/eclip/workspace/planner/src/main/java/eu/planner/heuristics/SVariable.java:[237,24] cannot find symbol
[ERROR] symbol: variable super
[ERROR] location: class eu.planner.heuristics.SVariable
[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/MojoFailureException
Adding the -X it shows the DEBUG, but nothing strange. It just add at the end this information:
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project optimizer: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 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/MojoFailureException
I also tried to add in the POM of the Module i'm working on, this build helper taken from here http://mojo.codehaus.org/build-helper-maven-plugin/usage.html (without success):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals><goal>add-source</goal></goals>
<configuration>
<sources>
<source>/Users/Ste/Desktop/externalFolderWithJavaClasses<source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Where plugin element is in /project/build/plugins and NOT in /project/build/pluginManagement/plugins.
I checked my target/classes folder of the project and it is empty.
I'm not importing files from any other projects. Just linked a folder from my filesystem.
The path you see in the screenshot is different from what you see in Compile Error because at the beginning i thought to not show my real path.
Here 2 Screenshot:
Does anyone understand what is wrong? Thank you so much
P.S. I'm using a Mac OS X x64, Eclipse Luna, and the project is Pulled from a GitHub repository if for someone this information is fundamental.
Your problem makes sense in a way. Originally, you added a source folder to your project through Eclipse, but not through maven. And when you tried to compile your maven sources, maven barfed since it couldn't find the folder you added through Eclipse.
It's a little surprising that you're still getting the same error when you use the build-helper-maven-plugin. Since that is the proper way of adding extra source folders. I think you just need to run mvn clean verify and all should be good again.
Inside of Eclipse, make sure to run Maven -> Update project... and your project should also have the proper source folders on it.
I'm actually really new to this...
everytime I try to deploy a war file in Wildfly it gives me this error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.774 s
[INFO] Finished at: 2015-03-23T01:56:20+08:00
[INFO] Final Memory: 24M/283M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Fi
nal:deploy (default-cli) on project jbpm6-example: Could not execute goal deploy
on E:\Apps\jbpm6-example\target\jbpm6-example-1.0.war. Reason: Error could not
execute operation '{
[ERROR] "address" => [],
[ERROR] "operation" => "read-attribute",
[ERROR] "name" => "launch-type"
[ERROR] }'. java.net.ConnectException: JBAS012144: Could not connect to remote:/
/localhost:9999. The connection timed out
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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
I've tried configuring the plugin in pom.xml like this to connect to port 9999 since from what I've searched wildfly is using port 9990..
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.3.Final</version>
<configuration>
<hostname>localhost</hostname>
<port>9999</port>
</configuration>
</plugin>
but still can't deploy it...
I've also tried using the wildfly-maven-plugin but it also gives me an error: Deployment failed and was rolled back
Older jboss-as-maven-plugin will not work with WildFly. You need to use the newer wildfly-maven-plugin only. It can be defined as:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.1.0.Alpha1</version>
</plugin>
...
</plugins>
...
</build>
...
</project>
And then mvn wildfly:deploy will work.
Here is a blog that provide more details:
http://blog.arungupta.me/wildfly-maven-plugin-tech-tip-9/
All Java EE 7 samples at https://github.com/javaee-samples/javaee7-samples use this plugin as well.
Alternatively, you can find a simpler Java EE 7 sample using this plugin at:
https://github.com/javaee-samples/javaee7-simple-sample/blob/master/pom.xml
I am using Eclipse 3.5 (Galileo) with m2eclipse and GWT Eclipse plugins installed. I created a project using the gwt-maven-plugin archetype. I have created an RPC service defined with these classes:
my.package.client.DataService
my.package.client.DataServiceAsync
my.package.server.DataServiceImpl
When I run mvn clean, the target directory is removed (as exepected). When I run gwt:compile gwt:run -X -e, I get the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project MyProject: Compilation failure
C:\Devel\EclipseProjects\MyProject\target\generated-sources\gwt\my\package\client\DataServiceAsync.java:[8,7] duplicate class: my.project.client.DataServiceAsync
-> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project MyProject: Compilation failure
C:\Devel\EclipseProjects\MyProject\target\generated-sources\gwt\my\package\client\DataServiceAsync.java:[8,7] duplicate class: my.project.client.DataServiceAsync
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:581)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeForkedExecutions(DefaultLifecycleExecutor.java:685)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:560)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
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.CompilationFailureException: Compilation failure
C:\Devel\EclipseProjects\MyProject\target\generated-sources\gwt\my\package\client\DataServiceAsync.java:[8,7] duplicate class: my.project.client.DataServiceAsync
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.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:577)
... 16 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/MojoFailureException
After the failure, the target directory has been created with the following directory structure and the single file in it as such:
MyProject/target/generated-sources/gwt/my/project/client/DataServiceAsync.java
Since the target directory didn't exist before running gwt:compile gwt:run -X -e, the directories must have been created and the java class copied as part of executing the goal. So, why would the goal now complain about a duplicate class?
Any help is greatly appreciated!
I have found this posting which states:
If you manually create the Async interface you must disable the generateAsync goal in the plugin configuration
The fix was to remove <goal>generateAsync</goal> from my pom.xml. The plugin config now looks like:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>my.package.Application/Application.html</runTarget>
</configuration>
</plugin>
You might actually have generated a duplicate class.
There is a "generateAsync" goal in pom.xml which takes care of generating Async classes for each service You create. If You have this You DO NOT NEED to create a Async version manually.
If You do then You will get "Duplicate Class" error.