So my question is: right now and for the foreseeable future, is it worth migrating to Maven if we are doing all the development in Eclipse and working mainly on skinny EAR projects? Is there anything in the future of Maven that will make it handle EAR in a more robust and integrated way?
Story: No, until M2Eclipse breaks.
Long story:
I would currently recommend against it, at least in Eclipse. When writing the M2Eclipse plugin, there was and always has been a very unpleasant error in which it generates its own version of the application.xml descriptor file, and does not use the one that Maven would otherwise create.
Unfortunately, this specially created application.xml file is completely wrong: it ignores finalNames, has an explicitly hard-coded lib / prefix, and for some reason assigns the EJB JAR extension ".ejb". To make matters worse, you cannot uninstall it to be replaced with a version of Maven, as it continues to be restored using M2Eclipse.
Maven will only generate application.xml if it is not already installed. As the created WTP / M2Eclipse application.xml continues to be restored, Maven application.xml does not get a chance.
However, there is a workaround to solve this problem: you can tell Maven to ignore application.xml during packaging so that it considers that application.xml does not exist, in which case it will still generate its own version. Thus, the incorrectly generated application.xml file does not matter. For future reference:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.3.2</version> <configuration> <version>5</version> <earSourceExcludes>**/application.xml</earSourceExcludes> <generateApplicationXml>true</generateApplicationXml> </configuration> </plugin>
One of the main problems is that the Ant script used to deploy to GlassFish in Eclipse generates its own separate EAR for deployment and uses the application.xml created by M2Eclipse for this. This means that the created EARs will always fail if the M2Eclipse plugin remains broken. There are error messages for this in the JIRA code; they cannot get access to them right now.
YMMV for other application servers, but get ready for a tough game with application.xml.