[ 
https://issues.apache.org/jira/browse/MJAR-296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17835032#comment-17835032
 ] 

ASF GitHub Bot commented on MJAR-296:
-------------------------------------

slawekjaranowski commented on code in PR #67:
URL: https://github.com/apache/maven-jar-plugin/pull/67#discussion_r1556394734


##########
src/it/MJAR-296/pom.xml:
##########
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>mjar-296-suppress-default-excludes</artifactId>
+  <name>mjar-296-suppress-default-excludes</name>
+  <description>Verifies that the resulting jar includes files excluded by 
default</description>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    
<project.build.outputTimestamp>2023-11-19T13:25:58Z</project.build.outputTimestamp>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <addDefaultExcludes>false</addDefaultExcludes>

Review Comment:
   we also need a test with true value 





> No way to suppress default excludes in maven-jar-plugin
> -------------------------------------------------------
>
>                 Key: MJAR-296
>                 URL: https://issues.apache.org/jira/browse/MJAR-296
>             Project: Maven JAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.3.0
>            Reporter: G.Vaysman
>            Priority: Major
>         Attachments: jar-default-excludes.zip
>
>
> With the default excludes being expanded further (see 
> org.codehaus.plexus.util.AbstractScanner.{*}_DEFAULTEXCLUDES_{*}), a resource 
> directory **/ChangeSet/** will never be included in the JAR artifact.
> Some plugins (maven-resources-plugin, maven-assembly-plugin) already allow 
> suppressing the exclusion, but not the maven-jar-plugin. Code analysis of the 
> JarMojo -> DirectoryScanner call path confirms that there is no way to affect 
> the FileSet configuration. 
> Again, with ever expanding list of *_DEFAULTEXCLUDES,_* this, on our opinion, 
> is quite detrimental, and due to backward compatibility, changing 
> resource/package path (say, to ChangeSet2) is not an option. 
> I am attaching a very simple project that shows two things:
>  # The jar plugin skips adding the **/ChangeSet/** files
>  # The resources plugin is configured not to skip (addDefaultExcludes) and 
> behaves properly



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to