Parsing a Maven POM III

Due to popular demand I moved the latest code for parsing a Maven POM (including it’s parent POMs) into a tiny Github Project:

https://github.com/fuinorg/utils4maven

Here is a short example how to use it:

// Reading the model loads everything from remote
// repository using JBoss Shrinkwrap Resolver!
Model model = MavenPomReader.readModel("org.fuin:objects4j:0.6.1");
System.out.println(model.getName());
// Should print 'Objects4J'

A full example can be found here: MavenPomReaderTest.java

Advertisement

2 thoughts on “Parsing a Maven POM III

  1. The code on github seems to have an error. The code calls “Utils4J.replaceVars()”:
    Utils4J.replaceVars(version, model.getProperties() // Params: String, Properties
    Utils4J.replaceVars(pomXml, vars) // Params: String, Map

    Although the Utils4J class includes a method with that name, its signature doesn’t match either of the above.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s