jira-importer commented on issue #315:
URL: 
https://github.com/apache/maven-install-plugin/issues/315#issuecomment-2771867695

   **[Christian 
Kohlschütter](https://issues.apache.org/jira/secure/[email protected])**
 commented
   
   Thanks for the clarification!
   
   The declaration of the jar plugin is in a parent POM that is supposed to be 
applied for any subprojects. This had worked until version 3.1.1. Such a change 
in behavior in a patch-level release is very unexpected, and also not declared 
in the change log.
   
   I'm not arguing that this should be correct behavior, it just happened to be 
the previous one.
   
   I have fixed my configuration by adding a profile that disables the 
maven-jar-plugin as much as possible for POM artifacts, as follows:
   
   ```xml
   <profile>
     <id>disable-jar-plugin-for-pom</id>
     <activation>
       <property>
         <name>packaging</name>
         <value>pom</value>
       </property>
     </activation>
     <build>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
           <configuration>
             <skipIfEmpty>true</skipIfEmpty>
             <classifier>disabled</classifier><!-- just in case -->
           </configuration>
         </plugin>
       </plugins>
     </build>
   </profile>
   ```
   
   There's no "skip" configuration attribute in maven-jar-plugin, so we use 
"skipIfEmpty", which should always be true for POM artifacts. In case that 
assumption does not hold true, we specify a classifier for that artifact so the 
POM file does not get overwritten by an archive.
   
   I assume the second part will no longer be necessary in version 3.1.3 
because it would fail in case the jar wasn't empty, right?
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to