public void execute()

in core-it-support/core-it-plugins/maven-it-plugin-class-loader/maven-it-plugin-class-loader/src/main/java/org/apache/maven/plugin/coreit/AssignmentCompatibleMojo.java [57:98]


    public void execute() throws MojoExecutionException {
        ClassLoader coreRealm = Mojo.class.getClassLoader();
        ClassLoader pluginRealm = getClass().getClassLoader();

        if (coreRealm == pluginRealm) {
            throw new MojoExecutionException("Unexpected class loader hierarchy, could not detect core realm");
        }

        Properties properties = new Properties();

        if (classNames != null) {
            for (String className : classNames) {
                String result;

                getLog().info("[MAVEN-CORE-IT-LOG] Loading class " + className);

                try {
                    Class type = pluginRealm.loadClass(className);
                    result = getKey(type);
                } catch (ClassNotFoundException e) {
                    result = "";
                }
                properties.setProperty("plugin." + className, result);
                getLog().info("[MAVEN-CORE-IT-LOG]   plugin: " + result);

                try {
                    Class type = coreRealm.loadClass(className);
                    result = getKey(type);
                } catch (ClassNotFoundException e) {
                    result = "";
                }
                properties.setProperty("core." + className, result);
                getLog().info("[MAVEN-CORE-IT-LOG]   core  : " + result);
            }
        }

        getLog().info("[MAVEN-CORE-IT-LOG] Creating output file " + assigncompatPropertiesFile);

        PropertiesUtil.write(assigncompatPropertiesFile, properties);

        getLog().info("[MAVEN-CORE-IT-LOG] Created output file " + assigncompatPropertiesFile);
    }