core/src/main/java/io/fabric8/maven/core/util/ProfileUtil.java
public static Profile lookup(String name, File directory) throws IOException {
        // First check from the classpath, these profiles are used as a basis
        List<Profile> profiles = readProfileFromClasspath(name);

        File profileFile = findProfileYaml(directory);
        if (profileFile != null) {
            List<Profile> fileProfiles = fromYaml(new FileInputStream(profileFile));
            for (Profile profile : fileProfiles) {
                if (profile.getName().equals(name)) {
                    profiles.add(profile);
                    break;
                }
            }
        }
        // "larger" orders are "earlier" in the list
        Collections.sort(profiles, Collections.<Profile>reverseOrder());
        return mergeProfiles(profiles);
    }
public static Profile lookup(String name, File directory) throws IOException {
        // First check from the classpath, these profiles are used as a basis
        List<Profile> profiles = readProfileFromClasspath(name);

        File profileFile = findProfileYaml(directory);
        if (profileFile != null) {
            List<Profile> fileProfiles = fromYaml(new FileInputStream(profileFile));
            for (Profile profile : fileProfiles) {
                if (profile.getName().equals(name)) {
                    profiles.add(profile);
                    break;
                }
            }
        }
        // "larger" orders are "earlier" in the list
        Collections.sort(profiles, Collections.<Profile>reverseOrder());
        return mergeProfiles(profiles);
    }
public static Profile lookup ( String name , File directory ) throws IOException { // First check from the classpath, these profiles are used as a basis List < Profile > profiles = readProfileFromClasspath ( name ) ; File profileFile = findProfileYaml ( directory ) ; if ( profileFile != null ) { List < Profile > fileProfiles = fromYaml ( new FileInputStream ( profileFile ) ) ; for ( Profile profile : fileProfiles ) { if ( profile . getName ( ) . equals ( name ) ) { profiles . add ( profile ) ; break ; } } } // "larger" orders are "earlier" in the list Collections . sort ( profiles , Collections . < Profile > reverseOrder ( ) ) ; return mergeProfiles ( profiles ) ; }
Lookup profiles from a given directory and merge it with a profile of the
same name found in the classpath

@param name name of the profile to lookup
@param directory directory to lookup
@return Profile found or null
@throws IOException if somethings fails during lookup
Lookup profiles from a given directory and merge it with a profile of the same name found in the classpath