You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slawekjaranowski (via GitHub)" <gi...@apache.org> on 2023/02/01 21:06:35 UTC

[GitHub] [maven-compiler-plugin] slawekjaranowski commented on a diff in pull request #173: [MCOMPILER-395] Allow dependency exclusions for 'annotationProcessorPaths'

slawekjaranowski commented on code in PR #173:
URL: https://github.com/apache/maven-compiler-plugin/pull/173#discussion_r1093727661


##########
src/main/java/org/apache/maven/plugin/compiler/DependencyExclusion.java:
##########
@@ -0,0 +1,114 @@
+package org.apache.maven.plugin.compiler;
+
+/*
+ * 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.
+ */
+
+import java.util.Objects;
+
+/**
+ * Simple representation of a Maven dependency exclusion.
+ */
+public class DependencyExclusion
+{
+    private String groupId;
+
+    private String artifactId;
+
+    private String classifier;
+
+    private String extension = "jar";
+
+    public String getGroupId()
+    {
+        return groupId;
+    }
+
+    public void setGroupId( String groupId )
+    {
+        this.groupId = groupId;
+    }
+
+    public String getArtifactId()
+    {
+        return artifactId;
+    }
+
+    public void setArtifactId( String artifactId )
+    {
+        this.artifactId = artifactId;
+    }
+
+    public String getClassifier()
+    {
+        return classifier;
+    }
+
+    public void setClassifier( String classifier )
+    {
+        this.classifier = classifier;
+    }
+
+    public String getExtension()
+    {
+        return extension;
+    }
+
+    public void setExtension( String extension )
+    {
+        this.extension = extension;
+    }
+
+    @Override
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+        {
+            return true;
+        }
+        if ( obj == null || getClass() != obj.getClass() )
+        {
+            return false;
+        }
+        DependencyExclusion other = (DependencyExclusion) obj;
+        return Objects.equals( groupId, other.groupId )
+                && Objects.equals( artifactId, other.artifactId )
+                && Objects.equals( classifier, other.classifier )
+                && Objects.equals( extension, other.extension );
+    }
+
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ( ( artifactId == null ) ? 0 : artifactId.hashCode() );
+        result = prime * result + ( ( classifier == null ) ? 0 : classifier.hashCode() );
+        result = prime * result + ( ( groupId == null ) ? 0 : groupId.hashCode() );
+        result = prime * result + ( ( classifier == null ) ? 0 : classifier.hashCode() );
+        result = prime * result + ( ( extension == null ) ? 0 : extension.hashCode() );

Review Comment:
   looks better



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org