Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Maven Java project with custom packaging not imported properly

Eclipse wiki [1] explains how to setup m2e development environment.

By default java builder is only enabled for projects that use
maven-compiler-plugin with compilerId=javac. If
sbt-compiler-maven-plugin configuration parameters are compatible with
maven-compiler-plugin, you should be able to use m2e standard java
configurator [2]. You will have to write your own configurator if
parameters are different.

As explained in wiki [3], most maven plugins require use BuildContext in
order participate in eclipse incremental and configuration builds. This
is not enforced by m2e, but you are running risk of endless workspace
builds and/or generated files go missing unless all filesystem changes
go through BuildContext.

[1] http://wiki.eclipse.org/M2E_Development_Environment
[2] http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.jdt/lifecycle-mapping-metadata.xml
[3] https://wiki.eclipse.org/M2E_compatible_maven_plugins

--
Regards,
Igor

On 12/2/2013, 2:38, Grzegorz Słowikowski wrote:
Hi

I'm new to M2Eclipse integration, I'm adding it to my Maven plugins now.
Some of them define custom packagings and I have problem with one of them.

My plugin [1] defines custom packaging "play2" [2] producing Java "jar"
file.
M2Eclipse lifecycle mapping metadata definition file is here [3].

When importing Maven project using "play2" packaging everything seems to
work: source generators
work, there is nothing in Eclipse workspace log, but after import there
is only ".project" file
with "maven2Builder" and "maven2Nature". No "javabuilder" and
"javanature" in ".project" file
and no ".classpath" file at all.

Is there possibility to debug M2Eclipse import process?

Current version 1.0.0-alpha6-SNAPSHOT deployed to Nexus Snapshot
repository so you can reproduce my problems.
Try importing of any of test projects [4], for example [5].

I have similar Maven plugin with "play" (without "2" suffix) packaging
[6] and with that plugin everything works as expected
(you can check with any of test projects [7], for example [8]).

[1] http://play2-maven-plugin.googlecode.com/svn/trunk/plugin
[2]
http://play2-maven-plugin.googlecode.com/svn/trunk/plugin/play2-maven-plugin/src/main/resources/META-INF/plexus/components.xml
[3]
http://play2-maven-plugin.googlecode.com/svn/trunk/plugin/play2-maven-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml
[4] http://play2-maven-plugin.googlecode.com/svn/trunk/test-projects/
[5]
http://play2-maven-plugin.googlecode.com/svn/trunk/test-projects/play21/java/helloworld/

[6]
http://maven-play-plugin.googlecode.com/svn/trunk/plugin/play-maven-plugin/
[7] http://maven-play-plugin.googlecode.com/svn/trunk/test-projects/
[8]
http://maven-play-plugin.googlecode.com/svn/trunk/test-projects/findbugs/

Regards
Grzegorz Slowikowski

_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev



Back to the top