bw-maven-plugin/src/main/java/fr/fastconnect/factory/tibco/bw/maven/source/POMManager.java
public static boolean moduleExists(File pom, String relativePath, String profileId, Log logger) throws IOException, XmlPullParserException {
		if (relativePath == null) return false;

		Model model = getModelFromPOM(pom, logger);
		
		relativePath = relativePath.replace("\\", "/");

		if (profileId != null && !profileId.isEmpty()) {
			Profile p = getProfile(model, profileId);
			if (p != null) {
				return p.getModules().indexOf(relativePath) >= 0;
			}
		} else {
			return model.getModules().indexOf(relativePath) >= 0;
		}

		return false;
	}
public static boolean moduleExists(File pom, String relativePath, String profileId, Log logger) throws IOException, XmlPullParserException {
		if (relativePath == null) return false;

		Model model = getModelFromPOM(pom, logger);
		
		relativePath = relativePath.replace("\\", "/");

		if (profileId != null && !profileId.isEmpty()) {
			Profile p = getProfile(model, profileId);
			if (p != null) {
				return p.getModules().indexOf(relativePath) >= 0;
			}
		} else {
			return model.getModules().indexOf(relativePath) >= 0;
		}

		return false;
	}
Check whether a module exists in a POM.

@param rootPOM
@param relative
@param log
@return
@throws XmlPullParserException
@throws IOException