// Path: srcdeps-maven-base/src/main/java/org/srcdeps/mvn/config/ConfigurationProducer.java
// @Named
// public class ConfigurationProducer {
// 
//     private final Configuration configuration;
//     private final Path multimoduleProjectRootDirectory;
// 
//     public ConfigurationProducer() throws ConfigurationException {
//         super();
// 
//         String basePathString = System.getProperty(Constants.MAVEN_MULTI_MODULE_PROJECT_DIRECTORY_PROPERTY);
//         if (basePathString == null || basePathString.isEmpty()) {
//             throw new RuntimeException(String.format("The system property %s must not be null or empty",
//                     Constants.MAVEN_MULTI_MODULE_PROJECT_DIRECTORY_PROPERTY));
//         }
//         multimoduleProjectRootDirectory = Paths.get(basePathString).toAbsolutePath();
// 
//         this.configuration = new ConfigurationLocator(System.getProperties(), true) //
//                 .locate(multimoduleProjectRootDirectory, new YamlConfigurationReader()) //
//                 .accept(new OverrideVisitor(System.getProperties())) //
//                 .accept(new DefaultsAndInheritanceVisitor()) //
//                 .forwardPropertyValue(Maven.getSrcdepsMavenVersionProperty(), Constants.SRCDEPS_MAVEN_VERSION)
//                 .build();
// 
//     }
// 
//     public Configuration getConfiguration() {
//         return configuration;
//     }
// 
//     /**
//      * @return the root directory of the Maven multimodule project.
//      */
//     public Path getMultimoduleProjectRootDirectory() {
//         return multimoduleProjectRootDirectory;
//     }
// 
// }


import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.ProjectExecutionEvent;
import org.apache.maven.execution.ProjectExecutionListener;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Profile;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.project.MavenProject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.srcdeps.core.SrcVersion;
import org.srcdeps.core.config.Maven;
import org.srcdeps.core.config.MavenAssertions;
import org.srcdeps.mvn.config.ConfigurationProducer;
        for (Entry<Object, Object> prop : properties.entrySet()) {
            final String key = prop.getKey().toString();
            failWithoutProperties.remove(key);
            final Object val = prop.getValue();
            if (val != null) {
                failWithoutProperties.remove(key + "=" + val.toString());
            }
        }
        if (!failWithoutProperties.isEmpty()) {
            return new String[] { "properties missing", failWithoutProperties.toString() };
        }

        return null;
    }

    private static void assertNotSrcdeps(List<Dependency> deps, String[] violation) throws LifecycleExecutionException {
        for (Dependency dep : deps) {
            assertNotSrcdeps(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), violation);
        }
    }

    private static void assertNotSrcdeps(String group, String artifact, String version, String[] violation)
            throws LifecycleExecutionException {
        if (SrcVersion.isSrcVersion(version)) {
            throw new LifecycleExecutionException(String.format(
                    "This build was configured to fail if there is a source dependency [%s:%s:%s] and %s [%s]", group,
                    artifact, version, violation[0], violation[1]));
        }
    }

// Path: srcdeps-maven-base/src/main/java/org/srcdeps/mvn/config/ConfigurationProducer.java
// @Named
// public class ConfigurationProducer {
// 
//     private final Configuration configuration;
//     private final Path multimoduleProjectRootDirectory;
// 
//     public ConfigurationProducer() throws ConfigurationException {
//         super();
// 
//         String basePathString = System.getProperty(Constants.MAVEN_MULTI_MODULE_PROJECT_DIRECTORY_PROPERTY);
//         if (basePathString == null || basePathString.isEmpty()) {
//             throw new RuntimeException(String.format("The system property %s must not be null or empty",
//                     Constants.MAVEN_MULTI_MODULE_PROJECT_DIRECTORY_PROPERTY));
//         }
//         multimoduleProjectRootDirectory = Paths.get(basePathString).toAbsolutePath();
// 
//         this.configuration = new ConfigurationLocator(System.getProperties(), true) //
//                 .locate(multimoduleProjectRootDirectory, new YamlConfigurationReader()) //
//                 .accept(new OverrideVisitor(System.getProperties())) //
//                 .accept(new DefaultsAndInheritanceVisitor()) //
//                 .forwardPropertyValue(Maven.getSrcdepsMavenVersionProperty(), Constants.SRCDEPS_MAVEN_VERSION)
//                 .build();
// 
//     }
// 
//     public Configuration getConfiguration() {
//         return configuration;
//     }
// 
//     /**
//      * @return the root directory of the Maven multimodule project.
//      */
//     public Path getMultimoduleProjectRootDirectory() {
//         return multimoduleProjectRootDirectory;
//     }
// 
// }


// Path: srcdeps-maven-enforcer/src/main/java/org/srcdeps/mvn/enforcer/SrcdepsEnforcer.java
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.ProjectExecutionEvent;
import org.apache.maven.execution.ProjectExecutionListener;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Profile;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.project.MavenProject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.srcdeps.core.SrcVersion;
import org.srcdeps.core.config.Maven;
import org.srcdeps.core.config.MavenAssertions;
import org.srcdeps.mvn.config.ConfigurationProducer;

        for (Entry<Object, Object> prop : properties.entrySet()) {
            final String key = prop.getKey().toString();
            failWithoutProperties.remove(key);
            final Object val = prop.getValue();
            if (val != null) {
                failWithoutProperties.remove(key + "=" + val.toString());
            }
        }
        if (!failWithoutProperties.isEmpty()) {
            return new String[] { "properties missing", failWithoutProperties.toString() };
        }

        return null;
    }

    private static void assertNotSrcdeps(List<Dependency> deps, String[] violation) throws LifecycleExecutionException {
        for (Dependency dep : deps) {
            assertNotSrcdeps(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), violation);
        }
    }

    private static void assertNotSrcdeps(String group, String artifact, String version, String[] violation)
            throws LifecycleExecutionException {
        if (SrcVersion.isSrcVersion(version)) {
            throw new LifecycleExecutionException(String.format(
                    "This build was configured to fail if there is a source dependency [%s:%s:%s] and %s [%s]", group,
                    artifact, version, violation[0], violation[1]));
        }
    }

    private final ConfigurationProducer configurationProducer;