code: 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;
  	}
docs: Check whether a module exists in a POM.
  
  @param rootPOM
  @param relative
  @param log
  @return
  @throws XmlPullParserException
  @throws IOException