Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] Best way to mavenize non-maven Eclipse Java project? Problems converting old m2e projects to new ones.

I had a Java Project in Eclipse that was initially not set up as a Maven project. However, I always wanted to Mavenize it, and took some steps, such as putting source in src/main/java, resources in src/main/resources, etc.

Now I wanted to Mavenize it. What was the way? I tried copying a bunch of stuff from existing Maven projects but I was getting uneven results in achieving expected behavior. Eventually, I discovered

Configure-->Convert To Maven Project

Problem solved.  Nice improvement.



However, Along the way, I discovered that some of my previous Maven projects were not behaving right in Eclipse. Changes weren't immediately sparking builds as they had before. I discovered that these projects, too, were offering me the choice of converting them to maven projects. I trace this back to last week when I installed the latest version of m2e (1.0.100.20110804-1717).

I tried converting the projects.

In all cases, m2e ADDED new elements to the .project and .classpath files, analogous to previous elements. For example, in .project:

<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>

<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>

and

<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>

and in .classpath:

<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/> <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>


It was pretty easy to figure out that the org.eclipse.m2e entries were the new ones and the org.maven.ide ones were the old ones and remove them. Not sure if these were doing any harm, but it seems to me that the conversion process should have been smart enough to remove them for me.

More serious, however, one problem I can't solve:

Two projects with this plugin

<plugin>
	<groupId>org.apache.cxf</groupId>
	<artifactId>cxf-codegen-plugin</artifactId>
	<version>2.2.5</version>
...

	<goals>
		<goal>wsdl2java</goal>
	</goals>

no longer work in Eclipse, failing with this error.

Plugin execution not covered by lifecycle configuration: org.apache.cxf:cxf-codegen-plugin:2.2.5:wsdl2java (execution: generate-sources, phase: generate-sources) ... Maven Project Build Lifecycle Mapping Problem

This was not a problem with the older m2e.

How do I fix this?






Back to the top