Eclipse Maven Build/Plugin Issue - java

Did a fresh install of Eclipse 4.9, and can no longer build my Java project within Eclipse (still builds fine from command line).
The console output does not give me much to go on... just complains about the plugin...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project myprojectcommon: Compilation failure -> [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 myprojectcommon: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
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.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:862)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
I'm running Eclipse 4.9 on OSX High Sierra, w/ JDK 1.8_191. Maven version is 3.5.4, and Eclipse is configured to use this external Maven. JAVA_HOME and M2_HOME are set (though I don't think they are needed for OSX). I have tried building my existing workspace as well as importing the project into a fresh one.
Kind of at wit's end here... any help would be greatly appreciated.
EDIT 1: Then using a Terminal inside Eclipse, it does not recognize the mvn command, nor does it see any system variables like M2_HOME. Eclipse itself is configured to use my external maven installation, but I have also tried using the embedded. In both cases, Eclipse Terminal does not recognize mvn.

Try to locate and delete .m2/repository local repository. It should solve the problem !

if you are using Java 8, in your pom.xml, try adding this:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Or configure in plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>your maven compiler plugin version</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

Fix: Eclipse needs to be launched from command line in order for PATH and other Env Vars to be picked up
Steps:
Created a new script called eclipseLauncher and made it executable (chmod 755)
#!/bin/bash
/Applications/eclipse/jee-2018-09/Eclipse.app/Contents/MacOS/eclipse &
Turned script into an app:
a. Create an AppleScript (save as type .app) that points to the launcher script…
do shell script "open /Applications/eclipse/scripts/eclipseLauncher"
b. This app can then be moved to the dock and executed from there
NOTE: The app executes a script rather than directly issuing the commands. When I simply ran the command from the app, I could not get the terminal window to close after Eclipse was launched. Only by invoking the script could I get it to work like I wanted.

Related

Building Eclipse IDE from scratch - how to specify the target OS?

This post is about building the whole Eclipse IDE from the source code - and more in particular how to specify the target OS you want to build the executable for.
I found the following tutorial to guide me through the build procedure: http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html
Especially chapter 13 of that Tutorial is helpful. I will describe the steps that need to be taken one by one here - so you don't need to read the vogella tutorial.
NEEDED SOFTWARE :
Apparently you need to have the following software installed on your (Windows) machine:
Git
Maven Version 3.3.1 (make sure that the bin folder where you extract Maven is added to the PATH. For installation instructions see https://maven.apache.org/install.html)
Oracle 1.8 JDK or higher (don't forget to set the JAVA_HOME environment variable)
Now you're ready to start:
STEP 1 :
Create a new folder in the C:\ disk. Let's name it C:\myEclipse. This will be the folder in which we pull the Git repository of the latest Eclipse version.
STEP 2 :
Open the Windows cmd shell with administrator privileges (right click on cmd icon if you made one on your desktop, and select open with admin rights). Go to that folder through the command cd C:\myEclipse. Now type the following command: git config --system core.longpaths true. This notifies Git that long names can occur in the repository. Forget this command and it will result in errors later on.
STEP 3 :
Clone the Git repository:
git clone -b master --recursive git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git
Now you should have some patience for all the sourcecode to get copied to your local folder.
STEP 4 :
Finally it is time to start the build. The build procedure will already take hours, so it is wise to skip the unit tests. Therefore do not forget to add the -DskipTests parameter. This is the command to start the build:
mvn clean verify -DskipTests
After some hours, the build should be finished.
STEP 5 :
The results of the build should now be in the following folder:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.releng.tychoeclipsebuilder\sdk\target\products
Notice that the Eclipse IDE is built for all possible target machines. 32-bit Windows, 64-bit Windows, Macintosh, Linux, ... No wonder it takes hours! I would like to build for just one single target - for example my 64-bit Windows machine. This will hopefully reduce the build time significantly and allow me to verify code changes quicker.
Does anyone know how to achieve this?
EDIT :
I have added the argument -Dnative=win32.win32.x86_64 to the build command. Unfortunately, I get an error after 15 to 20 mins. This time, I've added the argument -X as well, to get debug information:
...
[INFO] equinox-sdk ........................................ SKIPPED
[INFO] org.eclipse.rcp.id ................................. SKIPPED
[INFO] org.eclipse.rcp.sdk.id ............................. SKIPPED
[INFO] org.eclipse.platform.ide ........................... SKIPPED
[INFO] org.eclipse.platform.sdk ........................... SKIPPED
[INFO] org.eclipse.sdk.ide ................................ SKIPPED
[INFO] eclipse-junit-tests ................................ SKIPPED
[INFO] eclipse.platform.repository ........................ SKIPPED
[INFO] platform-aggregator ................................ SKIPPED
[INFO] -----------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] -----------------------------------------------------------------------
[INFO] Total time: 23:54 min
[INFO] Finished at: 2016-06-19T18:12:14+02:00
[INFO] Final Memory: 668M/3263M
[INFO] -----------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8: run (natives) on project org.eclipse.swt.win32.win32.x86_64: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915: The following error occurred while executing this line:
[ERROR] C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
[ERROR] around Ant part ...<ant antfile="build.xml" target="build_libraries"/>... # 4:54 in C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:
run (natives) on project org.eclipse.swt.win32.win32.x86_64:
An Ant BuildException has occured:
The following error occurred while executing this line:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915: The following error occurred while executing this line:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1 around Ant part ...<ant antfile="build.xml" target="build_libraries"/>... # 4:54 in C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by:
org.apache.maven.plugin.MojoExecutionException:
An Ant BuildException has occured:
The following error occurred while executing this line:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915:
The following error occurred while executing this line:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1 around Ant part ...<ant antfile="build.xml" target="build_libraries"/>... # 4:54 in C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:342)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default BuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
:4: The following error occurred while executing this line:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml
:915:The following error occurred while executing this line:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:568)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:443)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:313)
... 22 more
Caused by: C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml
:915: The following error occurred while executing this line:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:568)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:443)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
... 33 more
Caused by: C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
... 46 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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.eclipse.swt.win32.win32.x86_64
I still have no answer, so I started a bounty. Please reproduce step 1 until step 5 on your machine (with the -Dnative=win32.win32.x86_64 argument added to the fourth step). Do you achieve a successful build of the Eclipse IDE for just one OS target (preferably Windows 64-bit)? Does the build go faster - compared to the general build process that targets all OS's?
PS: I've got some other questions related to the Eclipse "Build from scratch" topic. If you're interested:
Building Eclipse IDE from scratch - how to choose CDT over JDT?
Building Eclipse IDE from scratch - how to specify the target OS?
Building Eclipse IDE from scratch - making bigger icons sometimes successful
Let us all unite to build the Eclipse IDE ourselves - and tweak it to our needs ;-)
EDIT :
Mr/Mss. Zapl wrote an interesting comment. He/She thinks that the -Dnative argument is not correct, after he/she read the following link:
http://comments.gmane.org/gmane.comp.ide.eclipse.cbi.devel/896
Hopefully we'll get closer to the answer now :-)
FINAL EDIT :
Suddenly this question catched the attention of the community. I got a lot of suggestions/answers in a short time. I cannot verify every single one of them right now because the build procedure takes about 2 hours.
I have 19 hours left to award the 50 points bounty. Please let me know if you successfully reproduced the STEPS 1..5 from this question on your own machine, and succeeded to build the Eclipse IDE from scratch for one specific OS. I will award you the bonus :-)
This snippet is taken from a working pom.xml that exports to win32.win32.x86_64.
Maybe some parts are not required for your project but it may be a good starting point to add this to your pom file.
..
..
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.20.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>0.20.0</version>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>0.20.0</version>
<configuration>
<compilerArgument>-err:-forbidden</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
..
..
EDIT
As mentioned in the comments I followed your steps and had some problems. I solved most of them now. If someone else also gets a lot of errors here are some solutions.
In the file eclipse.pde.ui/pom.xml line 19: the version was 4.6.0-SNAPSHOT, but has to be 4.7.0-SNAPSHOT
Hint: To speed up the build you can add e.g. "-T 4" to the mvn command to enable parallel builds. I finally ended with >mvn clean verify -DSkipTests -T 4 -Dnative=win32.win32.x86_64
After this fix I was able to run until I got the same errors mentioned in the initial question.
I went to the project folder \eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64 and started an Ant build (Apache Ant version 1.9.7) and it finished without errors. But I got the same errors when it was executed by the Maven build.
Thus, I checked lines 915 and 1012 of the file \eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml. After setting failonerror="false" (is set to "true" by default) in both lines I was able to continue with the build. I assess this as a very poor solution and it should not be the final solution for a problem to disable such tests.
Finally, I ended with errors in project org.eclipse.pde.build.tests and stopped following the problems.
The whole project seems to be misconfigured in many parts and I could not find a better solution so far. People should remember the golden rule not to commit anything that breaks the build to avoid such problems. Maybe the problems will be solved after a few updates to the repo.
There are multiple projects that are built here
SWT natives. (-Dnative=)
IDE. (platform independent)
SWT natives are built(by SWT team) every day at 19:00 EST/EDT everyday and pushed to eclipse.platform.swt.binaries.git repo. This build requires a quite a bit of dependencies like visual studio, xulrunner, WebKit, etc. For trying out a build I don't suggest you to attempt this .
CBI(Common Build Infrastructure) does the eclipse plugin builds and signing and packaging. This process is platform independent.
CBI build starts at 20:00 EST/EDT daily and the swt.binaries are picked up only during packaging. The packaging would probably takes about 5 minutes in the whole process. So I am not expecting much difference if you specify only 1 target to build.
To targeting just one single OS you have to specify the target environment in the parent pom.xml file (see Tycho - Target runtime environment):
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environments>
</configuration>
</plugin>
If you use PDE Build instead of Maven/Tycho the Ant property is configs, e.g, -Dconfigs="win32, win32, x86".
FYI: Eclipse Platform CI which generates the Eclipse SDK archives
From https://wiki.eclipse.org/Platform-releng/Platform_Build#Building_natives
Optionally, you can pass -Dnative= parameter with one of the following options to compile the natives for the specified native.
cocoa.macosx.x86
cocoa.macosx.x86_64
gtk.linux.x86
gtk.linux.x86_64
win32.win32.x86
win32.win32.x86_64
win32.wce_ppc.arm
The arg would be -Dnative=win32.win32.x86_64

How to fix the maven check style error

Currently I just tried to download and build to make the Netty source code work. But when I tried to run the command mvn eclipse:eclipse in the source folder. I got an error said
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.10:check (check-style) on project netty-common: Failed during checkstyle execu
tion: There are 304 checkstyle errors. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.10:check (check-style) on proj
ect netty-common: Failed during checkstyle execution
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.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:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed during checkstyle execution
at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:374)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 24 more
Caused by: org.apache.maven.plugin.checkstyle.CheckstyleExecutorException: There are 304 checkstyle errors.
at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:218)
at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:365)
It is error of the checkstyle plugin when validating the code netty-common project.
I am not familiar with this plugin . I want to know if I can just ignore it by removing the configuration from the pom.xml(in the ). like below.
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>check-style</id>
<goals>
<goal>check</goal>
</goals>
<phase>validate</phase>
<configuration>
<consoleOutput>true</consoleOutput>
<logViolationsToConsole>true</logViolationsToConsole>
<failsOnError>true</failsOnError>
<failOnViolation>true</failOnViolation>
<configLocation>io/netty/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-build</artifactId>
<version>21</version>
</dependency>
</dependencies>
</plugin>
Any idea ? Thanks.
Skip the check style execution using
-Dcheckstyle.skip
Ex
mvn [YOUR_COMMAND] -Dcheckstyle.skip
CheckStyle is a module of maven that check the style of the code for things like tabs instead of spaces. Netty is using this to prevent basic formatting mistakes.
If you are planning to contribute to Netty, you should NOT remove the plugin as it probably means your patch will never applied.
If you are just using to play with, you are free to remove that plugin as its only purpose is to verify the installation, and not to change things from the installation.
If you choose to keep it, you should look in the output log to see what the mistakes are it detected, to quickly fix the mistakes, see this answer by Matthew Farwell.
Right click on the java file in Package Explorer or whatever, and select 'Apply Checkstyle Corrections'.
Click on the error in the problems view, and select 'Quick fix'. This corrects the problem.
Whereas I am neither familiar with Netty nor the maven eclipse plugin, I did face an issue with the maven-checkstyle-plugin while building the pwm project.
This was the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (validate) on project pwm: Failed during checkstyle configuration ....
My Solution (which also solves many maven related errors btw):
Delete the maven's .m2 folder, then build the project again.
On linux systems, the .m2 folder is usually in your home folder /home/<username>/.m2
If you've just cloned the repository and the build failed, I believe you are using Windows and you have a problem with your Git configuration. Please set the 'core.autocrlf' option to 'true', re-clone the repository, and try again.
git config --global core.autocrlf true
I faced the same issue and I disabled checkstyle from pom, by adding the following in my pom file and it worked for me.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<id>checkstyle-validation</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
On Linux OS I solved using dos2unix.
cd presto;
find . -type f -exec dos2unix {} \;
Just do "mvn spotless:apply", worked for me
In my case I just tried to execute same goal but with -X option (enabling debug level) and found what class check style plugin is complaining about. Corrected style and run maven again -> Build success.
Best approach to fix this issues by running the mvn install with -X option it will give you detail about the style issues in class. You can fix the class accordingly.
I solved this problem by removing the check-style configuration in my pom.xml and rebuilding maven. When I later re-inserted and build, it worked without error.

Resolve workspace artifacts option in Eclipse generates error when one of the resolving projects is opened

I have a maven project A, with 4 submodules. I have another maven project B, without any submodules. One of the 4 submodules of A, references project B.
When I do clean install on project A, I receive an error message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project dca-web: Failed to copy file for artifact [be.vlaanderen.dwse:dwse-doc-tools:jar:3.2.2:compile]: /Users/Fabrizio/ontwikkeling/projecten/doc-tools/target/classes (Is a directory)
When enabling debug information: it is clear what is the issue:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project dca-web: Failed to copy file for artifact [be.vlaanderen.dwse:dwse-doc-tools:jar:3.2.2:compile]: /Users/Fabrizio/ontwikkeling/projecten/doc-tools/target/classes (Is a directory) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project dca-web: Failed to copy file for artifact [be.vlaanderen.dwse:dwse-doc-tools:jar:3.2.2:compile]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java: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.MojoExecutionException: Failed to copy file for artifact [be.vlaanderen.dwse:dwse-doc-tools:jar:3.2.2:compile]
at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:131)
at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleArtifacts(WarProjectPackagingTask.java:190)
at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:109)
at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:215)
at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:177)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.FileNotFoundException: /Users/Fabrizio/ontwikkeling/projecten/doc-tools/target/classes (Is a directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:138)
at org.codehaus.plexus.util.io.FileInputStreamFacade.getInputStream(FileInputStreamFacade.java:36)
at org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1141)
at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1048)
at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:293)
at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.registered(AbstractWarPackagingTask.java:150)
at org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappStructure.java:211)
at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:145)
at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:106)
But the folder target/classes is a directory! So there is a bug somewhere in one of the maven plugins I guess...
When I close project B, there is no problem. So opening the referenced project creates an issue...
I need to have project B open, because I use project A as a web application in Tomcat. When I have project B open and i change a file and save it, Eclipse does an incremental publish, and therefore Tomcat doesn't need to redeploy or restart! This saves me for each file change like 30 seconds! So it is very important to keep this project open...
I found the solution. Apparently eclipse luna (or any eclipse luna based ide) is using an embedded version of maven, which in turn uses the maven-war-plugin version 2.2. After adding in my pom the version 2.6, it solved the issue!
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec

I needed to build Cloudstack from source and followed this article in the documentation. But everytime I built it with maven, I got stuck with following error. Guessing as a solution, I tried this build with oracle jdk-8, openjdk-7 and openjdk6. And also tried tomcat6 and tomcat8. But got no solution. What is going wrong? I think the reason could be a problem with a plugin but have no idea how to solve. I searched online for this error, but got no workaround.
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (compile) on project cloud-apidoc: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (compile) on project cloud-apidoc: Command execution failed.
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: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.MojoExecutionException: Command execution failed.
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:362)
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.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:610)
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:352)
... 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cloud-apidoc
Thank you.
The latest version of cloudstack can be found from cloudstack downloads page
Do a git checkout to that version branch and then follow the developer guide you mentioned.
If version is x.y.z, the branch name would usually be x.y
The developer guide is specifically written for 4.2. You may have to adjust the java packages version according to cloudstack version.
make sure the right java versions are installed by doing
java -version and javac -version
cloudstack requires java 1.6 till 4.3 and java 1.7 for 4.4 and above
You should be using the 4.2 tag build since you followed the mentioned tutorial, I have run into a similar issue with that tag version and ended up upgrading to an onward version to resolve the case.
CloudStack has already release the 4.4 version which should resolve you problem, so you may need to update your sources to that tag and retry you build which should work without problems:
$ git fetch origin && git checkout -b 4.4.0 tags/4.4.0
$ mvn clean install -Pdeveloper,systemvm

maven fails to resolve dependency

I have multi module maven project.When I try to build site, e.g. execute maven site on parent project it fails to resolve dependency to one of modules.
But if I just compile (mvn clean compile on parent project) it or run tests (mvn clean test on parent project) there are no dependency problems.
What could cause such behaviour?
UPD
Maven version
Apache Maven 3.0.2 (r1056850; 2011-01-09 02:58:10+0200)
Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
Java home: c:\Program Files\Java\jdk1.6.0_26\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
maven-site-plugin version
[DEBUG] Included: org.apache.maven.plugins:maven-site-plugin:jar:2.0.1
Error message
[ERROR] Failed to execute goal on project myproj-client: Could not resolve dependencies for project mycompany.myproj:myproj-client:jar:0.0.1-SNAPSHOT: Could not find artifact mycompany.myproj:myproj-common:jar:0.0.1-SNAPSHOT -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project myproj-client: Could not resolve dependencies for project mycompany.myproj:myproj-client:jar:0.0.1-SNAPSHOT: Could not find artifact mycompany.myproj:myproj-common:jar:0.0.1-SNAPSHOT
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:190)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:104)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
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:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
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.project.DependencyResolutionException: Could not resolve dependencies for project mycompany.myproj:myproj-client:jar:0.0.1-SNAPSHOT: Could not find artifact mycompany.myproj:myproj-common:jar:0.0.1-SNAPSHOT
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:156)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:165)
... 22 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact mycompany.myproj:myproj-common:jar:0.0.1-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:526)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifacts(DefaultRepositorySystem.java:304)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:334)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:150)
... 23 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact mycompany.myproj:myproj-common:jar:0.0.1-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:517)
... 26 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/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :myproj-client
I have the same problem. I didn't dig into Maven's source code too much. But here is my observation.
Supposed that you never mvn install myproj-common in your local repository, neither deployed it onto any remote repositories. When you run mvn clean site on the parent project, things happen like this:
maven determines the order of myproj-common is before
myproj-client according to their dependency relationship
mvn clean site is run on myproj-common. All previous result in myproj-common/target are deleted and myproj-common/target/site is
generated. (Note that after this step, neither compiled classes nor packaged jar exists in myproj-common/target)
mvn clean site is run on myproj-client. Maven first checks the
dependency of this project, and tries to find myproj-common's
artifact (classes or jar) in these places: (a) myproj-common/target (b) local repository (3) remote repositories.
mvn site fails on myproj-client, since it cannot find the artifact of myproj-common
This explains why mvn clean compile site and mvn clean package site works. They both would have prepared myproj-common artifacts in its target directory before mvn site runs on myproj-client.
And mvn install followed by mvn site works also.
A special exception is that if you put something like emma-maven-plugin in reporting, it will automatically compile and instrument classes. In this case, mvn clean site always works.
I am not sure why Maven tries to find myproj-common's jar in step 3, it seems to have nothing to do with mvn site. The exception happens quite early in maven core, before getting into maven-site-plugin. It looks not like a problem of maven-site-plugin but a common behavior of all maven lifecycles (except clean I believe).
i was facing the same but for struts and paypal_base dependecies, i fixed by doing following.
i checked, and found that jar files didn't exists in appropriate folder in maven repository(.m2/reposotory....).
I have installed that jar files via following mvn command
mvn install:install-file -Dfile=C:\Dependencies\paypal_base.jar \
-DgroupId=paypal -DartifactId=paypal_base -Dversion=0.1 \
-Dpackaging=jar
and
mvn install:install-file -Dfile=C:\Dependencies\struts.jar \
-DgroupId=struts -DartifactId=struts -Dversion=0.1 \
-Dpackaging=jar
(-DFile is the location of jar file in you system)
Rebuild the project by Maven.
My Project was successful build.
you must check the jar, and use above instruction is jar not exist.
may be this will helpful.
This might be an issue with the site plugin not having access to the reactor, and thus not seeing that the project artifact is available in your project sources. (This is merely a hypothesis, perhaps supported by MSITE-302.)
Try running first mvn install, which installs your artifacts in the local repository, and then running mvn site.
For more information on the reactor, try:
http://maven.apache.org/guides/mini/guide-multiple-modules.html
What is the "reactor" in Maven?
Heh, for some reason, after I made some changes to module and parent pom files, problem vanished. I don't know exactly what was done, but currently mvn site on parent project is working normally. Unfortunately I have no time to investigate what is the roots of the problem. But it seems that changing site version to 3.0 put me on the right way. Also I could execute site (before it was fixed) in the following way mvn compile site, in this case it could find dependency.
It looks like maven is looking for myproj-common:jar:0.0.1-SNAPSHOT in the repository.
The reason for failure could be:
maven is not able to access the snapshot artifacts in the repository.
To enable snapshot artifacts:
please check you pom.xml for snapshots tag under the repository section.
<repository>
<name>xyz</name>
<id>repoid</id>
<url>http://x.y.z</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

Categories

Resources