Question

I have recently started exploring Maven, but I feel a bit overwhelmed of all xml configuration in all the pom files. Are there any good tools i can use?

Was it helpful?

Solution

m2eclipse, it provides a very nice form-based editor. But I only use the XML view most of the time.

OTHER TIPS

This tip works with any good XML editor.

By far the best guide you can have is the XML schema (the 'XSD' file), which defines all the structures and what they do.

At the top of your POM, ensure the 'project' element is defined like this:

<project
  xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

Now when you edit the file in any good editor (including jEdit or Eclipse) the editor will actually download the .xsd file from the URL above and use it to guide you and validate the POM.

e.g. in Eclipse, go somewhere in the POM and hit Ctrl-Space - it will bring up a list of valid elements for the current position.

When I edit any XML files, I use vim with the xmledit plugin.

Another good tool for XML editing is XMLmind XML editor. It's free for non-commercial use. It supports validating XML with W3C XML Schema (and other schema formats), so you can be sure to produce valid POM format.

You'll get used to it. Maven configuration files can be really short if you wanted to. You only need to have something in the pom.xml to override the default value.

If you stick to the default Maven directory structure, you won't need a long Maven at all.

If you are stuck with Maven, then you will simply need to read their documentation, Google like crazy for what is not documented, and experiment. Obviously, any editor capable of handling XML is suitable, and your preferences should dominate the choice.

On the other hand, if you are not stuck with Maven, then I HIGHLY recommend that you jump ship. I have used Maven for several years, along with many other build tools, and Maven is the worst: it is too complicated, it is obtuse, it is VERY hard to customize or extend, and it is slower. So, switch to something else.

I recommend Ant+Ivy or a Python-based solution.

I don't. I use buildr, which has a lot more compact ruby based syntax to describe your project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top