// Path: src/main/java/org/codehaus/mojo/enforcer/Dependency.java
// public class Dependency
// {
// 
//     private String groupId;
//     
//     private String artifactId;
//     
//     private String classifier;
//     
//     private String type;
//     
//     /**
//      * List of classes to ignore. Wildcard at the end accepted
//      */
//     private String[] ignoreClasses;
// 
//     /**
//      * <p>Getter for the field <code>groupId</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getGroupId()
//     {
//         return groupId;
//     }
// 
//     /**
//      * <p>Setter for the field <code>groupId</code>.</p>
//      *
//      * @param groupId a {@link java.lang.String} object.
//      */
//     public void setGroupId( String groupId )
//     {
//         this.groupId = groupId;
//     }
// 
//     /**
//      * <p>Getter for the field <code>artifactId</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getArtifactId()
//     {
//         return artifactId;
//     }
// 
//     /**
//      * <p>Setter for the field <code>artifactId</code>.</p>
//      *
//      * @param artifactId a {@link java.lang.String} object.
//      */
//     public void setArtifactId( String artifactId )
//     {
//         this.artifactId = artifactId;
//     }
// 
//     /**
//      * <p>Getter for the field <code>classifier</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getClassifier()
//     {
//         return classifier;
//     }
// 
//     /**
//      * <p>Setter for the field <code>classifier</code>.</p>
//      *
//      * @param classifier a {@link java.lang.String} object.
//      */
//     public void setClassifier( String classifier )
//     {
//         this.classifier = classifier;
//     }
// 
//     /**
//      * <p>Getter for the field <code>type</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getType()
//     {
//         return type;
//     }
// 
//     /**
//      * <p>Setter for the field <code>type</code>.</p>
//      *
//      * @param type a {@link java.lang.String} object.
//      */
//     public void setType( String type )
//     {
//         this.type = type;
//     }
// 
//     /**
//      * <p>Getter for the field <code>ignoreClasses</code>.</p>
//      *
//      * @return an array of {@link java.lang.String} objects.
//      */
//     public String[] getIgnoreClasses()
//     {
//         return ignoreClasses;
//     }
// 
//     /**
//      * <p>Setter for the field <code>ignoreClasses</code>.</p>
//      *
//      * @param ignoreClasses an array of {@link java.lang.String} objects.
//      */
//     public void setIgnoreClasses( String[] ignoreClasses )
//     {
//         this.ignoreClasses = ignoreClasses;
//     }
//     
//     /** {@inheritDoc} */
//     @Override
//     public String toString()
//     {
//         StringBuilder sb = new StringBuilder();
//         sb.append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( type );
//         if ( classifier != null )
//         {
//             sb.append( ':' ).append( classifier );
//         }
//         return sb.toString();
//     }
// }
// 
// Path: src/main/java/org/apache/maven/plugins/enforcer/JarUtils.java
// public static boolean isJarFile( Artifact artifact )
// {
//     return artifact.getFile().isFile() && "jar".equals( artifact.getType() );
// }


import java.util.jar.JarFile;
import java.util.regex.Pattern;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
import org.codehaus.mojo.enforcer.Dependency;
import org.codehaus.plexus.util.FileUtils;
import static org.apache.maven.plugins.enforcer.JarUtils.isJarFile;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.jar.JarEntry;
package org.apache.maven.plugins.enforcer;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */




/**
 * Bans duplicate classes on the classpath.
 */
public class BanDuplicateClasses
    extends AbstractResolveDependencies
{

    /**
     * Default ignores which are needed for JDK 9, cause in JDK 9 and above the <code>module-info.class</code> will be
     * duplicated in any jar file. Furthermore in use cases for multi release jars the <code>module-info.class</code> is
     * also contained several times.
     */
    private static final String[] DEFAULT_CLASSES_IGNORES = { "module-info", "META-INF/versions/*/module-info" };

    /**
     * The failure message
     */
    private String message;
    
    /**
     * List of classes to ignore. Wildcard at the end accepted
     */
    private String[] ignoreClasses;

    /**
     * If {@code false} then the rule will fail at the first duplicate, if {@code true} then the rule will fail at
     * the end.
     */
    private boolean findAllDuplicates;

    /**
     * List of dependencies for which you want to ignore specific classes.
     */
// Path: src/main/java/org/codehaus/mojo/enforcer/Dependency.java
// public class Dependency
// {
// 
//     private String groupId;
//     
//     private String artifactId;
//     
//     private String classifier;
//     
//     private String type;
//     
//     /**
//      * List of classes to ignore. Wildcard at the end accepted
//      */
//     private String[] ignoreClasses;
// 
//     /**
//      * <p>Getter for the field <code>groupId</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getGroupId()
//     {
//         return groupId;
//     }
// 
//     /**
//      * <p>Setter for the field <code>groupId</code>.</p>
//      *
//      * @param groupId a {@link java.lang.String} object.
//      */
//     public void setGroupId( String groupId )
//     {
//         this.groupId = groupId;
//     }
// 
//     /**
//      * <p>Getter for the field <code>artifactId</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getArtifactId()
//     {
//         return artifactId;
//     }
// 
//     /**
//      * <p>Setter for the field <code>artifactId</code>.</p>
//      *
//      * @param artifactId a {@link java.lang.String} object.
//      */
//     public void setArtifactId( String artifactId )
//     {
//         this.artifactId = artifactId;
//     }
// 
//     /**
//      * <p>Getter for the field <code>classifier</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getClassifier()
//     {
//         return classifier;
//     }
// 
//     /**
//      * <p>Setter for the field <code>classifier</code>.</p>
//      *
//      * @param classifier a {@link java.lang.String} object.
//      */
//     public void setClassifier( String classifier )
//     {
//         this.classifier = classifier;
//     }
// 
//     /**
//      * <p>Getter for the field <code>type</code>.</p>
//      *
//      * @return a {@link java.lang.String} object.
//      */
//     public String getType()
//     {
//         return type;
//     }
// 
//     /**
//      * <p>Setter for the field <code>type</code>.</p>
//      *
//      * @param type a {@link java.lang.String} object.
//      */
//     public void setType( String type )
//     {
//         this.type = type;
//     }
// 
//     /**
//      * <p>Getter for the field <code>ignoreClasses</code>.</p>
//      *
//      * @return an array of {@link java.lang.String} objects.
//      */
//     public String[] getIgnoreClasses()
//     {
//         return ignoreClasses;
//     }
// 
//     /**
//      * <p>Setter for the field <code>ignoreClasses</code>.</p>
//      *
//      * @param ignoreClasses an array of {@link java.lang.String} objects.
//      */
//     public void setIgnoreClasses( String[] ignoreClasses )
//     {
//         this.ignoreClasses = ignoreClasses;
//     }
//     
//     /** {@inheritDoc} */
//     @Override
//     public String toString()
//     {
//         StringBuilder sb = new StringBuilder();
//         sb.append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( type );
//         if ( classifier != null )
//         {
//             sb.append( ':' ).append( classifier );
//         }
//         return sb.toString();
//     }
// }
// 
// Path: src/main/java/org/apache/maven/plugins/enforcer/JarUtils.java
// public static boolean isJarFile( Artifact artifact )
// {
//     return artifact.getFile().isFile() && "jar".equals( artifact.getType() );
// }


// Path: src/main/java/org/apache/maven/plugins/enforcer/BanDuplicateClasses.java
import java.util.jar.JarFile;
import java.util.regex.Pattern;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
import org.codehaus.mojo.enforcer.Dependency;
import org.codehaus.plexus.util.FileUtils;
import static org.apache.maven.plugins.enforcer.JarUtils.isJarFile;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.jar.JarEntry;

package org.apache.maven.plugins.enforcer;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */




/**
 * Bans duplicate classes on the classpath.
 */
public class BanDuplicateClasses
    extends AbstractResolveDependencies
{

    /**
     * Default ignores which are needed for JDK 9, cause in JDK 9 and above the <code>module-info.class</code> will be
     * duplicated in any jar file. Furthermore in use cases for multi release jars the <code>module-info.class</code> is
     * also contained several times.
     */
    private static final String[] DEFAULT_CLASSES_IGNORES = { "module-info", "META-INF/versions/*/module-info" };

    /**
     * The failure message
     */
    private String message;
    
    /**
     * List of classes to ignore. Wildcard at the end accepted
     */
    private String[] ignoreClasses;

    /**
     * If {@code false} then the rule will fail at the first duplicate, if {@code true} then the rule will fail at
     * the end.
     */
    private boolean findAllDuplicates;

    /**
     * List of dependencies for which you want to ignore specific classes.
     */
    private List<Dependency> dependencies;