bw-maven-plugin/src/main/java/fr/fastconnect/factory/tibco/bw/maven/source/POMManager.java
public static Model mergeModelFromPOM(File pom, Model existingModel, Log logger) throws IOException, XmlPullParserException {
		if (pom == null || !pom.exists() || existingModel == null || logger == null) return null;

		Model model = null;
		FileInputStream fis = null;
		InputStreamReader isr = null;
		try {
			fis = new FileInputStream(pom);
			isr = new InputStreamReader(fis, "utf-8"); // FIXME
			MavenXpp3Reader reader = new MavenXpp3Reader();
			model = reader.read(isr);
			DefaultInheritanceAssembler assembler = new DefaultInheritanceAssembler();
			assembler.assembleModelInheritance(model, existingModel, null, null);
		} finally {
			try {
				isr.close();
				fis.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		return model;
	}
public static Model mergeModelFromPOM(File pom, Model existingModel, Log logger) throws IOException, XmlPullParserException {
		if (pom == null || !pom.exists() || existingModel == null || logger == null) return null;

		Model model = null;
		FileInputStream fis = null;
		InputStreamReader isr = null;
		try {
			fis = new FileInputStream(pom);
			isr = new InputStreamReader(fis, "utf-8"); // FIXME
			MavenXpp3Reader reader = new MavenXpp3Reader();
			model = reader.read(isr);
			DefaultInheritanceAssembler assembler = new DefaultInheritanceAssembler();
			assembler.assembleModelInheritance(model, existingModel, null, null);
		} finally {
			try {
				isr.close();
				fis.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		return model;
	}
public static Model mergeModelFromPOM ( File pom , Model existingModel , Log logger ) throws IOException , XmlPullParserException { if ( pom == null || ! pom . exists ( ) || existingModel == null || logger == null ) return null ; Model model = null ; FileInputStream fis = null ; InputStreamReader isr = null ; try { fis = new FileInputStream ( pom ) ; isr = new InputStreamReader ( fis , "utf-8" ) ; // FIXME MavenXpp3Reader reader = new MavenXpp3Reader ( ) ; model = reader . read ( isr ) ; DefaultInheritanceAssembler assembler = new DefaultInheritanceAssembler ( ) ; assembler . assembleModelInheritance ( model , existingModel , null , null ) ; } finally { try { isr . close ( ) ; fis . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return model ; }
Merge a Maven {@link Model} object from a POM file to an existing Maven
{@link Model} object.

@param pom
@param existingModel
@param logger
@return the existing model merged with the parsed model from the POM file
@throws XmlPullParserException
@throws IOException
Merge a Maven { @link Model } object from a POM file to an existing Maven { @link Model } object .